diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index 0b304871a6..66856f0b99 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -1598,18 +1598,17 @@ public extension Api { } return nil } - - static func parse(_ reader: BufferReader, signature: Int32) -> Any? { - if let parser = parsers[signature] { - return parser(reader) - } - else { - telegramApiLog("Type constructor \(String(UInt32(bitPattern: signature), radix: 16, uppercase: false)) not found") - return nil - } + + static func parse(_ reader: BufferReader, signature: Int32) -> Any? { + if let parser = parsers[signature] { + return parser(reader) + } else { + telegramApiLog("Type constructor \(String(UInt32(bitPattern: signature), radix: 16, uppercase: false)) not found") + return nil } - - static func parseVector(_ reader: BufferReader, elementSignature: Int32, elementType: T.Type) -> [T]? { + } + + static func parseVector(_ reader: BufferReader, elementSignature: Int32, elementType: T.Type) -> [T]? { if let count = reader.readInt32() { var array = [T]() var i: Int32 = 0 @@ -1618,8 +1617,7 @@ public extension Api { if elementSignature == 0 { if let unboxedSignature = reader.readInt32() { signature = unboxedSignature - } - else { + } else { return nil } } @@ -1630,12 +1628,11 @@ public extension Api { return nil } } else { - if let item = Api.parse(reader, signature: signature) as? T { - array.append(item) - } - else { - return nil - } + if let item = Api.parse(reader, signature: signature) as? T { + array.append(item) + } else { + return nil + } } i += 1 } @@ -1643,1172 +1640,1171 @@ public extension Api { } return nil } - + static func serializeObject(_ object: Any, buffer: Buffer, boxed: Swift.Bool) { switch object { - case let _1 as Api.AccountDaysTTL: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuBot: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuBotIcon: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuBotIconColor: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuBots: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuBotsBot: - _1.serialize(buffer, boxed) - case let _1 as Api.AttachMenuPeerType: - _1.serialize(buffer, boxed) - case let _1 as Api.AuctionBidLevel: - _1.serialize(buffer, boxed) - case let _1 as Api.Authorization: - _1.serialize(buffer, boxed) - case let _1 as Api.AutoDownloadSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.AutoSaveException: - _1.serialize(buffer, boxed) - case let _1 as Api.AutoSaveSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.AvailableEffect: - _1.serialize(buffer, boxed) - case let _1 as Api.AvailableReaction: - _1.serialize(buffer, boxed) - case let _1 as Api.BankCardOpenUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.BaseTheme: - _1.serialize(buffer, boxed) - case let _1 as Api.Birthday: - _1.serialize(buffer, boxed) - case let _1 as Api.Bool: - _1.serialize(buffer, boxed) - case let _1 as Api.Boost: - _1.serialize(buffer, boxed) - case let _1 as Api.BotApp: - _1.serialize(buffer, boxed) - case let _1 as Api.BotAppSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.BotBusinessConnection: - _1.serialize(buffer, boxed) - case let _1 as Api.BotCommand: - _1.serialize(buffer, boxed) - case let _1 as Api.BotCommandScope: - _1.serialize(buffer, boxed) - case let _1 as Api.BotInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.BotInlineMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.BotInlineResult: - _1.serialize(buffer, boxed) - case let _1 as Api.BotMenuButton: - _1.serialize(buffer, boxed) - case let _1 as Api.BotPreviewMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.BotVerification: - _1.serialize(buffer, boxed) - case let _1 as Api.BotVerifierSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessAwayMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessAwayMessageSchedule: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessBotRecipients: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessBotRights: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessChatLink: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessGreetingMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessIntro: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessLocation: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessRecipients: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessWeeklyOpen: - _1.serialize(buffer, boxed) - case let _1 as Api.BusinessWorkHours: - _1.serialize(buffer, boxed) - case let _1 as Api.CdnConfig: - _1.serialize(buffer, boxed) - case let _1 as Api.CdnPublicKey: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelAdminLogEvent: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelAdminLogEventAction: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelAdminLogEventsFilter: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelLocation: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelMessagesFilter: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelParticipant: - _1.serialize(buffer, boxed) - case let _1 as Api.ChannelParticipantsFilter: - _1.serialize(buffer, boxed) - case let _1 as Api.Chat: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatAdminRights: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatAdminWithInvites: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatBannedRights: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatFull: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatInviteImporter: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatOnlines: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatParticipant: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatParticipants: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatPhoto: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatReactions: - _1.serialize(buffer, boxed) - case let _1 as Api.ChatTheme: - _1.serialize(buffer, boxed) - case let _1 as Api.CodeSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.Config: - _1.serialize(buffer, boxed) - case let _1 as Api.ConnectedBot: - _1.serialize(buffer, boxed) - case let _1 as Api.ConnectedBotStarRef: - _1.serialize(buffer, boxed) - case let _1 as Api.Contact: - _1.serialize(buffer, boxed) - case let _1 as Api.ContactBirthday: - _1.serialize(buffer, boxed) - case let _1 as Api.ContactStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.DataJSON: - _1.serialize(buffer, boxed) - case let _1 as Api.DcOption: - _1.serialize(buffer, boxed) - case let _1 as Api.DefaultHistoryTTL: - _1.serialize(buffer, boxed) - case let _1 as Api.Dialog: - _1.serialize(buffer, boxed) - case let _1 as Api.DialogFilter: - _1.serialize(buffer, boxed) - case let _1 as Api.DialogFilterSuggested: - _1.serialize(buffer, boxed) - case let _1 as Api.DialogPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.DisallowedGiftsSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.Document: - _1.serialize(buffer, boxed) - case let _1 as Api.DocumentAttribute: - _1.serialize(buffer, boxed) - case let _1 as Api.DraftMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.EmailVerification: - _1.serialize(buffer, boxed) - case let _1 as Api.EmailVerifyPurpose: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiGroup: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiKeyword: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiKeywordsDifference: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiLanguage: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiList: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.EmojiURL: - _1.serialize(buffer, boxed) - case let _1 as Api.EncryptedChat: - _1.serialize(buffer, boxed) - case let _1 as Api.EncryptedFile: - _1.serialize(buffer, boxed) - case let _1 as Api.EncryptedMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.ExportedChatInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.ExportedChatlistInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.ExportedContactToken: - _1.serialize(buffer, boxed) - case let _1 as Api.ExportedMessageLink: - _1.serialize(buffer, boxed) - case let _1 as Api.ExportedStoryLink: - _1.serialize(buffer, boxed) - case let _1 as Api.FactCheck: - _1.serialize(buffer, boxed) - case let _1 as Api.FileHash: - _1.serialize(buffer, boxed) - case let _1 as Api.Folder: - _1.serialize(buffer, boxed) - case let _1 as Api.FolderPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.ForumTopic: - _1.serialize(buffer, boxed) - case let _1 as Api.FoundStory: - _1.serialize(buffer, boxed) - case let _1 as Api.Game: - _1.serialize(buffer, boxed) - case let _1 as Api.GeoPoint: - _1.serialize(buffer, boxed) - case let _1 as Api.GeoPointAddress: - _1.serialize(buffer, boxed) - case let _1 as Api.GlobalPrivacySettings: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCall: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallDonor: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallParticipant: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallParticipantVideo: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallParticipantVideoSourceGroup: - _1.serialize(buffer, boxed) - case let _1 as Api.GroupCallStreamChannel: - _1.serialize(buffer, boxed) - case let _1 as Api.HighScore: - _1.serialize(buffer, boxed) - case let _1 as Api.ImportedContact: - _1.serialize(buffer, boxed) - case let _1 as Api.InlineBotSwitchPM: - _1.serialize(buffer, boxed) - case let _1 as Api.InlineBotWebView: - _1.serialize(buffer, boxed) - case let _1 as Api.InlineQueryPeerType: - _1.serialize(buffer, boxed) - case let _1 as Api.InputAppEvent: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBotApp: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBotInlineMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBotInlineMessageID: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBotInlineResult: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessAwayMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessBotRecipients: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessChatLink: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessGreetingMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessIntro: - _1.serialize(buffer, boxed) - case let _1 as Api.InputBusinessRecipients: - _1.serialize(buffer, boxed) - case let _1 as Api.InputChannel: - _1.serialize(buffer, boxed) - case let _1 as Api.InputChatPhoto: - _1.serialize(buffer, boxed) - case let _1 as Api.InputChatTheme: - _1.serialize(buffer, boxed) - case let _1 as Api.InputChatlist: - _1.serialize(buffer, boxed) - case let _1 as Api.InputCheckPasswordSRP: - _1.serialize(buffer, boxed) - case let _1 as Api.InputClientProxy: - _1.serialize(buffer, boxed) - case let _1 as Api.InputCollectible: - _1.serialize(buffer, boxed) - case let _1 as Api.InputContact: - _1.serialize(buffer, boxed) - case let _1 as Api.InputDialogPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.InputDocument: - _1.serialize(buffer, boxed) - case let _1 as Api.InputEncryptedChat: - _1.serialize(buffer, boxed) - case let _1 as Api.InputEncryptedFile: - _1.serialize(buffer, boxed) - case let _1 as Api.InputFile: - _1.serialize(buffer, boxed) - case let _1 as Api.InputFileLocation: - _1.serialize(buffer, boxed) - case let _1 as Api.InputFolderPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.InputGame: - _1.serialize(buffer, boxed) - case let _1 as Api.InputGeoPoint: - _1.serialize(buffer, boxed) - case let _1 as Api.InputGroupCall: - _1.serialize(buffer, boxed) - case let _1 as Api.InputInvoice: - _1.serialize(buffer, boxed) - case let _1 as Api.InputMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.InputMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.InputNotifyPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPasskeyCredential: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPasskeyResponse: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPaymentCredentials: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPeerNotifySettings: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPhoneCall: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPhoto: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPrivacyKey: - _1.serialize(buffer, boxed) - case let _1 as Api.InputPrivacyRule: - _1.serialize(buffer, boxed) - case let _1 as Api.InputQuickReplyShortcut: - _1.serialize(buffer, boxed) - case let _1 as Api.InputReplyTo: - _1.serialize(buffer, boxed) - case let _1 as Api.InputSavedStarGift: - _1.serialize(buffer, boxed) - case let _1 as Api.InputSecureFile: - _1.serialize(buffer, boxed) - case let _1 as Api.InputSecureValue: - _1.serialize(buffer, boxed) - case let _1 as Api.InputSingleMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStarGiftAuction: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStarsTransaction: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStickerSet: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStickerSetItem: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStickeredMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.InputStorePaymentPurpose: - _1.serialize(buffer, boxed) - case let _1 as Api.InputTheme: - _1.serialize(buffer, boxed) - case let _1 as Api.InputThemeSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.InputUser: - _1.serialize(buffer, boxed) - case let _1 as Api.InputWallPaper: - _1.serialize(buffer, boxed) - case let _1 as Api.InputWebDocument: - _1.serialize(buffer, boxed) - case let _1 as Api.InputWebFileLocation: - _1.serialize(buffer, boxed) - case let _1 as Api.Invoice: - _1.serialize(buffer, boxed) - case let _1 as Api.JSONObjectValue: - _1.serialize(buffer, boxed) - case let _1 as Api.JSONValue: - _1.serialize(buffer, boxed) - case let _1 as Api.KeyboardButton: - _1.serialize(buffer, boxed) - case let _1 as Api.KeyboardButtonRow: - _1.serialize(buffer, boxed) - case let _1 as Api.LabeledPrice: - _1.serialize(buffer, boxed) - case let _1 as Api.LangPackDifference: - _1.serialize(buffer, boxed) - case let _1 as Api.LangPackLanguage: - _1.serialize(buffer, boxed) - case let _1 as Api.LangPackString: - _1.serialize(buffer, boxed) - case let _1 as Api.MaskCoords: - _1.serialize(buffer, boxed) - case let _1 as Api.MediaArea: - _1.serialize(buffer, boxed) - case let _1 as Api.MediaAreaCoordinates: - _1.serialize(buffer, boxed) - case let _1 as Api.Message: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageAction: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageEntity: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageExtendedMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageFwdHeader: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageMedia: - _1.serialize(buffer, boxed) - case let _1 as Api.MessagePeerReaction: - _1.serialize(buffer, boxed) - case let _1 as Api.MessagePeerVote: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageRange: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageReactions: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageReactor: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageReplies: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageReplyHeader: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageReportOption: - _1.serialize(buffer, boxed) - case let _1 as Api.MessageViews: - _1.serialize(buffer, boxed) - case let _1 as Api.MessagesFilter: - _1.serialize(buffer, boxed) - case let _1 as Api.MissingInvitee: - _1.serialize(buffer, boxed) - case let _1 as Api.MyBoost: - _1.serialize(buffer, boxed) - case let _1 as Api.NearestDc: - _1.serialize(buffer, boxed) - case let _1 as Api.NotificationSound: - _1.serialize(buffer, boxed) - case let _1 as Api.NotifyPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.OutboxReadDate: - _1.serialize(buffer, boxed) - case let _1 as Api.Page: - _1.serialize(buffer, boxed) - case let _1 as Api.PageBlock: - _1.serialize(buffer, boxed) - case let _1 as Api.PageCaption: - _1.serialize(buffer, boxed) - case let _1 as Api.PageListItem: - _1.serialize(buffer, boxed) - case let _1 as Api.PageListOrderedItem: - _1.serialize(buffer, boxed) - case let _1 as Api.PageRelatedArticle: - _1.serialize(buffer, boxed) - case let _1 as Api.PageTableCell: - _1.serialize(buffer, boxed) - case let _1 as Api.PageTableRow: - _1.serialize(buffer, boxed) - case let _1 as Api.PaidReactionPrivacy: - _1.serialize(buffer, boxed) - case let _1 as Api.Passkey: - _1.serialize(buffer, boxed) - case let _1 as Api.PasswordKdfAlgo: - _1.serialize(buffer, boxed) - case let _1 as Api.PaymentCharge: - _1.serialize(buffer, boxed) - case let _1 as Api.PaymentFormMethod: - _1.serialize(buffer, boxed) - case let _1 as Api.PaymentRequestedInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.PaymentSavedCredentials: - _1.serialize(buffer, boxed) - case let _1 as Api.Peer: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerBlocked: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerColor: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerLocated: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerNotifySettings: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.PeerStories: - _1.serialize(buffer, boxed) - case let _1 as Api.PendingSuggestion: - _1.serialize(buffer, boxed) - case let _1 as Api.PhoneCall: - _1.serialize(buffer, boxed) - case let _1 as Api.PhoneCallDiscardReason: - _1.serialize(buffer, boxed) - case let _1 as Api.PhoneCallProtocol: - _1.serialize(buffer, boxed) - case let _1 as Api.PhoneConnection: - _1.serialize(buffer, boxed) - case let _1 as Api.Photo: - _1.serialize(buffer, boxed) - case let _1 as Api.PhotoSize: - _1.serialize(buffer, boxed) - case let _1 as Api.Poll: - _1.serialize(buffer, boxed) - case let _1 as Api.PollAnswer: - _1.serialize(buffer, boxed) - case let _1 as Api.PollAnswerVoters: - _1.serialize(buffer, boxed) - case let _1 as Api.PollResults: - _1.serialize(buffer, boxed) - case let _1 as Api.PopularContact: - _1.serialize(buffer, boxed) - case let _1 as Api.PostAddress: - _1.serialize(buffer, boxed) - case let _1 as Api.PostInteractionCounters: - _1.serialize(buffer, boxed) - case let _1 as Api.PremiumGiftCodeOption: - _1.serialize(buffer, boxed) - case let _1 as Api.PremiumSubscriptionOption: - _1.serialize(buffer, boxed) - case let _1 as Api.PrepaidGiveaway: - _1.serialize(buffer, boxed) - case let _1 as Api.PrivacyKey: - _1.serialize(buffer, boxed) - case let _1 as Api.PrivacyRule: - _1.serialize(buffer, boxed) - case let _1 as Api.ProfileTab: - _1.serialize(buffer, boxed) - case let _1 as Api.PublicForward: - _1.serialize(buffer, boxed) - case let _1 as Api.QuickReply: - _1.serialize(buffer, boxed) - case let _1 as Api.Reaction: - _1.serialize(buffer, boxed) - case let _1 as Api.ReactionCount: - _1.serialize(buffer, boxed) - case let _1 as Api.ReactionNotificationsFrom: - _1.serialize(buffer, boxed) - case let _1 as Api.ReactionsNotifySettings: - _1.serialize(buffer, boxed) - case let _1 as Api.ReadParticipantDate: - _1.serialize(buffer, boxed) - case let _1 as Api.ReceivedNotifyMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.RecentMeUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.RecentStory: - _1.serialize(buffer, boxed) - case let _1 as Api.ReplyMarkup: - _1.serialize(buffer, boxed) - case let _1 as Api.ReportReason: - _1.serialize(buffer, boxed) - case let _1 as Api.ReportResult: - _1.serialize(buffer, boxed) - case let _1 as Api.RequestPeerType: - _1.serialize(buffer, boxed) - case let _1 as Api.RequestedPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.RequirementToContact: - _1.serialize(buffer, boxed) - case let _1 as Api.RestrictionReason: - _1.serialize(buffer, boxed) - case let _1 as Api.RichText: - _1.serialize(buffer, boxed) - case let _1 as Api.SavedContact: - _1.serialize(buffer, boxed) - case let _1 as Api.SavedDialog: - _1.serialize(buffer, boxed) - case let _1 as Api.SavedReactionTag: - _1.serialize(buffer, boxed) - case let _1 as Api.SavedStarGift: - _1.serialize(buffer, boxed) - case let _1 as Api.SearchPostsFlood: - _1.serialize(buffer, boxed) - case let _1 as Api.SearchResultsCalendarPeriod: - _1.serialize(buffer, boxed) - case let _1 as Api.SearchResultsPosition: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureCredentialsEncrypted: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureData: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureFile: - _1.serialize(buffer, boxed) - case let _1 as Api.SecurePasswordKdfAlgo: - _1.serialize(buffer, boxed) - case let _1 as Api.SecurePlainData: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureRequiredType: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureSecretSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureValue: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureValueError: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureValueHash: - _1.serialize(buffer, boxed) - case let _1 as Api.SecureValueType: - _1.serialize(buffer, boxed) - case let _1 as Api.SendAsPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.SendMessageAction: - _1.serialize(buffer, boxed) - case let _1 as Api.ShippingOption: - _1.serialize(buffer, boxed) - case let _1 as Api.SmsJob: - _1.serialize(buffer, boxed) - case let _1 as Api.SponsoredMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.SponsoredMessageReportOption: - _1.serialize(buffer, boxed) - case let _1 as Api.SponsoredPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGift: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftActiveAuctionState: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAttribute: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAttributeCounter: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAttributeId: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAttributeRarity: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAuctionAcquiredGift: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAuctionRound: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAuctionState: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftAuctionUserState: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftBackground: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftCollection: - _1.serialize(buffer, boxed) - case let _1 as Api.StarGiftUpgradePrice: - _1.serialize(buffer, boxed) - case let _1 as Api.StarRefProgram: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsAmount: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsGiftOption: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsGiveawayOption: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsGiveawayWinnersOption: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsRating: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsRevenueStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsSubscription: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsSubscriptionPricing: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsTopupOption: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsTransaction: - _1.serialize(buffer, boxed) - case let _1 as Api.StarsTransactionPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsAbsValueAndPrev: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsDateRangeDays: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsGraph: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsGroupTopAdmin: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsGroupTopInviter: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsGroupTopPoster: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsPercentValue: - _1.serialize(buffer, boxed) - case let _1 as Api.StatsURL: - _1.serialize(buffer, boxed) - case let _1 as Api.StickerKeyword: - _1.serialize(buffer, boxed) - case let _1 as Api.StickerPack: - _1.serialize(buffer, boxed) - case let _1 as Api.StickerSet: - _1.serialize(buffer, boxed) - case let _1 as Api.StickerSetCovered: - _1.serialize(buffer, boxed) - case let _1 as Api.StoriesStealthMode: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryAlbum: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryFwdHeader: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryItem: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryReaction: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryView: - _1.serialize(buffer, boxed) - case let _1 as Api.StoryViews: - _1.serialize(buffer, boxed) - case let _1 as Api.SuggestedPost: - _1.serialize(buffer, boxed) - case let _1 as Api.TextWithEntities: - _1.serialize(buffer, boxed) - case let _1 as Api.Theme: - _1.serialize(buffer, boxed) - case let _1 as Api.ThemeSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.Timezone: - _1.serialize(buffer, boxed) - case let _1 as Api.TodoCompletion: - _1.serialize(buffer, boxed) - case let _1 as Api.TodoItem: - _1.serialize(buffer, boxed) - case let _1 as Api.TodoList: - _1.serialize(buffer, boxed) - case let _1 as Api.TopPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.TopPeerCategory: - _1.serialize(buffer, boxed) - case let _1 as Api.TopPeerCategoryPeers: - _1.serialize(buffer, boxed) - case let _1 as Api.Update: - _1.serialize(buffer, boxed) - case let _1 as Api.Updates: - _1.serialize(buffer, boxed) - case let _1 as Api.UrlAuthResult: - _1.serialize(buffer, boxed) - case let _1 as Api.User: - _1.serialize(buffer, boxed) - case let _1 as Api.UserFull: - _1.serialize(buffer, boxed) - case let _1 as Api.UserProfilePhoto: - _1.serialize(buffer, boxed) - case let _1 as Api.UserStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.Username: - _1.serialize(buffer, boxed) - case let _1 as Api.VideoSize: - _1.serialize(buffer, boxed) - case let _1 as Api.WallPaper: - _1.serialize(buffer, boxed) - case let _1 as Api.WallPaperSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.WebAuthorization: - _1.serialize(buffer, boxed) - case let _1 as Api.WebDocument: - _1.serialize(buffer, boxed) - case let _1 as Api.WebPage: - _1.serialize(buffer, boxed) - case let _1 as Api.WebPageAttribute: - _1.serialize(buffer, boxed) - case let _1 as Api.WebViewMessageSent: - _1.serialize(buffer, boxed) - case let _1 as Api.WebViewResult: - _1.serialize(buffer, boxed) - case let _1 as Api.account.AuthorizationForm: - _1.serialize(buffer, boxed) - case let _1 as Api.account.Authorizations: - _1.serialize(buffer, boxed) - case let _1 as Api.account.AutoDownloadSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.account.AutoSaveSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.account.BusinessChatLinks: - _1.serialize(buffer, boxed) - case let _1 as Api.account.ChatThemes: - _1.serialize(buffer, boxed) - case let _1 as Api.account.ConnectedBots: - _1.serialize(buffer, boxed) - case let _1 as Api.account.ContentSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.account.EmailVerified: - _1.serialize(buffer, boxed) - case let _1 as Api.account.EmojiStatuses: - _1.serialize(buffer, boxed) - case let _1 as Api.account.PaidMessagesRevenue: - _1.serialize(buffer, boxed) - case let _1 as Api.account.PasskeyRegistrationOptions: - _1.serialize(buffer, boxed) - case let _1 as Api.account.Passkeys: - _1.serialize(buffer, boxed) - case let _1 as Api.account.Password: - _1.serialize(buffer, boxed) - case let _1 as Api.account.PasswordInputSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.account.PasswordSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.account.PrivacyRules: - _1.serialize(buffer, boxed) - case let _1 as Api.account.ResetPasswordResult: - _1.serialize(buffer, boxed) - case let _1 as Api.account.ResolvedBusinessChatLinks: - _1.serialize(buffer, boxed) - case let _1 as Api.account.SavedMusicIds: - _1.serialize(buffer, boxed) - case let _1 as Api.account.SavedRingtone: - _1.serialize(buffer, boxed) - case let _1 as Api.account.SavedRingtones: - _1.serialize(buffer, boxed) - case let _1 as Api.account.SentEmailCode: - _1.serialize(buffer, boxed) - case let _1 as Api.account.Takeout: - _1.serialize(buffer, boxed) - case let _1 as Api.account.Themes: - _1.serialize(buffer, boxed) - case let _1 as Api.account.TmpPassword: - _1.serialize(buffer, boxed) - case let _1 as Api.account.WallPapers: - _1.serialize(buffer, boxed) - case let _1 as Api.account.WebAuthorizations: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.Authorization: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.CodeType: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.ExportedAuthorization: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.LoggedOut: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.LoginToken: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.PasskeyLoginOptions: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.PasswordRecovery: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.SentCode: - _1.serialize(buffer, boxed) - case let _1 as Api.auth.SentCodeType: - _1.serialize(buffer, boxed) - case let _1 as Api.bots.BotInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.bots.PopularAppBots: - _1.serialize(buffer, boxed) - case let _1 as Api.bots.PreviewInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.AdminLogResults: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.ChannelParticipant: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.ChannelParticipants: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.SendAsPeers: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.SponsoredMessageReportResult: - _1.serialize(buffer, boxed) - case let _1 as Api.chatlists.ChatlistInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.chatlists.ChatlistUpdates: - _1.serialize(buffer, boxed) - case let _1 as Api.chatlists.ExportedChatlistInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.chatlists.ExportedInvites: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.Blocked: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.ContactBirthdays: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.Contacts: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.Found: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.ImportedContacts: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.ResolvedPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.SponsoredPeers: - _1.serialize(buffer, boxed) - case let _1 as Api.contacts.TopPeers: - _1.serialize(buffer, boxed) - case let _1 as Api.fragment.CollectibleInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.help.AppConfig: - _1.serialize(buffer, boxed) - case let _1 as Api.help.AppUpdate: - _1.serialize(buffer, boxed) - case let _1 as Api.help.CountriesList: - _1.serialize(buffer, boxed) - case let _1 as Api.help.Country: - _1.serialize(buffer, boxed) - case let _1 as Api.help.CountryCode: - _1.serialize(buffer, boxed) - case let _1 as Api.help.DeepLinkInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.help.InviteText: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PassportConfig: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PeerColorOption: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PeerColorSet: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PeerColors: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PremiumPromo: - _1.serialize(buffer, boxed) - case let _1 as Api.help.PromoData: - _1.serialize(buffer, boxed) - case let _1 as Api.help.RecentMeUrls: - _1.serialize(buffer, boxed) - case let _1 as Api.help.Support: - _1.serialize(buffer, boxed) - case let _1 as Api.help.SupportName: - _1.serialize(buffer, boxed) - case let _1 as Api.help.TermsOfService: - _1.serialize(buffer, boxed) - case let _1 as Api.help.TermsOfServiceUpdate: - _1.serialize(buffer, boxed) - case let _1 as Api.help.TimezonesList: - _1.serialize(buffer, boxed) - case let _1 as Api.help.UserInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AffectedFoundMessages: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AffectedHistory: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AffectedMessages: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AllStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ArchivedStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AvailableEffects: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.AvailableReactions: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.BotApp: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.BotCallbackAnswer: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.BotPreparedInlineMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.BotResults: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ChatAdminsWithInvites: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ChatFull: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ChatInviteImporters: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.Chats: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.CheckedHistoryImportPeer: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.DhConfig: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.DialogFilters: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.Dialogs: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.DiscussionMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.EmojiGameInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.EmojiGameOutcome: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.EmojiGroups: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ExportedChatInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ExportedChatInvites: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.FavedStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.FeaturedStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.ForumTopics: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.FoundStickerSets: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.FoundStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.HighScores: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.HistoryImport: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.HistoryImportParsed: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.InactiveChats: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.InvitedUsers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.MessageEditData: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.MessageReactionsList: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.MessageViews: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.Messages: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.MyStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.PeerDialogs: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.PeerSettings: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.PreparedInlineMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.QuickReplies: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.Reactions: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.RecentStickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SavedDialogs: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SavedGifs: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SavedReactionTags: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SearchCounter: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SearchResultsCalendar: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SearchResultsPositions: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SentEncryptedMessage: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.SponsoredMessages: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.StickerSet: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.StickerSetInstallResult: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.Stickers: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.TranscribedAudio: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.TranslatedText: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.VotesList: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.WebPage: - _1.serialize(buffer, boxed) - case let _1 as Api.messages.WebPagePreview: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.BankCardData: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.CheckCanSendGiftResult: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.CheckedGiftCode: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.ConnectedStarRefBots: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.ExportedInvoice: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.GiveawayInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.PaymentForm: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.PaymentReceipt: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.PaymentResult: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.ResaleStarGifts: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.SavedInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.SavedStarGifts: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftActiveAuctions: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftAuctionAcquiredGifts: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftAuctionState: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftCollections: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftUpgradeAttributes: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftUpgradePreview: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGiftWithdrawalUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarGifts: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarsRevenueAdsAccountUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarsRevenueStats: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarsRevenueWithdrawalUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.StarsStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.SuggestedStarRefBots: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.UniqueStarGift: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.UniqueStarGiftValueInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.payments.ValidatedRequestedInfo: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.ExportedGroupCallInvite: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.GroupCall: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.GroupCallStars: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.GroupCallStreamChannels: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.GroupCallStreamRtmpUrl: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.GroupParticipants: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.JoinAsPeers: - _1.serialize(buffer, boxed) - case let _1 as Api.phone.PhoneCall: - _1.serialize(buffer, boxed) - case let _1 as Api.photos.Photo: - _1.serialize(buffer, boxed) - case let _1 as Api.photos.Photos: - _1.serialize(buffer, boxed) - case let _1 as Api.premium.BoostsList: - _1.serialize(buffer, boxed) - case let _1 as Api.premium.BoostsStatus: - _1.serialize(buffer, boxed) - case let _1 as Api.premium.MyBoosts: - _1.serialize(buffer, boxed) - case let _1 as Api.smsjobs.EligibilityToJoin: - _1.serialize(buffer, boxed) - case let _1 as Api.smsjobs.Status: - _1.serialize(buffer, boxed) - case let _1 as Api.stats.BroadcastStats: - _1.serialize(buffer, boxed) - case let _1 as Api.stats.MegagroupStats: - _1.serialize(buffer, boxed) - case let _1 as Api.stats.MessageStats: - _1.serialize(buffer, boxed) - case let _1 as Api.stats.PublicForwards: - _1.serialize(buffer, boxed) - case let _1 as Api.stats.StoryStats: - _1.serialize(buffer, boxed) - case let _1 as Api.stickers.SuggestedShortName: - _1.serialize(buffer, boxed) - case let _1 as Api.storage.FileType: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.Albums: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.AllStories: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.CanSendStoryCount: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.FoundStories: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.PeerStories: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.Stories: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.StoryReactionsList: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.StoryViews: - _1.serialize(buffer, boxed) - case let _1 as Api.stories.StoryViewsList: - _1.serialize(buffer, boxed) - case let _1 as Api.updates.ChannelDifference: - _1.serialize(buffer, boxed) - case let _1 as Api.updates.Difference: - _1.serialize(buffer, boxed) - case let _1 as Api.updates.State: - _1.serialize(buffer, boxed) - case let _1 as Api.upload.CdnFile: - _1.serialize(buffer, boxed) - case let _1 as Api.upload.File: - _1.serialize(buffer, boxed) - case let _1 as Api.upload.WebFile: - _1.serialize(buffer, boxed) - case let _1 as Api.users.SavedMusic: - _1.serialize(buffer, boxed) - case let _1 as Api.users.UserFull: - _1.serialize(buffer, boxed) - case let _1 as Api.users.Users: - _1.serialize(buffer, boxed) - default: - break + case let _1 as Api.AccountDaysTTL: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuBot: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuBotIcon: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuBotIconColor: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuBots: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuBotsBot: + _1.serialize(buffer, boxed) + case let _1 as Api.AttachMenuPeerType: + _1.serialize(buffer, boxed) + case let _1 as Api.AuctionBidLevel: + _1.serialize(buffer, boxed) + case let _1 as Api.Authorization: + _1.serialize(buffer, boxed) + case let _1 as Api.AutoDownloadSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.AutoSaveException: + _1.serialize(buffer, boxed) + case let _1 as Api.AutoSaveSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.AvailableEffect: + _1.serialize(buffer, boxed) + case let _1 as Api.AvailableReaction: + _1.serialize(buffer, boxed) + case let _1 as Api.BankCardOpenUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.BaseTheme: + _1.serialize(buffer, boxed) + case let _1 as Api.Birthday: + _1.serialize(buffer, boxed) + case let _1 as Api.Bool: + _1.serialize(buffer, boxed) + case let _1 as Api.Boost: + _1.serialize(buffer, boxed) + case let _1 as Api.BotApp: + _1.serialize(buffer, boxed) + case let _1 as Api.BotAppSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.BotBusinessConnection: + _1.serialize(buffer, boxed) + case let _1 as Api.BotCommand: + _1.serialize(buffer, boxed) + case let _1 as Api.BotCommandScope: + _1.serialize(buffer, boxed) + case let _1 as Api.BotInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.BotInlineMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.BotInlineResult: + _1.serialize(buffer, boxed) + case let _1 as Api.BotMenuButton: + _1.serialize(buffer, boxed) + case let _1 as Api.BotPreviewMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.BotVerification: + _1.serialize(buffer, boxed) + case let _1 as Api.BotVerifierSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessAwayMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessAwayMessageSchedule: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessBotRecipients: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessBotRights: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessChatLink: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessGreetingMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessIntro: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessLocation: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessRecipients: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessWeeklyOpen: + _1.serialize(buffer, boxed) + case let _1 as Api.BusinessWorkHours: + _1.serialize(buffer, boxed) + case let _1 as Api.CdnConfig: + _1.serialize(buffer, boxed) + case let _1 as Api.CdnPublicKey: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelAdminLogEvent: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelAdminLogEventAction: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelAdminLogEventsFilter: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelLocation: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelMessagesFilter: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelParticipant: + _1.serialize(buffer, boxed) + case let _1 as Api.ChannelParticipantsFilter: + _1.serialize(buffer, boxed) + case let _1 as Api.Chat: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatAdminRights: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatAdminWithInvites: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatBannedRights: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatFull: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatInviteImporter: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatOnlines: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatParticipant: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatParticipants: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatPhoto: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatReactions: + _1.serialize(buffer, boxed) + case let _1 as Api.ChatTheme: + _1.serialize(buffer, boxed) + case let _1 as Api.CodeSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.Config: + _1.serialize(buffer, boxed) + case let _1 as Api.ConnectedBot: + _1.serialize(buffer, boxed) + case let _1 as Api.ConnectedBotStarRef: + _1.serialize(buffer, boxed) + case let _1 as Api.Contact: + _1.serialize(buffer, boxed) + case let _1 as Api.ContactBirthday: + _1.serialize(buffer, boxed) + case let _1 as Api.ContactStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.DataJSON: + _1.serialize(buffer, boxed) + case let _1 as Api.DcOption: + _1.serialize(buffer, boxed) + case let _1 as Api.DefaultHistoryTTL: + _1.serialize(buffer, boxed) + case let _1 as Api.Dialog: + _1.serialize(buffer, boxed) + case let _1 as Api.DialogFilter: + _1.serialize(buffer, boxed) + case let _1 as Api.DialogFilterSuggested: + _1.serialize(buffer, boxed) + case let _1 as Api.DialogPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.DisallowedGiftsSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.Document: + _1.serialize(buffer, boxed) + case let _1 as Api.DocumentAttribute: + _1.serialize(buffer, boxed) + case let _1 as Api.DraftMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.EmailVerification: + _1.serialize(buffer, boxed) + case let _1 as Api.EmailVerifyPurpose: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiGroup: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiKeyword: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiKeywordsDifference: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiLanguage: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiList: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.EmojiURL: + _1.serialize(buffer, boxed) + case let _1 as Api.EncryptedChat: + _1.serialize(buffer, boxed) + case let _1 as Api.EncryptedFile: + _1.serialize(buffer, boxed) + case let _1 as Api.EncryptedMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.ExportedChatInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.ExportedChatlistInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.ExportedContactToken: + _1.serialize(buffer, boxed) + case let _1 as Api.ExportedMessageLink: + _1.serialize(buffer, boxed) + case let _1 as Api.ExportedStoryLink: + _1.serialize(buffer, boxed) + case let _1 as Api.FactCheck: + _1.serialize(buffer, boxed) + case let _1 as Api.FileHash: + _1.serialize(buffer, boxed) + case let _1 as Api.Folder: + _1.serialize(buffer, boxed) + case let _1 as Api.FolderPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.ForumTopic: + _1.serialize(buffer, boxed) + case let _1 as Api.FoundStory: + _1.serialize(buffer, boxed) + case let _1 as Api.Game: + _1.serialize(buffer, boxed) + case let _1 as Api.GeoPoint: + _1.serialize(buffer, boxed) + case let _1 as Api.GeoPointAddress: + _1.serialize(buffer, boxed) + case let _1 as Api.GlobalPrivacySettings: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCall: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallDonor: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallParticipant: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallParticipantVideo: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallParticipantVideoSourceGroup: + _1.serialize(buffer, boxed) + case let _1 as Api.GroupCallStreamChannel: + _1.serialize(buffer, boxed) + case let _1 as Api.HighScore: + _1.serialize(buffer, boxed) + case let _1 as Api.ImportedContact: + _1.serialize(buffer, boxed) + case let _1 as Api.InlineBotSwitchPM: + _1.serialize(buffer, boxed) + case let _1 as Api.InlineBotWebView: + _1.serialize(buffer, boxed) + case let _1 as Api.InlineQueryPeerType: + _1.serialize(buffer, boxed) + case let _1 as Api.InputAppEvent: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBotApp: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBotInlineMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBotInlineMessageID: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBotInlineResult: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessAwayMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessBotRecipients: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessChatLink: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessGreetingMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessIntro: + _1.serialize(buffer, boxed) + case let _1 as Api.InputBusinessRecipients: + _1.serialize(buffer, boxed) + case let _1 as Api.InputChannel: + _1.serialize(buffer, boxed) + case let _1 as Api.InputChatPhoto: + _1.serialize(buffer, boxed) + case let _1 as Api.InputChatTheme: + _1.serialize(buffer, boxed) + case let _1 as Api.InputChatlist: + _1.serialize(buffer, boxed) + case let _1 as Api.InputCheckPasswordSRP: + _1.serialize(buffer, boxed) + case let _1 as Api.InputClientProxy: + _1.serialize(buffer, boxed) + case let _1 as Api.InputCollectible: + _1.serialize(buffer, boxed) + case let _1 as Api.InputContact: + _1.serialize(buffer, boxed) + case let _1 as Api.InputDialogPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.InputDocument: + _1.serialize(buffer, boxed) + case let _1 as Api.InputEncryptedChat: + _1.serialize(buffer, boxed) + case let _1 as Api.InputEncryptedFile: + _1.serialize(buffer, boxed) + case let _1 as Api.InputFile: + _1.serialize(buffer, boxed) + case let _1 as Api.InputFileLocation: + _1.serialize(buffer, boxed) + case let _1 as Api.InputFolderPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.InputGame: + _1.serialize(buffer, boxed) + case let _1 as Api.InputGeoPoint: + _1.serialize(buffer, boxed) + case let _1 as Api.InputGroupCall: + _1.serialize(buffer, boxed) + case let _1 as Api.InputInvoice: + _1.serialize(buffer, boxed) + case let _1 as Api.InputMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.InputMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.InputNotifyPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPasskeyCredential: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPasskeyResponse: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPaymentCredentials: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPeerNotifySettings: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPhoneCall: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPhoto: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPrivacyKey: + _1.serialize(buffer, boxed) + case let _1 as Api.InputPrivacyRule: + _1.serialize(buffer, boxed) + case let _1 as Api.InputQuickReplyShortcut: + _1.serialize(buffer, boxed) + case let _1 as Api.InputReplyTo: + _1.serialize(buffer, boxed) + case let _1 as Api.InputSavedStarGift: + _1.serialize(buffer, boxed) + case let _1 as Api.InputSecureFile: + _1.serialize(buffer, boxed) + case let _1 as Api.InputSecureValue: + _1.serialize(buffer, boxed) + case let _1 as Api.InputSingleMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStarGiftAuction: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStarsTransaction: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStickerSet: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStickerSetItem: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStickeredMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.InputStorePaymentPurpose: + _1.serialize(buffer, boxed) + case let _1 as Api.InputTheme: + _1.serialize(buffer, boxed) + case let _1 as Api.InputThemeSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.InputUser: + _1.serialize(buffer, boxed) + case let _1 as Api.InputWallPaper: + _1.serialize(buffer, boxed) + case let _1 as Api.InputWebDocument: + _1.serialize(buffer, boxed) + case let _1 as Api.InputWebFileLocation: + _1.serialize(buffer, boxed) + case let _1 as Api.Invoice: + _1.serialize(buffer, boxed) + case let _1 as Api.JSONObjectValue: + _1.serialize(buffer, boxed) + case let _1 as Api.JSONValue: + _1.serialize(buffer, boxed) + case let _1 as Api.KeyboardButton: + _1.serialize(buffer, boxed) + case let _1 as Api.KeyboardButtonRow: + _1.serialize(buffer, boxed) + case let _1 as Api.LabeledPrice: + _1.serialize(buffer, boxed) + case let _1 as Api.LangPackDifference: + _1.serialize(buffer, boxed) + case let _1 as Api.LangPackLanguage: + _1.serialize(buffer, boxed) + case let _1 as Api.LangPackString: + _1.serialize(buffer, boxed) + case let _1 as Api.MaskCoords: + _1.serialize(buffer, boxed) + case let _1 as Api.MediaArea: + _1.serialize(buffer, boxed) + case let _1 as Api.MediaAreaCoordinates: + _1.serialize(buffer, boxed) + case let _1 as Api.Message: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageAction: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageEntity: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageExtendedMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageFwdHeader: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageMedia: + _1.serialize(buffer, boxed) + case let _1 as Api.MessagePeerReaction: + _1.serialize(buffer, boxed) + case let _1 as Api.MessagePeerVote: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageRange: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageReactions: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageReactor: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageReplies: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageReplyHeader: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageReportOption: + _1.serialize(buffer, boxed) + case let _1 as Api.MessageViews: + _1.serialize(buffer, boxed) + case let _1 as Api.MessagesFilter: + _1.serialize(buffer, boxed) + case let _1 as Api.MissingInvitee: + _1.serialize(buffer, boxed) + case let _1 as Api.MyBoost: + _1.serialize(buffer, boxed) + case let _1 as Api.NearestDc: + _1.serialize(buffer, boxed) + case let _1 as Api.NotificationSound: + _1.serialize(buffer, boxed) + case let _1 as Api.NotifyPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.OutboxReadDate: + _1.serialize(buffer, boxed) + case let _1 as Api.Page: + _1.serialize(buffer, boxed) + case let _1 as Api.PageBlock: + _1.serialize(buffer, boxed) + case let _1 as Api.PageCaption: + _1.serialize(buffer, boxed) + case let _1 as Api.PageListItem: + _1.serialize(buffer, boxed) + case let _1 as Api.PageListOrderedItem: + _1.serialize(buffer, boxed) + case let _1 as Api.PageRelatedArticle: + _1.serialize(buffer, boxed) + case let _1 as Api.PageTableCell: + _1.serialize(buffer, boxed) + case let _1 as Api.PageTableRow: + _1.serialize(buffer, boxed) + case let _1 as Api.PaidReactionPrivacy: + _1.serialize(buffer, boxed) + case let _1 as Api.Passkey: + _1.serialize(buffer, boxed) + case let _1 as Api.PasswordKdfAlgo: + _1.serialize(buffer, boxed) + case let _1 as Api.PaymentCharge: + _1.serialize(buffer, boxed) + case let _1 as Api.PaymentFormMethod: + _1.serialize(buffer, boxed) + case let _1 as Api.PaymentRequestedInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.PaymentSavedCredentials: + _1.serialize(buffer, boxed) + case let _1 as Api.Peer: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerBlocked: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerColor: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerLocated: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerNotifySettings: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.PeerStories: + _1.serialize(buffer, boxed) + case let _1 as Api.PendingSuggestion: + _1.serialize(buffer, boxed) + case let _1 as Api.PhoneCall: + _1.serialize(buffer, boxed) + case let _1 as Api.PhoneCallDiscardReason: + _1.serialize(buffer, boxed) + case let _1 as Api.PhoneCallProtocol: + _1.serialize(buffer, boxed) + case let _1 as Api.PhoneConnection: + _1.serialize(buffer, boxed) + case let _1 as Api.Photo: + _1.serialize(buffer, boxed) + case let _1 as Api.PhotoSize: + _1.serialize(buffer, boxed) + case let _1 as Api.Poll: + _1.serialize(buffer, boxed) + case let _1 as Api.PollAnswer: + _1.serialize(buffer, boxed) + case let _1 as Api.PollAnswerVoters: + _1.serialize(buffer, boxed) + case let _1 as Api.PollResults: + _1.serialize(buffer, boxed) + case let _1 as Api.PopularContact: + _1.serialize(buffer, boxed) + case let _1 as Api.PostAddress: + _1.serialize(buffer, boxed) + case let _1 as Api.PostInteractionCounters: + _1.serialize(buffer, boxed) + case let _1 as Api.PremiumGiftCodeOption: + _1.serialize(buffer, boxed) + case let _1 as Api.PremiumSubscriptionOption: + _1.serialize(buffer, boxed) + case let _1 as Api.PrepaidGiveaway: + _1.serialize(buffer, boxed) + case let _1 as Api.PrivacyKey: + _1.serialize(buffer, boxed) + case let _1 as Api.PrivacyRule: + _1.serialize(buffer, boxed) + case let _1 as Api.ProfileTab: + _1.serialize(buffer, boxed) + case let _1 as Api.PublicForward: + _1.serialize(buffer, boxed) + case let _1 as Api.QuickReply: + _1.serialize(buffer, boxed) + case let _1 as Api.Reaction: + _1.serialize(buffer, boxed) + case let _1 as Api.ReactionCount: + _1.serialize(buffer, boxed) + case let _1 as Api.ReactionNotificationsFrom: + _1.serialize(buffer, boxed) + case let _1 as Api.ReactionsNotifySettings: + _1.serialize(buffer, boxed) + case let _1 as Api.ReadParticipantDate: + _1.serialize(buffer, boxed) + case let _1 as Api.ReceivedNotifyMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.RecentMeUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.RecentStory: + _1.serialize(buffer, boxed) + case let _1 as Api.ReplyMarkup: + _1.serialize(buffer, boxed) + case let _1 as Api.ReportReason: + _1.serialize(buffer, boxed) + case let _1 as Api.ReportResult: + _1.serialize(buffer, boxed) + case let _1 as Api.RequestPeerType: + _1.serialize(buffer, boxed) + case let _1 as Api.RequestedPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.RequirementToContact: + _1.serialize(buffer, boxed) + case let _1 as Api.RestrictionReason: + _1.serialize(buffer, boxed) + case let _1 as Api.RichText: + _1.serialize(buffer, boxed) + case let _1 as Api.SavedContact: + _1.serialize(buffer, boxed) + case let _1 as Api.SavedDialog: + _1.serialize(buffer, boxed) + case let _1 as Api.SavedReactionTag: + _1.serialize(buffer, boxed) + case let _1 as Api.SavedStarGift: + _1.serialize(buffer, boxed) + case let _1 as Api.SearchPostsFlood: + _1.serialize(buffer, boxed) + case let _1 as Api.SearchResultsCalendarPeriod: + _1.serialize(buffer, boxed) + case let _1 as Api.SearchResultsPosition: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureCredentialsEncrypted: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureData: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureFile: + _1.serialize(buffer, boxed) + case let _1 as Api.SecurePasswordKdfAlgo: + _1.serialize(buffer, boxed) + case let _1 as Api.SecurePlainData: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureRequiredType: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureSecretSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureValue: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureValueError: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureValueHash: + _1.serialize(buffer, boxed) + case let _1 as Api.SecureValueType: + _1.serialize(buffer, boxed) + case let _1 as Api.SendAsPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.SendMessageAction: + _1.serialize(buffer, boxed) + case let _1 as Api.ShippingOption: + _1.serialize(buffer, boxed) + case let _1 as Api.SmsJob: + _1.serialize(buffer, boxed) + case let _1 as Api.SponsoredMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.SponsoredMessageReportOption: + _1.serialize(buffer, boxed) + case let _1 as Api.SponsoredPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGift: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftActiveAuctionState: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAttribute: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAttributeCounter: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAttributeId: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAttributeRarity: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAuctionAcquiredGift: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAuctionRound: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAuctionState: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftAuctionUserState: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftBackground: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftCollection: + _1.serialize(buffer, boxed) + case let _1 as Api.StarGiftUpgradePrice: + _1.serialize(buffer, boxed) + case let _1 as Api.StarRefProgram: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsAmount: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsGiftOption: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsGiveawayOption: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsGiveawayWinnersOption: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsRating: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsRevenueStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsSubscription: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsSubscriptionPricing: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsTopupOption: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsTransaction: + _1.serialize(buffer, boxed) + case let _1 as Api.StarsTransactionPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsAbsValueAndPrev: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsDateRangeDays: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsGraph: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsGroupTopAdmin: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsGroupTopInviter: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsGroupTopPoster: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsPercentValue: + _1.serialize(buffer, boxed) + case let _1 as Api.StatsURL: + _1.serialize(buffer, boxed) + case let _1 as Api.StickerKeyword: + _1.serialize(buffer, boxed) + case let _1 as Api.StickerPack: + _1.serialize(buffer, boxed) + case let _1 as Api.StickerSet: + _1.serialize(buffer, boxed) + case let _1 as Api.StickerSetCovered: + _1.serialize(buffer, boxed) + case let _1 as Api.StoriesStealthMode: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryAlbum: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryFwdHeader: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryItem: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryReaction: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryView: + _1.serialize(buffer, boxed) + case let _1 as Api.StoryViews: + _1.serialize(buffer, boxed) + case let _1 as Api.SuggestedPost: + _1.serialize(buffer, boxed) + case let _1 as Api.TextWithEntities: + _1.serialize(buffer, boxed) + case let _1 as Api.Theme: + _1.serialize(buffer, boxed) + case let _1 as Api.ThemeSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.Timezone: + _1.serialize(buffer, boxed) + case let _1 as Api.TodoCompletion: + _1.serialize(buffer, boxed) + case let _1 as Api.TodoItem: + _1.serialize(buffer, boxed) + case let _1 as Api.TodoList: + _1.serialize(buffer, boxed) + case let _1 as Api.TopPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.TopPeerCategory: + _1.serialize(buffer, boxed) + case let _1 as Api.TopPeerCategoryPeers: + _1.serialize(buffer, boxed) + case let _1 as Api.Update: + _1.serialize(buffer, boxed) + case let _1 as Api.Updates: + _1.serialize(buffer, boxed) + case let _1 as Api.UrlAuthResult: + _1.serialize(buffer, boxed) + case let _1 as Api.User: + _1.serialize(buffer, boxed) + case let _1 as Api.UserFull: + _1.serialize(buffer, boxed) + case let _1 as Api.UserProfilePhoto: + _1.serialize(buffer, boxed) + case let _1 as Api.UserStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.Username: + _1.serialize(buffer, boxed) + case let _1 as Api.VideoSize: + _1.serialize(buffer, boxed) + case let _1 as Api.WallPaper: + _1.serialize(buffer, boxed) + case let _1 as Api.WallPaperSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.WebAuthorization: + _1.serialize(buffer, boxed) + case let _1 as Api.WebDocument: + _1.serialize(buffer, boxed) + case let _1 as Api.WebPage: + _1.serialize(buffer, boxed) + case let _1 as Api.WebPageAttribute: + _1.serialize(buffer, boxed) + case let _1 as Api.WebViewMessageSent: + _1.serialize(buffer, boxed) + case let _1 as Api.WebViewResult: + _1.serialize(buffer, boxed) + case let _1 as Api.account.AuthorizationForm: + _1.serialize(buffer, boxed) + case let _1 as Api.account.Authorizations: + _1.serialize(buffer, boxed) + case let _1 as Api.account.AutoDownloadSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.account.AutoSaveSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.account.BusinessChatLinks: + _1.serialize(buffer, boxed) + case let _1 as Api.account.ChatThemes: + _1.serialize(buffer, boxed) + case let _1 as Api.account.ConnectedBots: + _1.serialize(buffer, boxed) + case let _1 as Api.account.ContentSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.account.EmailVerified: + _1.serialize(buffer, boxed) + case let _1 as Api.account.EmojiStatuses: + _1.serialize(buffer, boxed) + case let _1 as Api.account.PaidMessagesRevenue: + _1.serialize(buffer, boxed) + case let _1 as Api.account.PasskeyRegistrationOptions: + _1.serialize(buffer, boxed) + case let _1 as Api.account.Passkeys: + _1.serialize(buffer, boxed) + case let _1 as Api.account.Password: + _1.serialize(buffer, boxed) + case let _1 as Api.account.PasswordInputSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.account.PasswordSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.account.PrivacyRules: + _1.serialize(buffer, boxed) + case let _1 as Api.account.ResetPasswordResult: + _1.serialize(buffer, boxed) + case let _1 as Api.account.ResolvedBusinessChatLinks: + _1.serialize(buffer, boxed) + case let _1 as Api.account.SavedMusicIds: + _1.serialize(buffer, boxed) + case let _1 as Api.account.SavedRingtone: + _1.serialize(buffer, boxed) + case let _1 as Api.account.SavedRingtones: + _1.serialize(buffer, boxed) + case let _1 as Api.account.SentEmailCode: + _1.serialize(buffer, boxed) + case let _1 as Api.account.Takeout: + _1.serialize(buffer, boxed) + case let _1 as Api.account.Themes: + _1.serialize(buffer, boxed) + case let _1 as Api.account.TmpPassword: + _1.serialize(buffer, boxed) + case let _1 as Api.account.WallPapers: + _1.serialize(buffer, boxed) + case let _1 as Api.account.WebAuthorizations: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.Authorization: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.CodeType: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.ExportedAuthorization: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.LoggedOut: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.LoginToken: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.PasskeyLoginOptions: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.PasswordRecovery: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.SentCode: + _1.serialize(buffer, boxed) + case let _1 as Api.auth.SentCodeType: + _1.serialize(buffer, boxed) + case let _1 as Api.bots.BotInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.bots.PopularAppBots: + _1.serialize(buffer, boxed) + case let _1 as Api.bots.PreviewInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.channels.AdminLogResults: + _1.serialize(buffer, boxed) + case let _1 as Api.channels.ChannelParticipant: + _1.serialize(buffer, boxed) + case let _1 as Api.channels.ChannelParticipants: + _1.serialize(buffer, boxed) + case let _1 as Api.channels.SendAsPeers: + _1.serialize(buffer, boxed) + case let _1 as Api.channels.SponsoredMessageReportResult: + _1.serialize(buffer, boxed) + case let _1 as Api.chatlists.ChatlistInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.chatlists.ChatlistUpdates: + _1.serialize(buffer, boxed) + case let _1 as Api.chatlists.ExportedChatlistInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.chatlists.ExportedInvites: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.Blocked: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.ContactBirthdays: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.Contacts: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.Found: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.ImportedContacts: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.ResolvedPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.SponsoredPeers: + _1.serialize(buffer, boxed) + case let _1 as Api.contacts.TopPeers: + _1.serialize(buffer, boxed) + case let _1 as Api.fragment.CollectibleInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.help.AppConfig: + _1.serialize(buffer, boxed) + case let _1 as Api.help.AppUpdate: + _1.serialize(buffer, boxed) + case let _1 as Api.help.CountriesList: + _1.serialize(buffer, boxed) + case let _1 as Api.help.Country: + _1.serialize(buffer, boxed) + case let _1 as Api.help.CountryCode: + _1.serialize(buffer, boxed) + case let _1 as Api.help.DeepLinkInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.help.InviteText: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PassportConfig: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PeerColorOption: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PeerColorSet: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PeerColors: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PremiumPromo: + _1.serialize(buffer, boxed) + case let _1 as Api.help.PromoData: + _1.serialize(buffer, boxed) + case let _1 as Api.help.RecentMeUrls: + _1.serialize(buffer, boxed) + case let _1 as Api.help.Support: + _1.serialize(buffer, boxed) + case let _1 as Api.help.SupportName: + _1.serialize(buffer, boxed) + case let _1 as Api.help.TermsOfService: + _1.serialize(buffer, boxed) + case let _1 as Api.help.TermsOfServiceUpdate: + _1.serialize(buffer, boxed) + case let _1 as Api.help.TimezonesList: + _1.serialize(buffer, boxed) + case let _1 as Api.help.UserInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AffectedFoundMessages: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AffectedHistory: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AffectedMessages: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AllStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ArchivedStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AvailableEffects: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.AvailableReactions: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.BotApp: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.BotCallbackAnswer: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.BotPreparedInlineMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.BotResults: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ChatAdminsWithInvites: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ChatFull: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ChatInviteImporters: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.Chats: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.CheckedHistoryImportPeer: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.DhConfig: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.DialogFilters: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.Dialogs: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.DiscussionMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.EmojiGameInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.EmojiGameOutcome: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.EmojiGroups: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ExportedChatInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ExportedChatInvites: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.FavedStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.FeaturedStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.ForumTopics: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.FoundStickerSets: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.FoundStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.HighScores: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.HistoryImport: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.HistoryImportParsed: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.InactiveChats: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.InvitedUsers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.MessageEditData: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.MessageReactionsList: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.MessageViews: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.Messages: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.MyStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.PeerDialogs: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.PeerSettings: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.PreparedInlineMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.QuickReplies: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.Reactions: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.RecentStickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SavedDialogs: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SavedGifs: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SavedReactionTags: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SearchCounter: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SearchResultsCalendar: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SearchResultsPositions: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SentEncryptedMessage: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.SponsoredMessages: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.StickerSet: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.StickerSetInstallResult: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.Stickers: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.TranscribedAudio: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.TranslatedText: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.VotesList: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.WebPage: + _1.serialize(buffer, boxed) + case let _1 as Api.messages.WebPagePreview: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.BankCardData: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.CheckCanSendGiftResult: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.CheckedGiftCode: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.ConnectedStarRefBots: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.ExportedInvoice: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.GiveawayInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.PaymentForm: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.PaymentReceipt: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.PaymentResult: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.ResaleStarGifts: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.SavedInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.SavedStarGifts: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftActiveAuctions: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftAuctionAcquiredGifts: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftAuctionState: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftCollections: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftUpgradeAttributes: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftUpgradePreview: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGiftWithdrawalUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarGifts: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarsRevenueAdsAccountUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarsRevenueStats: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarsRevenueWithdrawalUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.StarsStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.SuggestedStarRefBots: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.UniqueStarGift: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.UniqueStarGiftValueInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.payments.ValidatedRequestedInfo: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.ExportedGroupCallInvite: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.GroupCall: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.GroupCallStars: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.GroupCallStreamChannels: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.GroupCallStreamRtmpUrl: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.GroupParticipants: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.JoinAsPeers: + _1.serialize(buffer, boxed) + case let _1 as Api.phone.PhoneCall: + _1.serialize(buffer, boxed) + case let _1 as Api.photos.Photo: + _1.serialize(buffer, boxed) + case let _1 as Api.photos.Photos: + _1.serialize(buffer, boxed) + case let _1 as Api.premium.BoostsList: + _1.serialize(buffer, boxed) + case let _1 as Api.premium.BoostsStatus: + _1.serialize(buffer, boxed) + case let _1 as Api.premium.MyBoosts: + _1.serialize(buffer, boxed) + case let _1 as Api.smsjobs.EligibilityToJoin: + _1.serialize(buffer, boxed) + case let _1 as Api.smsjobs.Status: + _1.serialize(buffer, boxed) + case let _1 as Api.stats.BroadcastStats: + _1.serialize(buffer, boxed) + case let _1 as Api.stats.MegagroupStats: + _1.serialize(buffer, boxed) + case let _1 as Api.stats.MessageStats: + _1.serialize(buffer, boxed) + case let _1 as Api.stats.PublicForwards: + _1.serialize(buffer, boxed) + case let _1 as Api.stats.StoryStats: + _1.serialize(buffer, boxed) + case let _1 as Api.stickers.SuggestedShortName: + _1.serialize(buffer, boxed) + case let _1 as Api.storage.FileType: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.Albums: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.AllStories: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.CanSendStoryCount: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.FoundStories: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.PeerStories: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.Stories: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.StoryReactionsList: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.StoryViews: + _1.serialize(buffer, boxed) + case let _1 as Api.stories.StoryViewsList: + _1.serialize(buffer, boxed) + case let _1 as Api.updates.ChannelDifference: + _1.serialize(buffer, boxed) + case let _1 as Api.updates.Difference: + _1.serialize(buffer, boxed) + case let _1 as Api.updates.State: + _1.serialize(buffer, boxed) + case let _1 as Api.upload.CdnFile: + _1.serialize(buffer, boxed) + case let _1 as Api.upload.File: + _1.serialize(buffer, boxed) + case let _1 as Api.upload.WebFile: + _1.serialize(buffer, boxed) + case let _1 as Api.users.SavedMusic: + _1.serialize(buffer, boxed) + case let _1 as Api.users.UserFull: + _1.serialize(buffer, boxed) + case let _1 as Api.users.Users: + _1.serialize(buffer, boxed) + default: + break } } - } diff --git a/submodules/TelegramApi/Sources/Api1.swift b/submodules/TelegramApi/Sources/Api1.swift index 2177c01e8c..1926282c66 100644 --- a/submodules/TelegramApi/Sources/Api1.swift +++ b/submodules/TelegramApi/Sources/Api1.swift @@ -1,73 +1,94 @@ public extension Api { enum AccountDaysTTL: TypeConstructorDescription { - case accountDaysTTL(days: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .accountDaysTTL(let days): - if boxed { - buffer.appendInt32(-1194283041) - } - serializeInt32(days, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .accountDaysTTL(let days): - return ("accountDaysTTL", [("days", days as Any)]) - } - } - + public class Cons_accountDaysTTL { + public var days: Int32 + public init(days: Int32) { + self.days = days + } + } + case accountDaysTTL(Cons_accountDaysTTL) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .accountDaysTTL(let _data): + if boxed { + buffer.appendInt32(-1194283041) + } + serializeInt32(_data.days, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .accountDaysTTL(let _data): + return ("accountDaysTTL", [("days", _data.days as Any)]) + } + } + public static func parse_accountDaysTTL(_ reader: BufferReader) -> AccountDaysTTL? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.AccountDaysTTL.accountDaysTTL(days: _1!) + return Api.AccountDaysTTL.accountDaysTTL(Cons_accountDaysTTL(days: _1!)) } else { return nil } } - } } public extension Api { enum AttachMenuBot: TypeConstructorDescription { - case attachMenuBot(flags: Int32, botId: Int64, shortName: String, peerTypes: [Api.AttachMenuPeerType]?, icons: [Api.AttachMenuBotIcon]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuBot(let flags, let botId, let shortName, let peerTypes, let icons): - if boxed { - buffer.appendInt32(-653423106) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peerTypes!.count)) - for item in peerTypes! { - item.serialize(buffer, true) - }} + public class Cons_attachMenuBot { + public var flags: Int32 + public var botId: Int64 + public var shortName: String + public var peerTypes: [Api.AttachMenuPeerType]? + public var icons: [Api.AttachMenuBotIcon] + public init(flags: Int32, botId: Int64, shortName: String, peerTypes: [Api.AttachMenuPeerType]?, icons: [Api.AttachMenuBotIcon]) { + self.flags = flags + self.botId = botId + self.shortName = shortName + self.peerTypes = peerTypes + self.icons = icons + } + } + case attachMenuBot(Cons_attachMenuBot) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuBot(let _data): + if boxed { + buffer.appendInt32(-653423106) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.shortName, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(icons.count)) - for item in icons { + buffer.appendInt32(Int32(_data.peerTypes!.count)) + for item in _data.peerTypes! { item.serialize(buffer, true) } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuBot(let flags, let botId, let shortName, let peerTypes, let icons): - return ("attachMenuBot", [("flags", flags as Any), ("botId", botId as Any), ("shortName", shortName as Any), ("peerTypes", peerTypes as Any), ("icons", icons as Any)]) - } - } - + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.icons.count)) + for item in _data.icons { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuBot(let _data): + return ("attachMenuBot", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("shortName", _data.shortName as Any), ("peerTypes", _data.peerTypes as Any), ("icons", _data.icons as Any)]) + } + } + public static func parse_attachMenuBot(_ reader: BufferReader) -> AttachMenuBot? { var _1: Int32? _1 = reader.readInt32() @@ -76,9 +97,11 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: [Api.AttachMenuPeerType]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AttachMenuPeerType.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AttachMenuPeerType.self) + } + } var _5: [Api.AttachMenuBotIcon]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AttachMenuBotIcon.self) @@ -89,44 +112,57 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.AttachMenuBot.attachMenuBot(flags: _1!, botId: _2!, shortName: _3!, peerTypes: _4, icons: _5!) + return Api.AttachMenuBot.attachMenuBot(Cons_attachMenuBot(flags: _1!, botId: _2!, shortName: _3!, peerTypes: _4, icons: _5!)) } else { return nil } } - } } public extension Api { enum AttachMenuBotIcon: TypeConstructorDescription { - case attachMenuBotIcon(flags: Int32, name: String, icon: Api.Document, colors: [Api.AttachMenuBotIconColor]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuBotIcon(let flags, let name, let icon, let colors): - if boxed { - buffer.appendInt32(-1297663893) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - icon.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(colors!.count)) - for item in colors! { + public class Cons_attachMenuBotIcon { + public var flags: Int32 + public var name: String + public var icon: Api.Document + public var colors: [Api.AttachMenuBotIconColor]? + public init(flags: Int32, name: String, icon: Api.Document, colors: [Api.AttachMenuBotIconColor]?) { + self.flags = flags + self.name = name + self.icon = icon + self.colors = colors + } + } + case attachMenuBotIcon(Cons_attachMenuBotIcon) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuBotIcon(let _data): + if boxed { + buffer.appendInt32(-1297663893) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + _data.icon.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.colors!.count)) + for item in _data.colors! { item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuBotIcon(let flags, let name, let icon, let colors): - return ("attachMenuBotIcon", [("flags", flags as Any), ("name", name as Any), ("icon", icon as Any), ("colors", colors as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuBotIcon(let _data): + return ("attachMenuBotIcon", [("flags", _data.flags as Any), ("name", _data.name as Any), ("icon", _data.icon as Any), ("colors", _data.colors as Any)]) + } + } + public static func parse_attachMenuBotIcon(_ reader: BufferReader) -> AttachMenuBotIcon? { var _1: Int32? _1 = reader.readInt32() @@ -137,46 +173,55 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.Document } var _4: [Api.AttachMenuBotIconColor]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AttachMenuBotIconColor.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AttachMenuBotIconColor.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.AttachMenuBotIcon.attachMenuBotIcon(flags: _1!, name: _2!, icon: _3!, colors: _4) + return Api.AttachMenuBotIcon.attachMenuBotIcon(Cons_attachMenuBotIcon(flags: _1!, name: _2!, icon: _3!, colors: _4)) } else { return nil } } - } } public extension Api { enum AttachMenuBotIconColor: TypeConstructorDescription { - case attachMenuBotIconColor(name: String, color: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuBotIconColor(let name, let color): - if boxed { - buffer.appendInt32(1165423600) - } - serializeString(name, buffer: buffer, boxed: false) - serializeInt32(color, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuBotIconColor(let name, let color): - return ("attachMenuBotIconColor", [("name", name as Any), ("color", color as Any)]) - } - } - + public class Cons_attachMenuBotIconColor { + public var name: String + public var color: Int32 + public init(name: String, color: Int32) { + self.name = name + self.color = color + } + } + case attachMenuBotIconColor(Cons_attachMenuBotIconColor) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuBotIconColor(let _data): + if boxed { + buffer.appendInt32(1165423600) + } + serializeString(_data.name, buffer: buffer, boxed: false) + serializeInt32(_data.color, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuBotIconColor(let _data): + return ("attachMenuBotIconColor", [("name", _data.name as Any), ("color", _data.color as Any)]) + } + } + public static func parse_attachMenuBotIconColor(_ reader: BufferReader) -> AttachMenuBotIconColor? { var _1: String? _1 = parseString(reader) @@ -185,56 +230,64 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.AttachMenuBotIconColor.attachMenuBotIconColor(name: _1!, color: _2!) + return Api.AttachMenuBotIconColor.attachMenuBotIconColor(Cons_attachMenuBotIconColor(name: _1!, color: _2!)) } else { return nil } } - } } public extension Api { enum AttachMenuBots: TypeConstructorDescription { - case attachMenuBots(hash: Int64, bots: [Api.AttachMenuBot], users: [Api.User]) + public class Cons_attachMenuBots { + public var hash: Int64 + public var bots: [Api.AttachMenuBot] + public var users: [Api.User] + public init(hash: Int64, bots: [Api.AttachMenuBot], users: [Api.User]) { + self.hash = hash + self.bots = bots + self.users = users + } + } + case attachMenuBots(Cons_attachMenuBots) case attachMenuBotsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuBots(let hash, let bots, let users): - if boxed { - buffer.appendInt32(1011024320) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(bots.count)) - for item in bots { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .attachMenuBotsNotModified: - if boxed { - buffer.appendInt32(-237467044) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuBots(let hash, let bots, let users): - return ("attachMenuBots", [("hash", hash as Any), ("bots", bots as Any), ("users", users as Any)]) - case .attachMenuBotsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuBots(let _data): + if boxed { + buffer.appendInt32(1011024320) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.bots.count)) + for item in _data.bots { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .attachMenuBotsNotModified: + if boxed { + buffer.appendInt32(-237467044) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuBots(let _data): + return ("attachMenuBots", [("hash", _data.hash as Any), ("bots", _data.bots as Any), ("users", _data.users as Any)]) + case .attachMenuBotsNotModified: return ("attachMenuBotsNotModified", []) - } - } - + } + } + public static func parse_attachMenuBots(_ reader: BufferReader) -> AttachMenuBots? { var _1: Int64? _1 = reader.readInt64() @@ -250,7 +303,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.AttachMenuBots.attachMenuBots(hash: _1!, bots: _2!, users: _3!) + return Api.AttachMenuBots.attachMenuBots(Cons_attachMenuBots(hash: _1!, bots: _2!, users: _3!)) } else { return nil @@ -259,36 +312,43 @@ public extension Api { public static func parse_attachMenuBotsNotModified(_ reader: BufferReader) -> AttachMenuBots? { return Api.AttachMenuBots.attachMenuBotsNotModified } - } } public extension Api { enum AttachMenuBotsBot: TypeConstructorDescription { - case attachMenuBotsBot(bot: Api.AttachMenuBot, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuBotsBot(let bot, let users): - if boxed { - buffer.appendInt32(-1816172929) - } - bot.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuBotsBot(let bot, let users): - return ("attachMenuBotsBot", [("bot", bot as Any), ("users", users as Any)]) - } - } - + public class Cons_attachMenuBotsBot { + public var bot: Api.AttachMenuBot + public var users: [Api.User] + public init(bot: Api.AttachMenuBot, users: [Api.User]) { + self.bot = bot + self.users = users + } + } + case attachMenuBotsBot(Cons_attachMenuBotsBot) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuBotsBot(let _data): + if boxed { + buffer.appendInt32(-1816172929) + } + _data.bot.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuBotsBot(let _data): + return ("attachMenuBotsBot", [("bot", _data.bot as Any), ("users", _data.users as Any)]) + } + } + public static func parse_attachMenuBotsBot(_ reader: BufferReader) -> AttachMenuBotsBot? { var _1: Api.AttachMenuBot? if let signature = reader.readInt32() { @@ -301,13 +361,12 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.AttachMenuBotsBot.attachMenuBotsBot(bot: _1!, users: _2!) + return Api.AttachMenuBotsBot.attachMenuBotsBot(Cons_attachMenuBotsBot(bot: _1!, users: _2!)) } else { return nil } } - } } public extension Api { @@ -317,57 +376,52 @@ public extension Api { case attachMenuPeerTypeChat case attachMenuPeerTypePM case attachMenuPeerTypeSameBotPM - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .attachMenuPeerTypeBotPM: - if boxed { - buffer.appendInt32(-1020528102) - } - - break - case .attachMenuPeerTypeBroadcast: - if boxed { - buffer.appendInt32(2080104188) - } - - break - case .attachMenuPeerTypeChat: - if boxed { - buffer.appendInt32(84480319) - } - - break - case .attachMenuPeerTypePM: - if boxed { - buffer.appendInt32(-247016673) - } - - break - case .attachMenuPeerTypeSameBotPM: - if boxed { - buffer.appendInt32(2104224014) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .attachMenuPeerTypeBotPM: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .attachMenuPeerTypeBotPM: + if boxed { + buffer.appendInt32(-1020528102) + } + break + case .attachMenuPeerTypeBroadcast: + if boxed { + buffer.appendInt32(2080104188) + } + break + case .attachMenuPeerTypeChat: + if boxed { + buffer.appendInt32(84480319) + } + break + case .attachMenuPeerTypePM: + if boxed { + buffer.appendInt32(-247016673) + } + break + case .attachMenuPeerTypeSameBotPM: + if boxed { + buffer.appendInt32(2104224014) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .attachMenuPeerTypeBotPM: return ("attachMenuPeerTypeBotPM", []) - case .attachMenuPeerTypeBroadcast: + case .attachMenuPeerTypeBroadcast: return ("attachMenuPeerTypeBroadcast", []) - case .attachMenuPeerTypeChat: + case .attachMenuPeerTypeChat: return ("attachMenuPeerTypeChat", []) - case .attachMenuPeerTypePM: + case .attachMenuPeerTypePM: return ("attachMenuPeerTypePM", []) - case .attachMenuPeerTypeSameBotPM: + case .attachMenuPeerTypeSameBotPM: return ("attachMenuPeerTypeSameBotPM", []) - } - } - + } + } + public static func parse_attachMenuPeerTypeBotPM(_ reader: BufferReader) -> AttachMenuPeerType? { return Api.AttachMenuPeerType.attachMenuPeerTypeBotPM } @@ -383,33 +437,42 @@ public extension Api { public static func parse_attachMenuPeerTypeSameBotPM(_ reader: BufferReader) -> AttachMenuPeerType? { return Api.AttachMenuPeerType.attachMenuPeerTypeSameBotPM } - } } public extension Api { enum AuctionBidLevel: TypeConstructorDescription { - case auctionBidLevel(pos: Int32, amount: Int64, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .auctionBidLevel(let pos, let amount, let date): - if boxed { - buffer.appendInt32(822231244) - } - serializeInt32(pos, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .auctionBidLevel(let pos, let amount, let date): - return ("auctionBidLevel", [("pos", pos as Any), ("amount", amount as Any), ("date", date as Any)]) - } - } - + public class Cons_auctionBidLevel { + public var pos: Int32 + public var amount: Int64 + public var date: Int32 + public init(pos: Int32, amount: Int64, date: Int32) { + self.pos = pos + self.amount = amount + self.date = date + } + } + case auctionBidLevel(Cons_auctionBidLevel) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .auctionBidLevel(let _data): + if boxed { + buffer.appendInt32(822231244) + } + serializeInt32(_data.pos, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .auctionBidLevel(let _data): + return ("auctionBidLevel", [("pos", _data.pos as Any), ("amount", _data.amount as Any), ("date", _data.date as Any)]) + } + } + public static func parse_auctionBidLevel(_ reader: BufferReader) -> AuctionBidLevel? { var _1: Int32? _1 = reader.readInt32() @@ -421,49 +484,78 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.AuctionBidLevel.auctionBidLevel(pos: _1!, amount: _2!, date: _3!) + return Api.AuctionBidLevel.auctionBidLevel(Cons_auctionBidLevel(pos: _1!, amount: _2!, date: _3!)) } else { return nil } } - } } public extension Api { enum Authorization: TypeConstructorDescription { - case authorization(flags: Int32, hash: Int64, deviceModel: String, platform: String, systemVersion: String, apiId: Int32, appName: String, appVersion: String, dateCreated: Int32, dateActive: Int32, ip: String, country: String, region: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .authorization(let flags, let hash, let deviceModel, let platform, let systemVersion, let apiId, let appName, let appVersion, let dateCreated, let dateActive, let ip, let country, let region): - if boxed { - buffer.appendInt32(-1392388579) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - serializeString(deviceModel, buffer: buffer, boxed: false) - serializeString(platform, buffer: buffer, boxed: false) - serializeString(systemVersion, buffer: buffer, boxed: false) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(appName, buffer: buffer, boxed: false) - serializeString(appVersion, buffer: buffer, boxed: false) - serializeInt32(dateCreated, buffer: buffer, boxed: false) - serializeInt32(dateActive, buffer: buffer, boxed: false) - serializeString(ip, buffer: buffer, boxed: false) - serializeString(country, buffer: buffer, boxed: false) - serializeString(region, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .authorization(let flags, let hash, let deviceModel, let platform, let systemVersion, let apiId, let appName, let appVersion, let dateCreated, let dateActive, let ip, let country, let region): - return ("authorization", [("flags", flags as Any), ("hash", hash as Any), ("deviceModel", deviceModel as Any), ("platform", platform as Any), ("systemVersion", systemVersion as Any), ("apiId", apiId as Any), ("appName", appName as Any), ("appVersion", appVersion as Any), ("dateCreated", dateCreated as Any), ("dateActive", dateActive as Any), ("ip", ip as Any), ("country", country as Any), ("region", region as Any)]) - } - } - + public class Cons_authorization { + public var flags: Int32 + public var hash: Int64 + public var deviceModel: String + public var platform: String + public var systemVersion: String + public var apiId: Int32 + public var appName: String + public var appVersion: String + public var dateCreated: Int32 + public var dateActive: Int32 + public var ip: String + public var country: String + public var region: String + public init(flags: Int32, hash: Int64, deviceModel: String, platform: String, systemVersion: String, apiId: Int32, appName: String, appVersion: String, dateCreated: Int32, dateActive: Int32, ip: String, country: String, region: String) { + self.flags = flags + self.hash = hash + self.deviceModel = deviceModel + self.platform = platform + self.systemVersion = systemVersion + self.apiId = apiId + self.appName = appName + self.appVersion = appVersion + self.dateCreated = dateCreated + self.dateActive = dateActive + self.ip = ip + self.country = country + self.region = region + } + } + case authorization(Cons_authorization) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .authorization(let _data): + if boxed { + buffer.appendInt32(-1392388579) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + serializeString(_data.deviceModel, buffer: buffer, boxed: false) + serializeString(_data.platform, buffer: buffer, boxed: false) + serializeString(_data.systemVersion, buffer: buffer, boxed: false) + serializeInt32(_data.apiId, buffer: buffer, boxed: false) + serializeString(_data.appName, buffer: buffer, boxed: false) + serializeString(_data.appVersion, buffer: buffer, boxed: false) + serializeInt32(_data.dateCreated, buffer: buffer, boxed: false) + serializeInt32(_data.dateActive, buffer: buffer, boxed: false) + serializeString(_data.ip, buffer: buffer, boxed: false) + serializeString(_data.country, buffer: buffer, boxed: false) + serializeString(_data.region, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .authorization(let _data): + return ("authorization", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("deviceModel", _data.deviceModel as Any), ("platform", _data.platform as Any), ("systemVersion", _data.systemVersion as Any), ("apiId", _data.apiId as Any), ("appName", _data.appName as Any), ("appVersion", _data.appVersion as Any), ("dateCreated", _data.dateCreated as Any), ("dateActive", _data.dateActive as Any), ("ip", _data.ip as Any), ("country", _data.country as Any), ("region", _data.region as Any)]) + } + } + public static func parse_authorization(_ reader: BufferReader) -> Authorization? { var _1: Int32? _1 = reader.readInt32() @@ -505,43 +597,60 @@ public extension Api { let _c12 = _12 != nil let _c13 = _13 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.Authorization.authorization(flags: _1!, hash: _2!, deviceModel: _3!, platform: _4!, systemVersion: _5!, apiId: _6!, appName: _7!, appVersion: _8!, dateCreated: _9!, dateActive: _10!, ip: _11!, country: _12!, region: _13!) + return Api.Authorization.authorization(Cons_authorization(flags: _1!, hash: _2!, deviceModel: _3!, platform: _4!, systemVersion: _5!, apiId: _6!, appName: _7!, appVersion: _8!, dateCreated: _9!, dateActive: _10!, ip: _11!, country: _12!, region: _13!)) } else { return nil } } - } } public extension Api { enum AutoDownloadSettings: TypeConstructorDescription { - case autoDownloadSettings(flags: Int32, photoSizeMax: Int32, videoSizeMax: Int64, fileSizeMax: Int64, videoUploadMaxbitrate: Int32, smallQueueActiveOperationsMax: Int32, largeQueueActiveOperationsMax: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .autoDownloadSettings(let flags, let photoSizeMax, let videoSizeMax, let fileSizeMax, let videoUploadMaxbitrate, let smallQueueActiveOperationsMax, let largeQueueActiveOperationsMax): - if boxed { - buffer.appendInt32(-1163561432) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(photoSizeMax, buffer: buffer, boxed: false) - serializeInt64(videoSizeMax, buffer: buffer, boxed: false) - serializeInt64(fileSizeMax, buffer: buffer, boxed: false) - serializeInt32(videoUploadMaxbitrate, buffer: buffer, boxed: false) - serializeInt32(smallQueueActiveOperationsMax, buffer: buffer, boxed: false) - serializeInt32(largeQueueActiveOperationsMax, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .autoDownloadSettings(let flags, let photoSizeMax, let videoSizeMax, let fileSizeMax, let videoUploadMaxbitrate, let smallQueueActiveOperationsMax, let largeQueueActiveOperationsMax): - return ("autoDownloadSettings", [("flags", flags as Any), ("photoSizeMax", photoSizeMax as Any), ("videoSizeMax", videoSizeMax as Any), ("fileSizeMax", fileSizeMax as Any), ("videoUploadMaxbitrate", videoUploadMaxbitrate as Any), ("smallQueueActiveOperationsMax", smallQueueActiveOperationsMax as Any), ("largeQueueActiveOperationsMax", largeQueueActiveOperationsMax as Any)]) - } - } - + public class Cons_autoDownloadSettings { + public var flags: Int32 + public var photoSizeMax: Int32 + public var videoSizeMax: Int64 + public var fileSizeMax: Int64 + public var videoUploadMaxbitrate: Int32 + public var smallQueueActiveOperationsMax: Int32 + public var largeQueueActiveOperationsMax: Int32 + public init(flags: Int32, photoSizeMax: Int32, videoSizeMax: Int64, fileSizeMax: Int64, videoUploadMaxbitrate: Int32, smallQueueActiveOperationsMax: Int32, largeQueueActiveOperationsMax: Int32) { + self.flags = flags + self.photoSizeMax = photoSizeMax + self.videoSizeMax = videoSizeMax + self.fileSizeMax = fileSizeMax + self.videoUploadMaxbitrate = videoUploadMaxbitrate + self.smallQueueActiveOperationsMax = smallQueueActiveOperationsMax + self.largeQueueActiveOperationsMax = largeQueueActiveOperationsMax + } + } + case autoDownloadSettings(Cons_autoDownloadSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .autoDownloadSettings(let _data): + if boxed { + buffer.appendInt32(-1163561432) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.photoSizeMax, buffer: buffer, boxed: false) + serializeInt64(_data.videoSizeMax, buffer: buffer, boxed: false) + serializeInt64(_data.fileSizeMax, buffer: buffer, boxed: false) + serializeInt32(_data.videoUploadMaxbitrate, buffer: buffer, boxed: false) + serializeInt32(_data.smallQueueActiveOperationsMax, buffer: buffer, boxed: false) + serializeInt32(_data.largeQueueActiveOperationsMax, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .autoDownloadSettings(let _data): + return ("autoDownloadSettings", [("flags", _data.flags as Any), ("photoSizeMax", _data.photoSizeMax as Any), ("videoSizeMax", _data.videoSizeMax as Any), ("fileSizeMax", _data.fileSizeMax as Any), ("videoUploadMaxbitrate", _data.videoUploadMaxbitrate as Any), ("smallQueueActiveOperationsMax", _data.smallQueueActiveOperationsMax as Any), ("largeQueueActiveOperationsMax", _data.largeQueueActiveOperationsMax as Any)]) + } + } + public static func parse_autoDownloadSettings(_ reader: BufferReader) -> AutoDownloadSettings? { var _1: Int32? _1 = reader.readInt32() @@ -565,38 +674,45 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.AutoDownloadSettings.autoDownloadSettings(flags: _1!, photoSizeMax: _2!, videoSizeMax: _3!, fileSizeMax: _4!, videoUploadMaxbitrate: _5!, smallQueueActiveOperationsMax: _6!, largeQueueActiveOperationsMax: _7!) + return Api.AutoDownloadSettings.autoDownloadSettings(Cons_autoDownloadSettings(flags: _1!, photoSizeMax: _2!, videoSizeMax: _3!, fileSizeMax: _4!, videoUploadMaxbitrate: _5!, smallQueueActiveOperationsMax: _6!, largeQueueActiveOperationsMax: _7!)) } else { return nil } } - } } public extension Api { enum AutoSaveException: TypeConstructorDescription { - case autoSaveException(peer: Api.Peer, settings: Api.AutoSaveSettings) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .autoSaveException(let peer, let settings): - if boxed { - buffer.appendInt32(-2124403385) - } - peer.serialize(buffer, true) - settings.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .autoSaveException(let peer, let settings): - return ("autoSaveException", [("peer", peer as Any), ("settings", settings as Any)]) - } - } - + public class Cons_autoSaveException { + public var peer: Api.Peer + public var settings: Api.AutoSaveSettings + public init(peer: Api.Peer, settings: Api.AutoSaveSettings) { + self.peer = peer + self.settings = settings + } + } + case autoSaveException(Cons_autoSaveException) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .autoSaveException(let _data): + if boxed { + buffer.appendInt32(-2124403385) + } + _data.peer.serialize(buffer, true) + _data.settings.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .autoSaveException(let _data): + return ("autoSaveException", [("peer", _data.peer as Any), ("settings", _data.settings as Any)]) + } + } + public static func parse_autoSaveException(_ reader: BufferReader) -> AutoSaveException? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -609,82 +725,112 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.AutoSaveException.autoSaveException(peer: _1!, settings: _2!) + return Api.AutoSaveException.autoSaveException(Cons_autoSaveException(peer: _1!, settings: _2!)) } else { return nil } } - } } public extension Api { enum AutoSaveSettings: TypeConstructorDescription { - case autoSaveSettings(flags: Int32, videoMaxSize: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .autoSaveSettings(let flags, let videoMaxSize): - if boxed { - buffer.appendInt32(-934791986) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(videoMaxSize!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .autoSaveSettings(let flags, let videoMaxSize): - return ("autoSaveSettings", [("flags", flags as Any), ("videoMaxSize", videoMaxSize as Any)]) - } - } - + public class Cons_autoSaveSettings { + public var flags: Int32 + public var videoMaxSize: Int64? + public init(flags: Int32, videoMaxSize: Int64?) { + self.flags = flags + self.videoMaxSize = videoMaxSize + } + } + case autoSaveSettings(Cons_autoSaveSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .autoSaveSettings(let _data): + if boxed { + buffer.appendInt32(-934791986) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.videoMaxSize!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .autoSaveSettings(let _data): + return ("autoSaveSettings", [("flags", _data.flags as Any), ("videoMaxSize", _data.videoMaxSize as Any)]) + } + } + public static func parse_autoSaveSettings(_ reader: BufferReader) -> AutoSaveSettings? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _2 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil if _c1 && _c2 { - return Api.AutoSaveSettings.autoSaveSettings(flags: _1!, videoMaxSize: _2) + return Api.AutoSaveSettings.autoSaveSettings(Cons_autoSaveSettings(flags: _1!, videoMaxSize: _2)) } else { return nil } } - } } public extension Api { enum AvailableEffect: TypeConstructorDescription { - case availableEffect(flags: Int32, id: Int64, emoticon: String, staticIconId: Int64?, effectStickerId: Int64, effectAnimationId: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .availableEffect(let flags, let id, let emoticon, let staticIconId, let effectStickerId, let effectAnimationId): - if boxed { - buffer.appendInt32(-1815879042) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(emoticon, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(staticIconId!, buffer: buffer, boxed: false)} - serializeInt64(effectStickerId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(effectAnimationId!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .availableEffect(let flags, let id, let emoticon, let staticIconId, let effectStickerId, let effectAnimationId): - return ("availableEffect", [("flags", flags as Any), ("id", id as Any), ("emoticon", emoticon as Any), ("staticIconId", staticIconId as Any), ("effectStickerId", effectStickerId as Any), ("effectAnimationId", effectAnimationId as Any)]) - } - } - + public class Cons_availableEffect { + public var flags: Int32 + public var id: Int64 + public var emoticon: String + public var staticIconId: Int64? + public var effectStickerId: Int64 + public var effectAnimationId: Int64? + public init(flags: Int32, id: Int64, emoticon: String, staticIconId: Int64?, effectStickerId: Int64, effectAnimationId: Int64?) { + self.flags = flags + self.id = id + self.emoticon = emoticon + self.staticIconId = staticIconId + self.effectStickerId = effectStickerId + self.effectAnimationId = effectAnimationId + } + } + case availableEffect(Cons_availableEffect) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .availableEffect(let _data): + if boxed { + buffer.appendInt32(-1815879042) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.emoticon, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.staticIconId!, buffer: buffer, boxed: false) + } + serializeInt64(_data.effectStickerId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.effectAnimationId!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .availableEffect(let _data): + return ("availableEffect", [("flags", _data.flags as Any), ("id", _data.id as Any), ("emoticon", _data.emoticon as Any), ("staticIconId", _data.staticIconId as Any), ("effectStickerId", _data.effectStickerId as Any), ("effectAnimationId", _data.effectAnimationId as Any)]) + } + } + public static func parse_availableEffect(_ reader: BufferReader) -> AvailableEffect? { var _1: Int32? _1 = reader.readInt32() @@ -693,11 +839,15 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } var _5: Int64? _5 = reader.readInt64() var _6: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -705,46 +855,73 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.AvailableEffect.availableEffect(flags: _1!, id: _2!, emoticon: _3!, staticIconId: _4, effectStickerId: _5!, effectAnimationId: _6) + return Api.AvailableEffect.availableEffect(Cons_availableEffect(flags: _1!, id: _2!, emoticon: _3!, staticIconId: _4, effectStickerId: _5!, effectAnimationId: _6)) } else { return nil } } - } } public extension Api { enum AvailableReaction: TypeConstructorDescription { - case availableReaction(flags: Int32, reaction: String, title: String, staticIcon: Api.Document, appearAnimation: Api.Document, selectAnimation: Api.Document, activateAnimation: Api.Document, effectAnimation: Api.Document, aroundAnimation: Api.Document?, centerIcon: Api.Document?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .availableReaction(let flags, let reaction, let title, let staticIcon, let appearAnimation, let selectAnimation, let activateAnimation, let effectAnimation, let aroundAnimation, let centerIcon): - if boxed { - buffer.appendInt32(-1065882623) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(reaction, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - staticIcon.serialize(buffer, true) - appearAnimation.serialize(buffer, true) - selectAnimation.serialize(buffer, true) - activateAnimation.serialize(buffer, true) - effectAnimation.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {aroundAnimation!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {centerIcon!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .availableReaction(let flags, let reaction, let title, let staticIcon, let appearAnimation, let selectAnimation, let activateAnimation, let effectAnimation, let aroundAnimation, let centerIcon): - return ("availableReaction", [("flags", flags as Any), ("reaction", reaction as Any), ("title", title as Any), ("staticIcon", staticIcon as Any), ("appearAnimation", appearAnimation as Any), ("selectAnimation", selectAnimation as Any), ("activateAnimation", activateAnimation as Any), ("effectAnimation", effectAnimation as Any), ("aroundAnimation", aroundAnimation as Any), ("centerIcon", centerIcon as Any)]) - } - } - + public class Cons_availableReaction { + public var flags: Int32 + public var reaction: String + public var title: String + public var staticIcon: Api.Document + public var appearAnimation: Api.Document + public var selectAnimation: Api.Document + public var activateAnimation: Api.Document + public var effectAnimation: Api.Document + public var aroundAnimation: Api.Document? + public var centerIcon: Api.Document? + public init(flags: Int32, reaction: String, title: String, staticIcon: Api.Document, appearAnimation: Api.Document, selectAnimation: Api.Document, activateAnimation: Api.Document, effectAnimation: Api.Document, aroundAnimation: Api.Document?, centerIcon: Api.Document?) { + self.flags = flags + self.reaction = reaction + self.title = title + self.staticIcon = staticIcon + self.appearAnimation = appearAnimation + self.selectAnimation = selectAnimation + self.activateAnimation = activateAnimation + self.effectAnimation = effectAnimation + self.aroundAnimation = aroundAnimation + self.centerIcon = centerIcon + } + } + case availableReaction(Cons_availableReaction) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .availableReaction(let _data): + if boxed { + buffer.appendInt32(-1065882623) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.reaction, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + _data.staticIcon.serialize(buffer, true) + _data.appearAnimation.serialize(buffer, true) + _data.selectAnimation.serialize(buffer, true) + _data.activateAnimation.serialize(buffer, true) + _data.effectAnimation.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.aroundAnimation!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.centerIcon!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .availableReaction(let _data): + return ("availableReaction", [("flags", _data.flags as Any), ("reaction", _data.reaction as Any), ("title", _data.title as Any), ("staticIcon", _data.staticIcon as Any), ("appearAnimation", _data.appearAnimation as Any), ("selectAnimation", _data.selectAnimation as Any), ("activateAnimation", _data.activateAnimation as Any), ("effectAnimation", _data.effectAnimation as Any), ("aroundAnimation", _data.aroundAnimation as Any), ("centerIcon", _data.centerIcon as Any)]) + } + } + public static func parse_availableReaction(_ reader: BufferReader) -> AvailableReaction? { var _1: Int32? _1 = reader.readInt32() @@ -773,13 +950,17 @@ public extension Api { _8 = Api.parse(reader, signature: signature) as? Api.Document } var _9: Api.Document? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _10: Api.Document? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -791,38 +972,45 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 1) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 1) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.AvailableReaction.availableReaction(flags: _1!, reaction: _2!, title: _3!, staticIcon: _4!, appearAnimation: _5!, selectAnimation: _6!, activateAnimation: _7!, effectAnimation: _8!, aroundAnimation: _9, centerIcon: _10) + return Api.AvailableReaction.availableReaction(Cons_availableReaction(flags: _1!, reaction: _2!, title: _3!, staticIcon: _4!, appearAnimation: _5!, selectAnimation: _6!, activateAnimation: _7!, effectAnimation: _8!, aroundAnimation: _9, centerIcon: _10)) } else { return nil } } - } } public extension Api { enum BankCardOpenUrl: TypeConstructorDescription { - case bankCardOpenUrl(url: String, name: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .bankCardOpenUrl(let url, let name): - if boxed { - buffer.appendInt32(-177732982) - } - serializeString(url, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .bankCardOpenUrl(let url, let name): - return ("bankCardOpenUrl", [("url", url as Any), ("name", name as Any)]) - } - } - + public class Cons_bankCardOpenUrl { + public var url: String + public var name: String + public init(url: String, name: String) { + self.url = url + self.name = name + } + } + case bankCardOpenUrl(Cons_bankCardOpenUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .bankCardOpenUrl(let _data): + if boxed { + buffer.appendInt32(-177732982) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .bankCardOpenUrl(let _data): + return ("bankCardOpenUrl", [("url", _data.url as Any), ("name", _data.name as Any)]) + } + } + public static func parse_bankCardOpenUrl(_ reader: BufferReader) -> BankCardOpenUrl? { var _1: String? _1 = parseString(reader) @@ -831,13 +1019,12 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BankCardOpenUrl.bankCardOpenUrl(url: _1!, name: _2!) + return Api.BankCardOpenUrl.bankCardOpenUrl(Cons_bankCardOpenUrl(url: _1!, name: _2!)) } else { return nil } } - } } public extension Api { @@ -847,57 +1034,52 @@ public extension Api { case baseThemeDay case baseThemeNight case baseThemeTinted - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .baseThemeArctic: - if boxed { - buffer.appendInt32(1527845466) - } - - break - case .baseThemeClassic: - if boxed { - buffer.appendInt32(-1012849566) - } - - break - case .baseThemeDay: - if boxed { - buffer.appendInt32(-69724536) - } - - break - case .baseThemeNight: - if boxed { - buffer.appendInt32(-1212997976) - } - - break - case .baseThemeTinted: - if boxed { - buffer.appendInt32(1834973166) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .baseThemeArctic: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .baseThemeArctic: + if boxed { + buffer.appendInt32(1527845466) + } + break + case .baseThemeClassic: + if boxed { + buffer.appendInt32(-1012849566) + } + break + case .baseThemeDay: + if boxed { + buffer.appendInt32(-69724536) + } + break + case .baseThemeNight: + if boxed { + buffer.appendInt32(-1212997976) + } + break + case .baseThemeTinted: + if boxed { + buffer.appendInt32(1834973166) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .baseThemeArctic: return ("baseThemeArctic", []) - case .baseThemeClassic: + case .baseThemeClassic: return ("baseThemeClassic", []) - case .baseThemeDay: + case .baseThemeDay: return ("baseThemeDay", []) - case .baseThemeNight: + case .baseThemeNight: return ("baseThemeNight", []) - case .baseThemeTinted: + case .baseThemeTinted: return ("baseThemeTinted", []) - } - } - + } + } + public static func parse_baseThemeArctic(_ reader: BufferReader) -> BaseTheme? { return Api.BaseTheme.baseThemeArctic } @@ -913,34 +1095,47 @@ public extension Api { public static func parse_baseThemeTinted(_ reader: BufferReader) -> BaseTheme? { return Api.BaseTheme.baseThemeTinted } - } } public extension Api { enum Birthday: TypeConstructorDescription { - case birthday(flags: Int32, day: Int32, month: Int32, year: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .birthday(let flags, let day, let month, let year): - if boxed { - buffer.appendInt32(1821253126) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(day, buffer: buffer, boxed: false) - serializeInt32(month, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(year!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .birthday(let flags, let day, let month, let year): - return ("birthday", [("flags", flags as Any), ("day", day as Any), ("month", month as Any), ("year", year as Any)]) - } - } - + public class Cons_birthday { + public var flags: Int32 + public var day: Int32 + public var month: Int32 + public var year: Int32? + public init(flags: Int32, day: Int32, month: Int32, year: Int32?) { + self.flags = flags + self.day = day + self.month = month + self.year = year + } + } + case birthday(Cons_birthday) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .birthday(let _data): + if boxed { + buffer.appendInt32(1821253126) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.day, buffer: buffer, boxed: false) + serializeInt32(_data.month, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.year!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .birthday(let _data): + return ("birthday", [("flags", _data.flags as Any), ("day", _data.day as Any), ("month", _data.month as Any), ("year", _data.year as Any)]) + } + } + public static func parse_birthday(_ reader: BufferReader) -> Birthday? { var _1: Int32? _1 = reader.readInt32() @@ -949,110 +1144,150 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Birthday.birthday(flags: _1!, day: _2!, month: _3!, year: _4) + return Api.Birthday.birthday(Cons_birthday(flags: _1!, day: _2!, month: _3!, year: _4)) } else { return nil } } - } } public extension Api { enum Bool: TypeConstructorDescription { case boolFalse case boolTrue - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .boolFalse: - if boxed { - buffer.appendInt32(-1132882121) - } - - break - case .boolTrue: - if boxed { - buffer.appendInt32(-1720552011) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .boolFalse: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .boolFalse: + if boxed { + buffer.appendInt32(-1132882121) + } + break + case .boolTrue: + if boxed { + buffer.appendInt32(-1720552011) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .boolFalse: return ("boolFalse", []) - case .boolTrue: + case .boolTrue: return ("boolTrue", []) - } - } - + } + } + public static func parse_boolFalse(_ reader: BufferReader) -> Bool? { return Api.Bool.boolFalse } public static func parse_boolTrue(_ reader: BufferReader) -> Bool? { return Api.Bool.boolTrue } - } } public extension Api { enum Boost: TypeConstructorDescription { - case boost(flags: Int32, id: String, userId: Int64?, giveawayMsgId: Int32?, date: Int32, expires: Int32, usedGiftSlug: String?, multiplier: Int32?, stars: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .boost(let flags, let id, let userId, let giveawayMsgId, let date, let expires, let usedGiftSlug, let multiplier, let stars): - if boxed { - buffer.appendInt32(1262359766) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(giveawayMsgId!, buffer: buffer, boxed: false)} - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(expires, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeString(usedGiftSlug!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(multiplier!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt64(stars!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .boost(let flags, let id, let userId, let giveawayMsgId, let date, let expires, let usedGiftSlug, let multiplier, let stars): - return ("boost", [("flags", flags as Any), ("id", id as Any), ("userId", userId as Any), ("giveawayMsgId", giveawayMsgId as Any), ("date", date as Any), ("expires", expires as Any), ("usedGiftSlug", usedGiftSlug as Any), ("multiplier", multiplier as Any), ("stars", stars as Any)]) - } - } - + public class Cons_boost { + public var flags: Int32 + public var id: String + public var userId: Int64? + public var giveawayMsgId: Int32? + public var date: Int32 + public var expires: Int32 + public var usedGiftSlug: String? + public var multiplier: Int32? + public var stars: Int64? + public init(flags: Int32, id: String, userId: Int64?, giveawayMsgId: Int32?, date: Int32, expires: Int32, usedGiftSlug: String?, multiplier: Int32?, stars: Int64?) { + self.flags = flags + self.id = id + self.userId = userId + self.giveawayMsgId = giveawayMsgId + self.date = date + self.expires = expires + self.usedGiftSlug = usedGiftSlug + self.multiplier = multiplier + self.stars = stars + } + } + case boost(Cons_boost) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .boost(let _data): + if boxed { + buffer.appendInt32(1262359766) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.userId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.giveawayMsgId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.usedGiftSlug!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.multiplier!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt64(_data.stars!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .boost(let _data): + return ("boost", [("flags", _data.flags as Any), ("id", _data.id as Any), ("userId", _data.userId as Any), ("giveawayMsgId", _data.giveawayMsgId as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("usedGiftSlug", _data.usedGiftSlug as Any), ("multiplier", _data.multiplier as Any), ("stars", _data.stars as Any)]) + } + } + public static func parse_boost(_ reader: BufferReader) -> Boost? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt64() + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? _6 = reader.readInt32() var _7: String? - if Int(_1!) & Int(1 << 4) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = parseString(reader) + } var _8: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _8 = reader.readInt32() + } var _9: Int64? - if Int(_1!) & Int(1 << 6) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 6) != 0 { + _9 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -1063,54 +1298,76 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Boost.boost(flags: _1!, id: _2!, userId: _3, giveawayMsgId: _4, date: _5!, expires: _6!, usedGiftSlug: _7, multiplier: _8, stars: _9) + return Api.Boost.boost(Cons_boost(flags: _1!, id: _2!, userId: _3, giveawayMsgId: _4, date: _5!, expires: _6!, usedGiftSlug: _7, multiplier: _8, stars: _9)) } else { return nil } } - } } public extension Api { enum BotApp: TypeConstructorDescription { - case botApp(flags: Int32, id: Int64, accessHash: Int64, shortName: String, title: String, description: String, photo: Api.Photo, document: Api.Document?, hash: Int64) + public class Cons_botApp { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var shortName: String + public var title: String + public var description: String + public var photo: Api.Photo + public var document: Api.Document? + public var hash: Int64 + public init(flags: Int32, id: Int64, accessHash: Int64, shortName: String, title: String, description: String, photo: Api.Photo, document: Api.Document?, hash: Int64) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.shortName = shortName + self.title = title + self.description = description + self.photo = photo + self.document = document + self.hash = hash + } + } + case botApp(Cons_botApp) case botAppNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botApp(let flags, let id, let accessHash, let shortName, let title, let description, let photo, let document, let hash): - if boxed { - buffer.appendInt32(-1778593322) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - photo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {document!.serialize(buffer, true)} - serializeInt64(hash, buffer: buffer, boxed: false) - break - case .botAppNotModified: - if boxed { - buffer.appendInt32(1571189943) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botApp(let flags, let id, let accessHash, let shortName, let title, let description, let photo, let document, let hash): - return ("botApp", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("shortName", shortName as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("document", document as Any), ("hash", hash as Any)]) - case .botAppNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botApp(let _data): + if boxed { + buffer.appendInt32(-1778593322) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.shortName, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + _data.photo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.document!.serialize(buffer, true) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + break + case .botAppNotModified: + if boxed { + buffer.appendInt32(1571189943) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botApp(let _data): + return ("botApp", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("shortName", _data.shortName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("document", _data.document as Any), ("hash", _data.hash as Any)]) + case .botAppNotModified: return ("botAppNotModified", []) - } - } - + } + } + public static func parse_botApp(_ reader: BufferReader) -> BotApp? { var _1: Int32? _1 = reader.readInt32() @@ -1129,9 +1386,11 @@ public extension Api { _7 = Api.parse(reader, signature: signature) as? Api.Photo } var _8: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _9: Int64? _9 = reader.readInt64() let _c1 = _1 != nil @@ -1144,7 +1403,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 0) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.BotApp.botApp(flags: _1!, id: _2!, accessHash: _3!, shortName: _4!, title: _5!, description: _6!, photo: _7!, document: _8, hash: _9!) + return Api.BotApp.botApp(Cons_botApp(flags: _1!, id: _2!, accessHash: _3!, shortName: _4!, title: _5!, description: _6!, photo: _7!, document: _8, hash: _9!)) } else { return nil @@ -1153,49 +1412,84 @@ public extension Api { public static func parse_botAppNotModified(_ reader: BufferReader) -> BotApp? { return Api.BotApp.botAppNotModified } - } } public extension Api { enum BotAppSettings: TypeConstructorDescription { - case botAppSettings(flags: Int32, placeholderPath: Buffer?, backgroundColor: Int32?, backgroundDarkColor: Int32?, headerColor: Int32?, headerDarkColor: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botAppSettings(let flags, let placeholderPath, let backgroundColor, let backgroundDarkColor, let headerColor, let headerDarkColor): - if boxed { - buffer.appendInt32(-912582320) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(placeholderPath!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(backgroundColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(backgroundDarkColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(headerColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(headerDarkColor!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botAppSettings(let flags, let placeholderPath, let backgroundColor, let backgroundDarkColor, let headerColor, let headerDarkColor): - return ("botAppSettings", [("flags", flags as Any), ("placeholderPath", placeholderPath as Any), ("backgroundColor", backgroundColor as Any), ("backgroundDarkColor", backgroundDarkColor as Any), ("headerColor", headerColor as Any), ("headerDarkColor", headerDarkColor as Any)]) - } - } - + public class Cons_botAppSettings { + public var flags: Int32 + public var placeholderPath: Buffer? + public var backgroundColor: Int32? + public var backgroundDarkColor: Int32? + public var headerColor: Int32? + public var headerDarkColor: Int32? + public init(flags: Int32, placeholderPath: Buffer?, backgroundColor: Int32?, backgroundDarkColor: Int32?, headerColor: Int32?, headerDarkColor: Int32?) { + self.flags = flags + self.placeholderPath = placeholderPath + self.backgroundColor = backgroundColor + self.backgroundDarkColor = backgroundDarkColor + self.headerColor = headerColor + self.headerDarkColor = headerDarkColor + } + } + case botAppSettings(Cons_botAppSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botAppSettings(let _data): + if boxed { + buffer.appendInt32(-912582320) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.placeholderPath!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.backgroundColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.backgroundDarkColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.headerColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.headerDarkColor!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botAppSettings(let _data): + return ("botAppSettings", [("flags", _data.flags as Any), ("placeholderPath", _data.placeholderPath as Any), ("backgroundColor", _data.backgroundColor as Any), ("backgroundDarkColor", _data.backgroundDarkColor as Any), ("headerColor", _data.headerColor as Any), ("headerDarkColor", _data.headerDarkColor as Any)]) + } + } + public static func parse_botAppSettings(_ reader: BufferReader) -> BotAppSettings? { var _1: Int32? _1 = reader.readInt32() var _2: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseBytes(reader) + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -1203,12 +1497,11 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.BotAppSettings.botAppSettings(flags: _1!, placeholderPath: _2, backgroundColor: _3, backgroundDarkColor: _4, headerColor: _5, headerDarkColor: _6) + return Api.BotAppSettings.botAppSettings(Cons_botAppSettings(flags: _1!, placeholderPath: _2, backgroundColor: _3, backgroundDarkColor: _4, headerColor: _5, headerDarkColor: _6)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api10.swift b/submodules/TelegramApi/Sources/Api10.swift index 6da0697789..cd73820e77 100644 --- a/submodules/TelegramApi/Sources/Api10.swift +++ b/submodules/TelegramApi/Sources/Api10.swift @@ -1,130 +1,235 @@ public extension Api { indirect enum InputFileLocation: TypeConstructorDescription { - case inputDocumentFileLocation(id: Int64, accessHash: Int64, fileReference: Buffer, thumbSize: String) - case inputEncryptedFileLocation(id: Int64, accessHash: Int64) - case inputFileLocation(volumeId: Int64, localId: Int32, secret: Int64, fileReference: Buffer) - case inputGroupCallStream(flags: Int32, call: Api.InputGroupCall, timeMs: Int64, scale: Int32, videoChannel: Int32?, videoQuality: Int32?) - case inputPeerPhotoFileLocation(flags: Int32, peer: Api.InputPeer, photoId: Int64) - case inputPhotoFileLocation(id: Int64, accessHash: Int64, fileReference: Buffer, thumbSize: String) - case inputPhotoLegacyFileLocation(id: Int64, accessHash: Int64, fileReference: Buffer, volumeId: Int64, localId: Int32, secret: Int64) - case inputSecureFileLocation(id: Int64, accessHash: Int64) - case inputStickerSetThumb(stickerset: Api.InputStickerSet, thumbVersion: Int32) + public class Cons_inputDocumentFileLocation { + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public var thumbSize: String + public init(id: Int64, accessHash: Int64, fileReference: Buffer, thumbSize: String) { + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + self.thumbSize = thumbSize + } + } + public class Cons_inputEncryptedFileLocation { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputFileLocation { + public var volumeId: Int64 + public var localId: Int32 + public var secret: Int64 + public var fileReference: Buffer + public init(volumeId: Int64, localId: Int32, secret: Int64, fileReference: Buffer) { + self.volumeId = volumeId + self.localId = localId + self.secret = secret + self.fileReference = fileReference + } + } + public class Cons_inputGroupCallStream { + public var flags: Int32 + public var call: Api.InputGroupCall + public var timeMs: Int64 + public var scale: Int32 + public var videoChannel: Int32? + public var videoQuality: Int32? + public init(flags: Int32, call: Api.InputGroupCall, timeMs: Int64, scale: Int32, videoChannel: Int32?, videoQuality: Int32?) { + self.flags = flags + self.call = call + self.timeMs = timeMs + self.scale = scale + self.videoChannel = videoChannel + self.videoQuality = videoQuality + } + } + public class Cons_inputPeerPhotoFileLocation { + public var flags: Int32 + public var peer: Api.InputPeer + public var photoId: Int64 + public init(flags: Int32, peer: Api.InputPeer, photoId: Int64) { + self.flags = flags + self.peer = peer + self.photoId = photoId + } + } + public class Cons_inputPhotoFileLocation { + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public var thumbSize: String + public init(id: Int64, accessHash: Int64, fileReference: Buffer, thumbSize: String) { + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + self.thumbSize = thumbSize + } + } + public class Cons_inputPhotoLegacyFileLocation { + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public var volumeId: Int64 + public var localId: Int32 + public var secret: Int64 + public init(id: Int64, accessHash: Int64, fileReference: Buffer, volumeId: Int64, localId: Int32, secret: Int64) { + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + self.volumeId = volumeId + self.localId = localId + self.secret = secret + } + } + public class Cons_inputSecureFileLocation { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputStickerSetThumb { + public var stickerset: Api.InputStickerSet + public var thumbVersion: Int32 + public init(stickerset: Api.InputStickerSet, thumbVersion: Int32) { + self.stickerset = stickerset + self.thumbVersion = thumbVersion + } + } + case inputDocumentFileLocation(Cons_inputDocumentFileLocation) + case inputEncryptedFileLocation(Cons_inputEncryptedFileLocation) + case inputFileLocation(Cons_inputFileLocation) + case inputGroupCallStream(Cons_inputGroupCallStream) + case inputPeerPhotoFileLocation(Cons_inputPeerPhotoFileLocation) + case inputPhotoFileLocation(Cons_inputPhotoFileLocation) + case inputPhotoLegacyFileLocation(Cons_inputPhotoLegacyFileLocation) + case inputSecureFileLocation(Cons_inputSecureFileLocation) + case inputStickerSetThumb(Cons_inputStickerSetThumb) case inputTakeoutFileLocation - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputDocumentFileLocation(let id, let accessHash, let fileReference, let thumbSize): - if boxed { - buffer.appendInt32(-1160743548) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - serializeString(thumbSize, buffer: buffer, boxed: false) - break - case .inputEncryptedFileLocation(let id, let accessHash): - if boxed { - buffer.appendInt32(-182231723) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputFileLocation(let volumeId, let localId, let secret, let fileReference): - if boxed { - buffer.appendInt32(-539317279) - } - serializeInt64(volumeId, buffer: buffer, boxed: false) - serializeInt32(localId, buffer: buffer, boxed: false) - serializeInt64(secret, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - break - case .inputGroupCallStream(let flags, let call, let timeMs, let scale, let videoChannel, let videoQuality): - if boxed { - buffer.appendInt32(93890858) - } - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - serializeInt64(timeMs, buffer: buffer, boxed: false) - serializeInt32(scale, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(videoChannel!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(videoQuality!, buffer: buffer, boxed: false)} - break - case .inputPeerPhotoFileLocation(let flags, let peer, let photoId): - if boxed { - buffer.appendInt32(925204121) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt64(photoId, buffer: buffer, boxed: false) - break - case .inputPhotoFileLocation(let id, let accessHash, let fileReference, let thumbSize): - if boxed { - buffer.appendInt32(1075322878) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - serializeString(thumbSize, buffer: buffer, boxed: false) - break - case .inputPhotoLegacyFileLocation(let id, let accessHash, let fileReference, let volumeId, let localId, let secret): - if boxed { - buffer.appendInt32(-667654413) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - serializeInt64(volumeId, buffer: buffer, boxed: false) - serializeInt32(localId, buffer: buffer, boxed: false) - serializeInt64(secret, buffer: buffer, boxed: false) - break - case .inputSecureFileLocation(let id, let accessHash): - if boxed { - buffer.appendInt32(-876089816) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputStickerSetThumb(let stickerset, let thumbVersion): - if boxed { - buffer.appendInt32(-1652231205) - } - stickerset.serialize(buffer, true) - serializeInt32(thumbVersion, buffer: buffer, boxed: false) - break - case .inputTakeoutFileLocation: - if boxed { - buffer.appendInt32(700340377) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputDocumentFileLocation(let id, let accessHash, let fileReference, let thumbSize): - return ("inputDocumentFileLocation", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any), ("thumbSize", thumbSize as Any)]) - case .inputEncryptedFileLocation(let id, let accessHash): - return ("inputEncryptedFileLocation", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputFileLocation(let volumeId, let localId, let secret, let fileReference): - return ("inputFileLocation", [("volumeId", volumeId as Any), ("localId", localId as Any), ("secret", secret as Any), ("fileReference", fileReference as Any)]) - case .inputGroupCallStream(let flags, let call, let timeMs, let scale, let videoChannel, let videoQuality): - return ("inputGroupCallStream", [("flags", flags as Any), ("call", call as Any), ("timeMs", timeMs as Any), ("scale", scale as Any), ("videoChannel", videoChannel as Any), ("videoQuality", videoQuality as Any)]) - case .inputPeerPhotoFileLocation(let flags, let peer, let photoId): - return ("inputPeerPhotoFileLocation", [("flags", flags as Any), ("peer", peer as Any), ("photoId", photoId as Any)]) - case .inputPhotoFileLocation(let id, let accessHash, let fileReference, let thumbSize): - return ("inputPhotoFileLocation", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any), ("thumbSize", thumbSize as Any)]) - case .inputPhotoLegacyFileLocation(let id, let accessHash, let fileReference, let volumeId, let localId, let secret): - return ("inputPhotoLegacyFileLocation", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any), ("volumeId", volumeId as Any), ("localId", localId as Any), ("secret", secret as Any)]) - case .inputSecureFileLocation(let id, let accessHash): - return ("inputSecureFileLocation", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputStickerSetThumb(let stickerset, let thumbVersion): - return ("inputStickerSetThumb", [("stickerset", stickerset as Any), ("thumbVersion", thumbVersion as Any)]) - case .inputTakeoutFileLocation: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputDocumentFileLocation(let _data): + if boxed { + buffer.appendInt32(-1160743548) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + serializeString(_data.thumbSize, buffer: buffer, boxed: false) + break + case .inputEncryptedFileLocation(let _data): + if boxed { + buffer.appendInt32(-182231723) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputFileLocation(let _data): + if boxed { + buffer.appendInt32(-539317279) + } + serializeInt64(_data.volumeId, buffer: buffer, boxed: false) + serializeInt32(_data.localId, buffer: buffer, boxed: false) + serializeInt64(_data.secret, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + break + case .inputGroupCallStream(let _data): + if boxed { + buffer.appendInt32(93890858) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.call.serialize(buffer, true) + serializeInt64(_data.timeMs, buffer: buffer, boxed: false) + serializeInt32(_data.scale, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.videoChannel!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.videoQuality!, buffer: buffer, boxed: false) + } + break + case .inputPeerPhotoFileLocation(let _data): + if boxed { + buffer.appendInt32(925204121) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt64(_data.photoId, buffer: buffer, boxed: false) + break + case .inputPhotoFileLocation(let _data): + if boxed { + buffer.appendInt32(1075322878) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + serializeString(_data.thumbSize, buffer: buffer, boxed: false) + break + case .inputPhotoLegacyFileLocation(let _data): + if boxed { + buffer.appendInt32(-667654413) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + serializeInt64(_data.volumeId, buffer: buffer, boxed: false) + serializeInt32(_data.localId, buffer: buffer, boxed: false) + serializeInt64(_data.secret, buffer: buffer, boxed: false) + break + case .inputSecureFileLocation(let _data): + if boxed { + buffer.appendInt32(-876089816) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputStickerSetThumb(let _data): + if boxed { + buffer.appendInt32(-1652231205) + } + _data.stickerset.serialize(buffer, true) + serializeInt32(_data.thumbVersion, buffer: buffer, boxed: false) + break + case .inputTakeoutFileLocation: + if boxed { + buffer.appendInt32(700340377) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputDocumentFileLocation(let _data): + return ("inputDocumentFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("thumbSize", _data.thumbSize as Any)]) + case .inputEncryptedFileLocation(let _data): + return ("inputEncryptedFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputFileLocation(let _data): + return ("inputFileLocation", [("volumeId", _data.volumeId as Any), ("localId", _data.localId as Any), ("secret", _data.secret as Any), ("fileReference", _data.fileReference as Any)]) + case .inputGroupCallStream(let _data): + return ("inputGroupCallStream", [("flags", _data.flags as Any), ("call", _data.call as Any), ("timeMs", _data.timeMs as Any), ("scale", _data.scale as Any), ("videoChannel", _data.videoChannel as Any), ("videoQuality", _data.videoQuality as Any)]) + case .inputPeerPhotoFileLocation(let _data): + return ("inputPeerPhotoFileLocation", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("photoId", _data.photoId as Any)]) + case .inputPhotoFileLocation(let _data): + return ("inputPhotoFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("thumbSize", _data.thumbSize as Any)]) + case .inputPhotoLegacyFileLocation(let _data): + return ("inputPhotoLegacyFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("volumeId", _data.volumeId as Any), ("localId", _data.localId as Any), ("secret", _data.secret as Any)]) + case .inputSecureFileLocation(let _data): + return ("inputSecureFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputStickerSetThumb(let _data): + return ("inputStickerSetThumb", [("stickerset", _data.stickerset as Any), ("thumbVersion", _data.thumbVersion as Any)]) + case .inputTakeoutFileLocation: return ("inputTakeoutFileLocation", []) - } - } - + } + } + public static func parse_inputDocumentFileLocation(_ reader: BufferReader) -> InputFileLocation? { var _1: Int64? _1 = reader.readInt64() @@ -139,7 +244,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputFileLocation.inputDocumentFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, thumbSize: _4!) + return Api.InputFileLocation.inputDocumentFileLocation(Cons_inputDocumentFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, thumbSize: _4!)) } else { return nil @@ -153,7 +258,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputFileLocation.inputEncryptedFileLocation(id: _1!, accessHash: _2!) + return Api.InputFileLocation.inputEncryptedFileLocation(Cons_inputEncryptedFileLocation(id: _1!, accessHash: _2!)) } else { return nil @@ -173,7 +278,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputFileLocation.inputFileLocation(volumeId: _1!, localId: _2!, secret: _3!, fileReference: _4!) + return Api.InputFileLocation.inputFileLocation(Cons_inputFileLocation(volumeId: _1!, localId: _2!, secret: _3!, fileReference: _4!)) } else { return nil @@ -191,9 +296,13 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -201,7 +310,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputFileLocation.inputGroupCallStream(flags: _1!, call: _2!, timeMs: _3!, scale: _4!, videoChannel: _5, videoQuality: _6) + return Api.InputFileLocation.inputGroupCallStream(Cons_inputGroupCallStream(flags: _1!, call: _2!, timeMs: _3!, scale: _4!, videoChannel: _5, videoQuality: _6)) } else { return nil @@ -220,7 +329,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputFileLocation.inputPeerPhotoFileLocation(flags: _1!, peer: _2!, photoId: _3!) + return Api.InputFileLocation.inputPeerPhotoFileLocation(Cons_inputPeerPhotoFileLocation(flags: _1!, peer: _2!, photoId: _3!)) } else { return nil @@ -240,7 +349,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputFileLocation.inputPhotoFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, thumbSize: _4!) + return Api.InputFileLocation.inputPhotoFileLocation(Cons_inputPhotoFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, thumbSize: _4!)) } else { return nil @@ -266,7 +375,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputFileLocation.inputPhotoLegacyFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, volumeId: _4!, localId: _5!, secret: _6!) + return Api.InputFileLocation.inputPhotoLegacyFileLocation(Cons_inputPhotoLegacyFileLocation(id: _1!, accessHash: _2!, fileReference: _3!, volumeId: _4!, localId: _5!, secret: _6!)) } else { return nil @@ -280,7 +389,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputFileLocation.inputSecureFileLocation(id: _1!, accessHash: _2!) + return Api.InputFileLocation.inputSecureFileLocation(Cons_inputSecureFileLocation(id: _1!, accessHash: _2!)) } else { return nil @@ -296,7 +405,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputFileLocation.inputStickerSetThumb(stickerset: _1!, thumbVersion: _2!) + return Api.InputFileLocation.inputStickerSetThumb(Cons_inputStickerSetThumb(stickerset: _1!, thumbVersion: _2!)) } else { return nil @@ -305,32 +414,39 @@ public extension Api { public static func parse_inputTakeoutFileLocation(_ reader: BufferReader) -> InputFileLocation? { return Api.InputFileLocation.inputTakeoutFileLocation } - } } public extension Api { indirect enum InputFolderPeer: TypeConstructorDescription { - case inputFolderPeer(peer: Api.InputPeer, folderId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputFolderPeer(let peer, let folderId): - if boxed { - buffer.appendInt32(-70073706) - } - peer.serialize(buffer, true) - serializeInt32(folderId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputFolderPeer(let peer, let folderId): - return ("inputFolderPeer", [("peer", peer as Any), ("folderId", folderId as Any)]) - } - } - + public class Cons_inputFolderPeer { + public var peer: Api.InputPeer + public var folderId: Int32 + public init(peer: Api.InputPeer, folderId: Int32) { + self.peer = peer + self.folderId = folderId + } + } + case inputFolderPeer(Cons_inputFolderPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputFolderPeer(let _data): + if boxed { + buffer.appendInt32(-70073706) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.folderId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputFolderPeer(let _data): + return ("inputFolderPeer", [("peer", _data.peer as Any), ("folderId", _data.folderId as Any)]) + } + } + public static func parse_inputFolderPeer(_ reader: BufferReader) -> InputFolderPeer? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -341,48 +457,63 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputFolderPeer.inputFolderPeer(peer: _1!, folderId: _2!) + return Api.InputFolderPeer.inputFolderPeer(Cons_inputFolderPeer(peer: _1!, folderId: _2!)) } else { return nil } } - } } public extension Api { indirect enum InputGame: TypeConstructorDescription { - case inputGameID(id: Int64, accessHash: Int64) - case inputGameShortName(botId: Api.InputUser, shortName: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputGameID(let id, let accessHash): - if boxed { - buffer.appendInt32(53231223) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputGameShortName(let botId, let shortName): - if boxed { - buffer.appendInt32(-1020139510) - } - botId.serialize(buffer, true) - serializeString(shortName, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputGameID(let id, let accessHash): - return ("inputGameID", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputGameShortName(let botId, let shortName): - return ("inputGameShortName", [("botId", botId as Any), ("shortName", shortName as Any)]) - } - } - + public class Cons_inputGameID { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputGameShortName { + public var botId: Api.InputUser + public var shortName: String + public init(botId: Api.InputUser, shortName: String) { + self.botId = botId + self.shortName = shortName + } + } + case inputGameID(Cons_inputGameID) + case inputGameShortName(Cons_inputGameShortName) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputGameID(let _data): + if boxed { + buffer.appendInt32(53231223) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputGameShortName(let _data): + if boxed { + buffer.appendInt32(-1020139510) + } + _data.botId.serialize(buffer, true) + serializeString(_data.shortName, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputGameID(let _data): + return ("inputGameID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputGameShortName(let _data): + return ("inputGameShortName", [("botId", _data.botId as Any), ("shortName", _data.shortName as Any)]) + } + } + public static func parse_inputGameID(_ reader: BufferReader) -> InputGame? { var _1: Int64? _1 = reader.readInt64() @@ -391,7 +522,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputGame.inputGameID(id: _1!, accessHash: _2!) + return Api.InputGame.inputGameID(Cons_inputGameID(id: _1!, accessHash: _2!)) } else { return nil @@ -407,49 +538,61 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputGame.inputGameShortName(botId: _1!, shortName: _2!) + return Api.InputGame.inputGameShortName(Cons_inputGameShortName(botId: _1!, shortName: _2!)) } else { return nil } } - } } public extension Api { enum InputGeoPoint: TypeConstructorDescription { - case inputGeoPoint(flags: Int32, lat: Double, long: Double, accuracyRadius: Int32?) + public class Cons_inputGeoPoint { + public var flags: Int32 + public var lat: Double + public var long: Double + public var accuracyRadius: Int32? + public init(flags: Int32, lat: Double, long: Double, accuracyRadius: Int32?) { + self.flags = flags + self.lat = lat + self.long = long + self.accuracyRadius = accuracyRadius + } + } + case inputGeoPoint(Cons_inputGeoPoint) case inputGeoPointEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputGeoPoint(let flags, let lat, let long, let accuracyRadius): - if boxed { - buffer.appendInt32(1210199983) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeDouble(lat, buffer: buffer, boxed: false) - serializeDouble(long, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(accuracyRadius!, buffer: buffer, boxed: false)} - break - case .inputGeoPointEmpty: - if boxed { - buffer.appendInt32(-457104426) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputGeoPoint(let flags, let lat, let long, let accuracyRadius): - return ("inputGeoPoint", [("flags", flags as Any), ("lat", lat as Any), ("long", long as Any), ("accuracyRadius", accuracyRadius as Any)]) - case .inputGeoPointEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputGeoPoint(let _data): + if boxed { + buffer.appendInt32(1210199983) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeDouble(_data.lat, buffer: buffer, boxed: false) + serializeDouble(_data.long, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.accuracyRadius!, buffer: buffer, boxed: false) + } + break + case .inputGeoPointEmpty: + if boxed { + buffer.appendInt32(-457104426) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputGeoPoint(let _data): + return ("inputGeoPoint", [("flags", _data.flags as Any), ("lat", _data.lat as Any), ("long", _data.long as Any), ("accuracyRadius", _data.accuracyRadius as Any)]) + case .inputGeoPointEmpty: return ("inputGeoPointEmpty", []) - } - } - + } + } + public static func parse_inputGeoPoint(_ reader: BufferReader) -> InputGeoPoint? { var _1: Int32? _1 = reader.readInt32() @@ -458,13 +601,15 @@ public extension Api { var _3: Double? _3 = reader.readDouble() var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputGeoPoint.inputGeoPoint(flags: _1!, lat: _2!, long: _3!, accuracyRadius: _4) + return Api.InputGeoPoint.inputGeoPoint(Cons_inputGeoPoint(flags: _1!, lat: _2!, long: _3!, accuracyRadius: _4)) } else { return nil @@ -473,50 +618,69 @@ public extension Api { public static func parse_inputGeoPointEmpty(_ reader: BufferReader) -> InputGeoPoint? { return Api.InputGeoPoint.inputGeoPointEmpty } - } } public extension Api { enum InputGroupCall: TypeConstructorDescription { - case inputGroupCall(id: Int64, accessHash: Int64) - case inputGroupCallInviteMessage(msgId: Int32) - case inputGroupCallSlug(slug: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputGroupCall(let id, let accessHash): - if boxed { - buffer.appendInt32(-659913713) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputGroupCallInviteMessage(let msgId): - if boxed { - buffer.appendInt32(-1945083841) - } - serializeInt32(msgId, buffer: buffer, boxed: false) - break - case .inputGroupCallSlug(let slug): - if boxed { - buffer.appendInt32(-33127873) - } - serializeString(slug, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputGroupCall(let id, let accessHash): - return ("inputGroupCall", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputGroupCallInviteMessage(let msgId): - return ("inputGroupCallInviteMessage", [("msgId", msgId as Any)]) - case .inputGroupCallSlug(let slug): - return ("inputGroupCallSlug", [("slug", slug as Any)]) - } - } - + public class Cons_inputGroupCall { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputGroupCallInviteMessage { + public var msgId: Int32 + public init(msgId: Int32) { + self.msgId = msgId + } + } + public class Cons_inputGroupCallSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + case inputGroupCall(Cons_inputGroupCall) + case inputGroupCallInviteMessage(Cons_inputGroupCallInviteMessage) + case inputGroupCallSlug(Cons_inputGroupCallSlug) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputGroupCall(let _data): + if boxed { + buffer.appendInt32(-659913713) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputGroupCallInviteMessage(let _data): + if boxed { + buffer.appendInt32(-1945083841) + } + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + case .inputGroupCallSlug(let _data): + if boxed { + buffer.appendInt32(-33127873) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputGroupCall(let _data): + return ("inputGroupCall", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputGroupCallInviteMessage(let _data): + return ("inputGroupCallInviteMessage", [("msgId", _data.msgId as Any)]) + case .inputGroupCallSlug(let _data): + return ("inputGroupCallSlug", [("slug", _data.slug as Any)]) + } + } + public static func parse_inputGroupCall(_ reader: BufferReader) -> InputGroupCall? { var _1: Int64? _1 = reader.readInt64() @@ -525,7 +689,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputGroupCall.inputGroupCall(id: _1!, accessHash: _2!) + return Api.InputGroupCall.inputGroupCall(Cons_inputGroupCall(id: _1!, accessHash: _2!)) } else { return nil @@ -536,7 +700,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputGroupCall.inputGroupCallInviteMessage(msgId: _1!) + return Api.InputGroupCall.inputGroupCallInviteMessage(Cons_inputGroupCallInviteMessage(msgId: _1!)) } else { return nil @@ -547,181 +711,314 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputGroupCall.inputGroupCallSlug(slug: _1!) + return Api.InputGroupCall.inputGroupCallSlug(Cons_inputGroupCallSlug(slug: _1!)) } else { return nil } } - } } public extension Api { indirect enum InputInvoice: TypeConstructorDescription { - case inputInvoiceBusinessBotTransferStars(bot: Api.InputUser, stars: Int64) - case inputInvoiceChatInviteSubscription(hash: String) - case inputInvoiceMessage(peer: Api.InputPeer, msgId: Int32) - case inputInvoicePremiumAuthCode(purpose: Api.InputStorePaymentPurpose) - case inputInvoicePremiumGiftCode(purpose: Api.InputStorePaymentPurpose, option: Api.PremiumGiftCodeOption) - case inputInvoicePremiumGiftStars(flags: Int32, userId: Api.InputUser, months: Int32, message: Api.TextWithEntities?) - case inputInvoiceSlug(slug: String) - case inputInvoiceStarGift(flags: Int32, peer: Api.InputPeer, giftId: Int64, message: Api.TextWithEntities?) - case inputInvoiceStarGiftAuctionBid(flags: Int32, peer: Api.InputPeer?, giftId: Int64, bidAmount: Int64, message: Api.TextWithEntities?) - case inputInvoiceStarGiftDropOriginalDetails(stargift: Api.InputSavedStarGift) - case inputInvoiceStarGiftPrepaidUpgrade(peer: Api.InputPeer, hash: String) - case inputInvoiceStarGiftResale(flags: Int32, slug: String, toId: Api.InputPeer) - case inputInvoiceStarGiftTransfer(stargift: Api.InputSavedStarGift, toId: Api.InputPeer) - case inputInvoiceStarGiftUpgrade(flags: Int32, stargift: Api.InputSavedStarGift) - case inputInvoiceStars(purpose: Api.InputStorePaymentPurpose) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputInvoiceBusinessBotTransferStars(let bot, let stars): - if boxed { - buffer.appendInt32(-191267262) - } - bot.serialize(buffer, true) - serializeInt64(stars, buffer: buffer, boxed: false) - break - case .inputInvoiceChatInviteSubscription(let hash): - if boxed { - buffer.appendInt32(887591921) - } - serializeString(hash, buffer: buffer, boxed: false) - break - case .inputInvoiceMessage(let peer, let msgId): - if boxed { - buffer.appendInt32(-977967015) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - break - case .inputInvoicePremiumAuthCode(let purpose): - if boxed { - buffer.appendInt32(1048049172) - } - purpose.serialize(buffer, true) - break - case .inputInvoicePremiumGiftCode(let purpose, let option): - if boxed { - buffer.appendInt32(-1734841331) - } - purpose.serialize(buffer, true) - option.serialize(buffer, true) - break - case .inputInvoicePremiumGiftStars(let flags, let userId, let months, let message): - if boxed { - buffer.appendInt32(-625298705) - } - serializeInt32(flags, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeInt32(months, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {message!.serialize(buffer, true)} - break - case .inputInvoiceSlug(let slug): - if boxed { - buffer.appendInt32(-1020867857) - } - serializeString(slug, buffer: buffer, boxed: false) - break - case .inputInvoiceStarGift(let flags, let peer, let giftId, let message): - if boxed { - buffer.appendInt32(-396206446) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt64(giftId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - break - case .inputInvoiceStarGiftAuctionBid(let flags, let peer, let giftId, let bidAmount, let message): - if boxed { - buffer.appendInt32(516618768) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {peer!.serialize(buffer, true)} - serializeInt64(giftId, buffer: buffer, boxed: false) - serializeInt64(bidAmount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - break - case .inputInvoiceStarGiftDropOriginalDetails(let stargift): - if boxed { - buffer.appendInt32(153344209) - } - stargift.serialize(buffer, true) - break - case .inputInvoiceStarGiftPrepaidUpgrade(let peer, let hash): - if boxed { - buffer.appendInt32(-1710536520) - } - peer.serialize(buffer, true) - serializeString(hash, buffer: buffer, boxed: false) - break - case .inputInvoiceStarGiftResale(let flags, let slug, let toId): - if boxed { - buffer.appendInt32(-1012968668) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - toId.serialize(buffer, true) - break - case .inputInvoiceStarGiftTransfer(let stargift, let toId): - if boxed { - buffer.appendInt32(1247763417) - } - stargift.serialize(buffer, true) - toId.serialize(buffer, true) - break - case .inputInvoiceStarGiftUpgrade(let flags, let stargift): - if boxed { - buffer.appendInt32(1300335965) - } - serializeInt32(flags, buffer: buffer, boxed: false) - stargift.serialize(buffer, true) - break - case .inputInvoiceStars(let purpose): - if boxed { - buffer.appendInt32(1710230755) - } - purpose.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputInvoiceBusinessBotTransferStars(let bot, let stars): - return ("inputInvoiceBusinessBotTransferStars", [("bot", bot as Any), ("stars", stars as Any)]) - case .inputInvoiceChatInviteSubscription(let hash): - return ("inputInvoiceChatInviteSubscription", [("hash", hash as Any)]) - case .inputInvoiceMessage(let peer, let msgId): - return ("inputInvoiceMessage", [("peer", peer as Any), ("msgId", msgId as Any)]) - case .inputInvoicePremiumAuthCode(let purpose): - return ("inputInvoicePremiumAuthCode", [("purpose", purpose as Any)]) - case .inputInvoicePremiumGiftCode(let purpose, let option): - return ("inputInvoicePremiumGiftCode", [("purpose", purpose as Any), ("option", option as Any)]) - case .inputInvoicePremiumGiftStars(let flags, let userId, let months, let message): - return ("inputInvoicePremiumGiftStars", [("flags", flags as Any), ("userId", userId as Any), ("months", months as Any), ("message", message as Any)]) - case .inputInvoiceSlug(let slug): - return ("inputInvoiceSlug", [("slug", slug as Any)]) - case .inputInvoiceStarGift(let flags, let peer, let giftId, let message): - return ("inputInvoiceStarGift", [("flags", flags as Any), ("peer", peer as Any), ("giftId", giftId as Any), ("message", message as Any)]) - case .inputInvoiceStarGiftAuctionBid(let flags, let peer, let giftId, let bidAmount, let message): - return ("inputInvoiceStarGiftAuctionBid", [("flags", flags as Any), ("peer", peer as Any), ("giftId", giftId as Any), ("bidAmount", bidAmount as Any), ("message", message as Any)]) - case .inputInvoiceStarGiftDropOriginalDetails(let stargift): - return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", stargift as Any)]) - case .inputInvoiceStarGiftPrepaidUpgrade(let peer, let hash): - return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", peer as Any), ("hash", hash as Any)]) - case .inputInvoiceStarGiftResale(let flags, let slug, let toId): - return ("inputInvoiceStarGiftResale", [("flags", flags as Any), ("slug", slug as Any), ("toId", toId as Any)]) - case .inputInvoiceStarGiftTransfer(let stargift, let toId): - return ("inputInvoiceStarGiftTransfer", [("stargift", stargift as Any), ("toId", toId as Any)]) - case .inputInvoiceStarGiftUpgrade(let flags, let stargift): - return ("inputInvoiceStarGiftUpgrade", [("flags", flags as Any), ("stargift", stargift as Any)]) - case .inputInvoiceStars(let purpose): - return ("inputInvoiceStars", [("purpose", purpose as Any)]) - } - } - + public class Cons_inputInvoiceBusinessBotTransferStars { + public var bot: Api.InputUser + public var stars: Int64 + public init(bot: Api.InputUser, stars: Int64) { + self.bot = bot + self.stars = stars + } + } + public class Cons_inputInvoiceChatInviteSubscription { + public var hash: String + public init(hash: String) { + self.hash = hash + } + } + public class Cons_inputInvoiceMessage { + public var peer: Api.InputPeer + public var msgId: Int32 + public init(peer: Api.InputPeer, msgId: Int32) { + self.peer = peer + self.msgId = msgId + } + } + public class Cons_inputInvoicePremiumAuthCode { + public var purpose: Api.InputStorePaymentPurpose + public init(purpose: Api.InputStorePaymentPurpose) { + self.purpose = purpose + } + } + public class Cons_inputInvoicePremiumGiftCode { + public var purpose: Api.InputStorePaymentPurpose + public var option: Api.PremiumGiftCodeOption + public init(purpose: Api.InputStorePaymentPurpose, option: Api.PremiumGiftCodeOption) { + self.purpose = purpose + self.option = option + } + } + public class Cons_inputInvoicePremiumGiftStars { + public var flags: Int32 + public var userId: Api.InputUser + public var months: Int32 + public var message: Api.TextWithEntities? + public init(flags: Int32, userId: Api.InputUser, months: Int32, message: Api.TextWithEntities?) { + self.flags = flags + self.userId = userId + self.months = months + self.message = message + } + } + public class Cons_inputInvoiceSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + public class Cons_inputInvoiceStarGift { + public var flags: Int32 + public var peer: Api.InputPeer + public var giftId: Int64 + public var message: Api.TextWithEntities? + public init(flags: Int32, peer: Api.InputPeer, giftId: Int64, message: Api.TextWithEntities?) { + self.flags = flags + self.peer = peer + self.giftId = giftId + self.message = message + } + } + public class Cons_inputInvoiceStarGiftAuctionBid { + public var flags: Int32 + public var peer: Api.InputPeer? + public var giftId: Int64 + public var bidAmount: Int64 + public var message: Api.TextWithEntities? + public init(flags: Int32, peer: Api.InputPeer?, giftId: Int64, bidAmount: Int64, message: Api.TextWithEntities?) { + self.flags = flags + self.peer = peer + self.giftId = giftId + self.bidAmount = bidAmount + self.message = message + } + } + public class Cons_inputInvoiceStarGiftDropOriginalDetails { + public var stargift: Api.InputSavedStarGift + public init(stargift: Api.InputSavedStarGift) { + self.stargift = stargift + } + } + public class Cons_inputInvoiceStarGiftPrepaidUpgrade { + public var peer: Api.InputPeer + public var hash: String + public init(peer: Api.InputPeer, hash: String) { + self.peer = peer + self.hash = hash + } + } + public class Cons_inputInvoiceStarGiftResale { + public var flags: Int32 + public var slug: String + public var toId: Api.InputPeer + public init(flags: Int32, slug: String, toId: Api.InputPeer) { + self.flags = flags + self.slug = slug + self.toId = toId + } + } + public class Cons_inputInvoiceStarGiftTransfer { + public var stargift: Api.InputSavedStarGift + public var toId: Api.InputPeer + public init(stargift: Api.InputSavedStarGift, toId: Api.InputPeer) { + self.stargift = stargift + self.toId = toId + } + } + public class Cons_inputInvoiceStarGiftUpgrade { + public var flags: Int32 + public var stargift: Api.InputSavedStarGift + public init(flags: Int32, stargift: Api.InputSavedStarGift) { + self.flags = flags + self.stargift = stargift + } + } + public class Cons_inputInvoiceStars { + public var purpose: Api.InputStorePaymentPurpose + public init(purpose: Api.InputStorePaymentPurpose) { + self.purpose = purpose + } + } + case inputInvoiceBusinessBotTransferStars(Cons_inputInvoiceBusinessBotTransferStars) + case inputInvoiceChatInviteSubscription(Cons_inputInvoiceChatInviteSubscription) + case inputInvoiceMessage(Cons_inputInvoiceMessage) + case inputInvoicePremiumAuthCode(Cons_inputInvoicePremiumAuthCode) + case inputInvoicePremiumGiftCode(Cons_inputInvoicePremiumGiftCode) + case inputInvoicePremiumGiftStars(Cons_inputInvoicePremiumGiftStars) + case inputInvoiceSlug(Cons_inputInvoiceSlug) + case inputInvoiceStarGift(Cons_inputInvoiceStarGift) + case inputInvoiceStarGiftAuctionBid(Cons_inputInvoiceStarGiftAuctionBid) + case inputInvoiceStarGiftDropOriginalDetails(Cons_inputInvoiceStarGiftDropOriginalDetails) + case inputInvoiceStarGiftPrepaidUpgrade(Cons_inputInvoiceStarGiftPrepaidUpgrade) + case inputInvoiceStarGiftResale(Cons_inputInvoiceStarGiftResale) + case inputInvoiceStarGiftTransfer(Cons_inputInvoiceStarGiftTransfer) + case inputInvoiceStarGiftUpgrade(Cons_inputInvoiceStarGiftUpgrade) + case inputInvoiceStars(Cons_inputInvoiceStars) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputInvoiceBusinessBotTransferStars(let _data): + if boxed { + buffer.appendInt32(-191267262) + } + _data.bot.serialize(buffer, true) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + break + case .inputInvoiceChatInviteSubscription(let _data): + if boxed { + buffer.appendInt32(887591921) + } + serializeString(_data.hash, buffer: buffer, boxed: false) + break + case .inputInvoiceMessage(let _data): + if boxed { + buffer.appendInt32(-977967015) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + case .inputInvoicePremiumAuthCode(let _data): + if boxed { + buffer.appendInt32(1048049172) + } + _data.purpose.serialize(buffer, true) + break + case .inputInvoicePremiumGiftCode(let _data): + if boxed { + buffer.appendInt32(-1734841331) + } + _data.purpose.serialize(buffer, true) + _data.option.serialize(buffer, true) + break + case .inputInvoicePremiumGiftStars(let _data): + if boxed { + buffer.appendInt32(-625298705) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.userId.serialize(buffer, true) + serializeInt32(_data.months, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .inputInvoiceSlug(let _data): + if boxed { + buffer.appendInt32(-1020867857) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + case .inputInvoiceStarGift(let _data): + if boxed { + buffer.appendInt32(-396206446) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .inputInvoiceStarGiftAuctionBid(let _data): + if boxed { + buffer.appendInt32(516618768) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.peer!.serialize(buffer, true) + } + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + serializeInt64(_data.bidAmount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .inputInvoiceStarGiftDropOriginalDetails(let _data): + if boxed { + buffer.appendInt32(153344209) + } + _data.stargift.serialize(buffer, true) + break + case .inputInvoiceStarGiftPrepaidUpgrade(let _data): + if boxed { + buffer.appendInt32(-1710536520) + } + _data.peer.serialize(buffer, true) + serializeString(_data.hash, buffer: buffer, boxed: false) + break + case .inputInvoiceStarGiftResale(let _data): + if boxed { + buffer.appendInt32(-1012968668) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + _data.toId.serialize(buffer, true) + break + case .inputInvoiceStarGiftTransfer(let _data): + if boxed { + buffer.appendInt32(1247763417) + } + _data.stargift.serialize(buffer, true) + _data.toId.serialize(buffer, true) + break + case .inputInvoiceStarGiftUpgrade(let _data): + if boxed { + buffer.appendInt32(1300335965) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.stargift.serialize(buffer, true) + break + case .inputInvoiceStars(let _data): + if boxed { + buffer.appendInt32(1710230755) + } + _data.purpose.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputInvoiceBusinessBotTransferStars(let _data): + return ("inputInvoiceBusinessBotTransferStars", [("bot", _data.bot as Any), ("stars", _data.stars as Any)]) + case .inputInvoiceChatInviteSubscription(let _data): + return ("inputInvoiceChatInviteSubscription", [("hash", _data.hash as Any)]) + case .inputInvoiceMessage(let _data): + return ("inputInvoiceMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any)]) + case .inputInvoicePremiumAuthCode(let _data): + return ("inputInvoicePremiumAuthCode", [("purpose", _data.purpose as Any)]) + case .inputInvoicePremiumGiftCode(let _data): + return ("inputInvoicePremiumGiftCode", [("purpose", _data.purpose as Any), ("option", _data.option as Any)]) + case .inputInvoicePremiumGiftStars(let _data): + return ("inputInvoicePremiumGiftStars", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("months", _data.months as Any), ("message", _data.message as Any)]) + case .inputInvoiceSlug(let _data): + return ("inputInvoiceSlug", [("slug", _data.slug as Any)]) + case .inputInvoiceStarGift(let _data): + return ("inputInvoiceStarGift", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("giftId", _data.giftId as Any), ("message", _data.message as Any)]) + case .inputInvoiceStarGiftAuctionBid(let _data): + return ("inputInvoiceStarGiftAuctionBid", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("giftId", _data.giftId as Any), ("bidAmount", _data.bidAmount as Any), ("message", _data.message as Any)]) + case .inputInvoiceStarGiftDropOriginalDetails(let _data): + return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", _data.stargift as Any)]) + case .inputInvoiceStarGiftPrepaidUpgrade(let _data): + return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", _data.peer as Any), ("hash", _data.hash as Any)]) + case .inputInvoiceStarGiftResale(let _data): + return ("inputInvoiceStarGiftResale", [("flags", _data.flags as Any), ("slug", _data.slug as Any), ("toId", _data.toId as Any)]) + case .inputInvoiceStarGiftTransfer(let _data): + return ("inputInvoiceStarGiftTransfer", [("stargift", _data.stargift as Any), ("toId", _data.toId as Any)]) + case .inputInvoiceStarGiftUpgrade(let _data): + return ("inputInvoiceStarGiftUpgrade", [("flags", _data.flags as Any), ("stargift", _data.stargift as Any)]) + case .inputInvoiceStars(let _data): + return ("inputInvoiceStars", [("purpose", _data.purpose as Any)]) + } + } + public static func parse_inputInvoiceBusinessBotTransferStars(_ reader: BufferReader) -> InputInvoice? { var _1: Api.InputUser? if let signature = reader.readInt32() { @@ -732,7 +1029,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoiceBusinessBotTransferStars(bot: _1!, stars: _2!) + return Api.InputInvoice.inputInvoiceBusinessBotTransferStars(Cons_inputInvoiceBusinessBotTransferStars(bot: _1!, stars: _2!)) } else { return nil @@ -743,7 +1040,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputInvoice.inputInvoiceChatInviteSubscription(hash: _1!) + return Api.InputInvoice.inputInvoiceChatInviteSubscription(Cons_inputInvoiceChatInviteSubscription(hash: _1!)) } else { return nil @@ -759,7 +1056,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoiceMessage(peer: _1!, msgId: _2!) + return Api.InputInvoice.inputInvoiceMessage(Cons_inputInvoiceMessage(peer: _1!, msgId: _2!)) } else { return nil @@ -772,7 +1069,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputInvoice.inputInvoicePremiumAuthCode(purpose: _1!) + return Api.InputInvoice.inputInvoicePremiumAuthCode(Cons_inputInvoicePremiumAuthCode(purpose: _1!)) } else { return nil @@ -790,7 +1087,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoicePremiumGiftCode(purpose: _1!, option: _2!) + return Api.InputInvoice.inputInvoicePremiumGiftCode(Cons_inputInvoicePremiumGiftCode(purpose: _1!, option: _2!)) } else { return nil @@ -806,15 +1103,17 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.TextWithEntities? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputInvoice.inputInvoicePremiumGiftStars(flags: _1!, userId: _2!, months: _3!, message: _4) + return Api.InputInvoice.inputInvoicePremiumGiftStars(Cons_inputInvoicePremiumGiftStars(flags: _1!, userId: _2!, months: _3!, message: _4)) } else { return nil @@ -825,7 +1124,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputInvoice.inputInvoiceSlug(slug: _1!) + return Api.InputInvoice.inputInvoiceSlug(Cons_inputInvoiceSlug(slug: _1!)) } else { return nil @@ -841,15 +1140,17 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputInvoice.inputInvoiceStarGift(flags: _1!, peer: _2!, giftId: _3!, message: _4) + return Api.InputInvoice.inputInvoiceStarGift(Cons_inputInvoiceStarGift(flags: _1!, peer: _2!, giftId: _3!, message: _4)) } else { return nil @@ -859,24 +1160,28 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputPeer? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputPeer - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + } var _3: Int64? _3 = reader.readInt64() var _4: Int64? _4 = reader.readInt64() var _5: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputInvoice.inputInvoiceStarGiftAuctionBid(flags: _1!, peer: _2, giftId: _3!, bidAmount: _4!, message: _5) + return Api.InputInvoice.inputInvoiceStarGiftAuctionBid(Cons_inputInvoiceStarGiftAuctionBid(flags: _1!, peer: _2, giftId: _3!, bidAmount: _4!, message: _5)) } else { return nil @@ -889,7 +1194,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputInvoice.inputInvoiceStarGiftDropOriginalDetails(stargift: _1!) + return Api.InputInvoice.inputInvoiceStarGiftDropOriginalDetails(Cons_inputInvoiceStarGiftDropOriginalDetails(stargift: _1!)) } else { return nil @@ -905,7 +1210,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoiceStarGiftPrepaidUpgrade(peer: _1!, hash: _2!) + return Api.InputInvoice.inputInvoiceStarGiftPrepaidUpgrade(Cons_inputInvoiceStarGiftPrepaidUpgrade(peer: _1!, hash: _2!)) } else { return nil @@ -924,7 +1229,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputInvoice.inputInvoiceStarGiftResale(flags: _1!, slug: _2!, toId: _3!) + return Api.InputInvoice.inputInvoiceStarGiftResale(Cons_inputInvoiceStarGiftResale(flags: _1!, slug: _2!, toId: _3!)) } else { return nil @@ -942,7 +1247,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoiceStarGiftTransfer(stargift: _1!, toId: _2!) + return Api.InputInvoice.inputInvoiceStarGiftTransfer(Cons_inputInvoiceStarGiftTransfer(stargift: _1!, toId: _2!)) } else { return nil @@ -958,7 +1263,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputInvoice.inputInvoiceStarGiftUpgrade(flags: _1!, stargift: _2!) + return Api.InputInvoice.inputInvoiceStarGiftUpgrade(Cons_inputInvoiceStarGiftUpgrade(flags: _1!, stargift: _2!)) } else { return nil @@ -971,12 +1276,11 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputInvoice.inputInvoiceStars(purpose: _1!) + return Api.InputInvoice.inputInvoiceStars(Cons_inputInvoiceStars(purpose: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api11.swift b/submodules/TelegramApi/Sources/Api11.swift index 671d246b45..a1ff5f52e2 100644 --- a/submodules/TelegramApi/Sources/Api11.swift +++ b/submodules/TelegramApi/Sources/Api11.swift @@ -1,276 +1,555 @@ public extension Api { indirect enum InputMedia: TypeConstructorDescription { - case inputMediaContact(phoneNumber: String, firstName: String, lastName: String, vcard: String) - case inputMediaDice(emoticon: String) - case inputMediaDocument(flags: Int32, id: Api.InputDocument, videoCover: Api.InputPhoto?, videoTimestamp: Int32?, ttlSeconds: Int32?, query: String?) - case inputMediaDocumentExternal(flags: Int32, url: String, ttlSeconds: Int32?, videoCover: Api.InputPhoto?, videoTimestamp: Int32?) + public class Cons_inputMediaContact { + public var phoneNumber: String + public var firstName: String + public var lastName: String + public var vcard: String + public init(phoneNumber: String, firstName: String, lastName: String, vcard: String) { + self.phoneNumber = phoneNumber + self.firstName = firstName + self.lastName = lastName + self.vcard = vcard + } + } + public class Cons_inputMediaDice { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + public class Cons_inputMediaDocument { + public var flags: Int32 + public var id: Api.InputDocument + public var videoCover: Api.InputPhoto? + public var videoTimestamp: Int32? + public var ttlSeconds: Int32? + public var query: String? + public init(flags: Int32, id: Api.InputDocument, videoCover: Api.InputPhoto?, videoTimestamp: Int32?, ttlSeconds: Int32?, query: String?) { + self.flags = flags + self.id = id + self.videoCover = videoCover + self.videoTimestamp = videoTimestamp + self.ttlSeconds = ttlSeconds + self.query = query + } + } + public class Cons_inputMediaDocumentExternal { + public var flags: Int32 + public var url: String + public var ttlSeconds: Int32? + public var videoCover: Api.InputPhoto? + public var videoTimestamp: Int32? + public init(flags: Int32, url: String, ttlSeconds: Int32?, videoCover: Api.InputPhoto?, videoTimestamp: Int32?) { + self.flags = flags + self.url = url + self.ttlSeconds = ttlSeconds + self.videoCover = videoCover + self.videoTimestamp = videoTimestamp + } + } + public class Cons_inputMediaGame { + public var id: Api.InputGame + public init(id: Api.InputGame) { + self.id = id + } + } + public class Cons_inputMediaGeoLive { + public var flags: Int32 + public var geoPoint: Api.InputGeoPoint + public var heading: Int32? + public var period: Int32? + public var proximityNotificationRadius: Int32? + public init(flags: Int32, geoPoint: Api.InputGeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?) { + self.flags = flags + self.geoPoint = geoPoint + self.heading = heading + self.period = period + self.proximityNotificationRadius = proximityNotificationRadius + } + } + public class Cons_inputMediaGeoPoint { + public var geoPoint: Api.InputGeoPoint + public init(geoPoint: Api.InputGeoPoint) { + self.geoPoint = geoPoint + } + } + public class Cons_inputMediaInvoice { + public var flags: Int32 + public var title: String + public var description: String + public var photo: Api.InputWebDocument? + public var invoice: Api.Invoice + public var payload: Buffer + public var provider: String? + public var providerData: Api.DataJSON + public var startParam: String? + public var extendedMedia: Api.InputMedia? + public init(flags: Int32, title: String, description: String, photo: Api.InputWebDocument?, invoice: Api.Invoice, payload: Buffer, provider: String?, providerData: Api.DataJSON, startParam: String?, extendedMedia: Api.InputMedia?) { + self.flags = flags + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.payload = payload + self.provider = provider + self.providerData = providerData + self.startParam = startParam + self.extendedMedia = extendedMedia + } + } + public class Cons_inputMediaPaidMedia { + public var flags: Int32 + public var starsAmount: Int64 + public var extendedMedia: [Api.InputMedia] + public var payload: String? + public init(flags: Int32, starsAmount: Int64, extendedMedia: [Api.InputMedia], payload: String?) { + self.flags = flags + self.starsAmount = starsAmount + self.extendedMedia = extendedMedia + self.payload = payload + } + } + public class Cons_inputMediaPhoto { + public var flags: Int32 + public var id: Api.InputPhoto + public var ttlSeconds: Int32? + public init(flags: Int32, id: Api.InputPhoto, ttlSeconds: Int32?) { + self.flags = flags + self.id = id + self.ttlSeconds = ttlSeconds + } + } + public class Cons_inputMediaPhotoExternal { + public var flags: Int32 + public var url: String + public var ttlSeconds: Int32? + public init(flags: Int32, url: String, ttlSeconds: Int32?) { + self.flags = flags + self.url = url + self.ttlSeconds = ttlSeconds + } + } + public class Cons_inputMediaPoll { + public var flags: Int32 + public var poll: Api.Poll + public var correctAnswers: [Buffer]? + public var solution: String? + public var solutionEntities: [Api.MessageEntity]? + public init(flags: Int32, poll: Api.Poll, correctAnswers: [Buffer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) { + self.flags = flags + self.poll = poll + self.correctAnswers = correctAnswers + self.solution = solution + self.solutionEntities = solutionEntities + } + } + public class Cons_inputMediaStakeDice { + public var gameHash: String + public var tonAmount: Int64 + public var clientSeed: Buffer + public init(gameHash: String, tonAmount: Int64, clientSeed: Buffer) { + self.gameHash = gameHash + self.tonAmount = tonAmount + self.clientSeed = clientSeed + } + } + public class Cons_inputMediaStory { + public var peer: Api.InputPeer + public var id: Int32 + public init(peer: Api.InputPeer, id: Int32) { + self.peer = peer + self.id = id + } + } + public class Cons_inputMediaTodo { + public var todo: Api.TodoList + public init(todo: Api.TodoList) { + self.todo = todo + } + } + public class Cons_inputMediaUploadedDocument { + public var flags: Int32 + public var file: Api.InputFile + public var thumb: Api.InputFile? + public var mimeType: String + public var attributes: [Api.DocumentAttribute] + public var stickers: [Api.InputDocument]? + public var videoCover: Api.InputPhoto? + public var videoTimestamp: Int32? + public var ttlSeconds: Int32? + public init(flags: Int32, file: Api.InputFile, thumb: Api.InputFile?, mimeType: String, attributes: [Api.DocumentAttribute], stickers: [Api.InputDocument]?, videoCover: Api.InputPhoto?, videoTimestamp: Int32?, ttlSeconds: Int32?) { + self.flags = flags + self.file = file + self.thumb = thumb + self.mimeType = mimeType + self.attributes = attributes + self.stickers = stickers + self.videoCover = videoCover + self.videoTimestamp = videoTimestamp + self.ttlSeconds = ttlSeconds + } + } + public class Cons_inputMediaUploadedPhoto { + public var flags: Int32 + public var file: Api.InputFile + public var stickers: [Api.InputDocument]? + public var ttlSeconds: Int32? + public init(flags: Int32, file: Api.InputFile, stickers: [Api.InputDocument]?, ttlSeconds: Int32?) { + self.flags = flags + self.file = file + self.stickers = stickers + self.ttlSeconds = ttlSeconds + } + } + public class Cons_inputMediaVenue { + public var geoPoint: Api.InputGeoPoint + public var title: String + public var address: String + public var provider: String + public var venueId: String + public var venueType: String + public init(geoPoint: Api.InputGeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) { + self.geoPoint = geoPoint + self.title = title + self.address = address + self.provider = provider + self.venueId = venueId + self.venueType = venueType + } + } + public class Cons_inputMediaWebPage { + public var flags: Int32 + public var url: String + public init(flags: Int32, url: String) { + self.flags = flags + self.url = url + } + } + case inputMediaContact(Cons_inputMediaContact) + case inputMediaDice(Cons_inputMediaDice) + case inputMediaDocument(Cons_inputMediaDocument) + case inputMediaDocumentExternal(Cons_inputMediaDocumentExternal) case inputMediaEmpty - case inputMediaGame(id: Api.InputGame) - case inputMediaGeoLive(flags: Int32, geoPoint: Api.InputGeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?) - case inputMediaGeoPoint(geoPoint: Api.InputGeoPoint) - case inputMediaInvoice(flags: Int32, title: String, description: String, photo: Api.InputWebDocument?, invoice: Api.Invoice, payload: Buffer, provider: String?, providerData: Api.DataJSON, startParam: String?, extendedMedia: Api.InputMedia?) - case inputMediaPaidMedia(flags: Int32, starsAmount: Int64, extendedMedia: [Api.InputMedia], payload: String?) - case inputMediaPhoto(flags: Int32, id: Api.InputPhoto, ttlSeconds: Int32?) - case inputMediaPhotoExternal(flags: Int32, url: String, ttlSeconds: Int32?) - case inputMediaPoll(flags: Int32, poll: Api.Poll, correctAnswers: [Buffer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) - case inputMediaStakeDice(gameHash: String, tonAmount: Int64, clientSeed: Buffer) - case inputMediaStory(peer: Api.InputPeer, id: Int32) - case inputMediaTodo(todo: Api.TodoList) - case inputMediaUploadedDocument(flags: Int32, file: Api.InputFile, thumb: Api.InputFile?, mimeType: String, attributes: [Api.DocumentAttribute], stickers: [Api.InputDocument]?, videoCover: Api.InputPhoto?, videoTimestamp: Int32?, ttlSeconds: Int32?) - case inputMediaUploadedPhoto(flags: Int32, file: Api.InputFile, stickers: [Api.InputDocument]?, ttlSeconds: Int32?) - case inputMediaVenue(geoPoint: Api.InputGeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) - case inputMediaWebPage(flags: Int32, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputMediaContact(let phoneNumber, let firstName, let lastName, let vcard): - if boxed { - buffer.appendInt32(-122978821) - } - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeString(vcard, buffer: buffer, boxed: false) - break - case .inputMediaDice(let emoticon): - if boxed { - buffer.appendInt32(-428884101) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .inputMediaDocument(let flags, let id, let videoCover, let videoTimestamp, let ttlSeconds, let query): - if boxed { - buffer.appendInt32(-1468646731) - } - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - if Int(flags) & Int(1 << 3) != 0 {videoCover!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(videoTimestamp!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(query!, buffer: buffer, boxed: false)} - break - case .inputMediaDocumentExternal(let flags, let url, let ttlSeconds, let videoCover, let videoTimestamp): - if boxed { - buffer.appendInt32(2006319353) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {videoCover!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(videoTimestamp!, buffer: buffer, boxed: false)} - break - case .inputMediaEmpty: - if boxed { - buffer.appendInt32(-1771768449) - } - - break - case .inputMediaGame(let id): - if boxed { - buffer.appendInt32(-750828557) - } - id.serialize(buffer, true) - break - case .inputMediaGeoLive(let flags, let geoPoint, let heading, let period, let proximityNotificationRadius): - if boxed { - buffer.appendInt32(-1759532989) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geoPoint.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(heading!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(proximityNotificationRadius!, buffer: buffer, boxed: false)} - break - case .inputMediaGeoPoint(let geoPoint): - if boxed { - buffer.appendInt32(-104578748) - } - geoPoint.serialize(buffer, true) - break - case .inputMediaInvoice(let flags, let title, let description, let photo, let invoice, let payload, let provider, let providerData, let startParam, let extendedMedia): - if boxed { - buffer.appendInt32(1080028941) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) - serializeBytes(payload, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(provider!, buffer: buffer, boxed: false)} - providerData.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(startParam!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {extendedMedia!.serialize(buffer, true)} - break - case .inputMediaPaidMedia(let flags, let starsAmount, let extendedMedia, let payload): - if boxed { - buffer.appendInt32(-1005571194) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(starsAmount, buffer: buffer, boxed: false) + case inputMediaGame(Cons_inputMediaGame) + case inputMediaGeoLive(Cons_inputMediaGeoLive) + case inputMediaGeoPoint(Cons_inputMediaGeoPoint) + case inputMediaInvoice(Cons_inputMediaInvoice) + case inputMediaPaidMedia(Cons_inputMediaPaidMedia) + case inputMediaPhoto(Cons_inputMediaPhoto) + case inputMediaPhotoExternal(Cons_inputMediaPhotoExternal) + case inputMediaPoll(Cons_inputMediaPoll) + case inputMediaStakeDice(Cons_inputMediaStakeDice) + case inputMediaStory(Cons_inputMediaStory) + case inputMediaTodo(Cons_inputMediaTodo) + case inputMediaUploadedDocument(Cons_inputMediaUploadedDocument) + case inputMediaUploadedPhoto(Cons_inputMediaUploadedPhoto) + case inputMediaVenue(Cons_inputMediaVenue) + case inputMediaWebPage(Cons_inputMediaWebPage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMediaContact(let _data): + if boxed { + buffer.appendInt32(-122978821) + } + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + serializeString(_data.vcard, buffer: buffer, boxed: false) + break + case .inputMediaDice(let _data): + if boxed { + buffer.appendInt32(-428884101) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .inputMediaDocument(let _data): + if boxed { + buffer.appendInt32(-1468646731) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.id.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.videoCover!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.videoTimestamp!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.query!, buffer: buffer, boxed: false) + } + break + case .inputMediaDocumentExternal(let _data): + if boxed { + buffer.appendInt32(2006319353) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.videoCover!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.videoTimestamp!, buffer: buffer, boxed: false) + } + break + case .inputMediaEmpty: + if boxed { + buffer.appendInt32(-1771768449) + } + break + case .inputMediaGame(let _data): + if boxed { + buffer.appendInt32(-750828557) + } + _data.id.serialize(buffer, true) + break + case .inputMediaGeoLive(let _data): + if boxed { + buffer.appendInt32(-1759532989) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geoPoint.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.heading!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.period!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.proximityNotificationRadius!, buffer: buffer, boxed: false) + } + break + case .inputMediaGeoPoint(let _data): + if boxed { + buffer.appendInt32(-104578748) + } + _data.geoPoint.serialize(buffer, true) + break + case .inputMediaInvoice(let _data): + if boxed { + buffer.appendInt32(1080028941) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + serializeBytes(_data.payload, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.provider!, buffer: buffer, boxed: false) + } + _data.providerData.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.startParam!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.extendedMedia!.serialize(buffer, true) + } + break + case .inputMediaPaidMedia(let _data): + if boxed { + buffer.appendInt32(-1005571194) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.extendedMedia.count)) + for item in _data.extendedMedia { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.payload!, buffer: buffer, boxed: false) + } + break + case .inputMediaPhoto(let _data): + if boxed { + buffer.appendInt32(-1279654347) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.id.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .inputMediaPhotoExternal(let _data): + if boxed { + buffer.appendInt32(-440664550) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .inputMediaPoll(let _data): + if boxed { + buffer.appendInt32(261416433) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.poll.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(extendedMedia.count)) - for item in extendedMedia { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(payload!, buffer: buffer, boxed: false)} - break - case .inputMediaPhoto(let flags, let id, let ttlSeconds): - if boxed { - buffer.appendInt32(-1279654347) - } - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .inputMediaPhotoExternal(let flags, let url, let ttlSeconds): - if boxed { - buffer.appendInt32(-440664550) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .inputMediaPoll(let flags, let poll, let correctAnswers, let solution, let solutionEntities): - if boxed { - buffer.appendInt32(261416433) - } - serializeInt32(flags, buffer: buffer, boxed: false) - poll.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(correctAnswers!.count)) - for item in correctAnswers! { + buffer.appendInt32(Int32(_data.correctAnswers!.count)) + for item in _data.correctAnswers! { serializeBytes(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeString(solution!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(solutionEntities!.count)) - for item in solutionEntities! { - item.serialize(buffer, true) - }} - break - case .inputMediaStakeDice(let gameHash, let tonAmount, let clientSeed): - if boxed { - buffer.appendInt32(-207018934) } - serializeString(gameHash, buffer: buffer, boxed: false) - serializeInt64(tonAmount, buffer: buffer, boxed: false) - serializeBytes(clientSeed, buffer: buffer, boxed: false) - break - case .inputMediaStory(let peer, let id): - if boxed { - buffer.appendInt32(-1979852936) - } - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - break - case .inputMediaTodo(let todo): - if boxed { - buffer.appendInt32(-1614454818) - } - todo.serialize(buffer, true) - break - case .inputMediaUploadedDocument(let flags, let file, let thumb, let mimeType, let attributes, let stickers, let videoCover, let videoTimestamp, let ttlSeconds): - if boxed { - buffer.appendInt32(58495792) - } - serializeInt32(flags, buffer: buffer, boxed: false) - file.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {thumb!.serialize(buffer, true)} - serializeString(mimeType, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.solution!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { + buffer.appendInt32(Int32(_data.solutionEntities!.count)) + for item in _data.solutionEntities! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers!.count)) - for item in stickers! { + } + break + case .inputMediaStakeDice(let _data): + if boxed { + buffer.appendInt32(-207018934) + } + serializeString(_data.gameHash, buffer: buffer, boxed: false) + serializeInt64(_data.tonAmount, buffer: buffer, boxed: false) + serializeBytes(_data.clientSeed, buffer: buffer, boxed: false) + break + case .inputMediaStory(let _data): + if boxed { + buffer.appendInt32(-1979852936) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + case .inputMediaTodo(let _data): + if boxed { + buffer.appendInt32(-1614454818) + } + _data.todo.serialize(buffer, true) + break + case .inputMediaUploadedDocument(let _data): + if boxed { + buffer.appendInt32(58495792) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.file.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.thumb!.serialize(buffer, true) + } + serializeString(_data.mimeType, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers!.count)) + for item in _data.stickers! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 6) != 0 {videoCover!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(videoTimestamp!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .inputMediaUploadedPhoto(let flags, let file, let stickers, let ttlSeconds): - if boxed { - buffer.appendInt32(505969924) } - serializeInt32(flags, buffer: buffer, boxed: false) - file.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers!.count)) - for item in stickers! { + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.videoCover!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.videoTimestamp!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .inputMediaUploadedPhoto(let _data): + if boxed { + buffer.appendInt32(505969924) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.file.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers!.count)) + for item in _data.stickers! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .inputMediaVenue(let geoPoint, let title, let address, let provider, let venueId, let venueType): - if boxed { - buffer.appendInt32(-1052959727) } - geoPoint.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(address, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - serializeString(venueId, buffer: buffer, boxed: false) - serializeString(venueType, buffer: buffer, boxed: false) - break - case .inputMediaWebPage(let flags, let url): - if boxed { - buffer.appendInt32(-1038383031) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputMediaContact(let phoneNumber, let firstName, let lastName, let vcard): - return ("inputMediaContact", [("phoneNumber", phoneNumber as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("vcard", vcard as Any)]) - case .inputMediaDice(let emoticon): - return ("inputMediaDice", [("emoticon", emoticon as Any)]) - case .inputMediaDocument(let flags, let id, let videoCover, let videoTimestamp, let ttlSeconds, let query): - return ("inputMediaDocument", [("flags", flags as Any), ("id", id as Any), ("videoCover", videoCover as Any), ("videoTimestamp", videoTimestamp as Any), ("ttlSeconds", ttlSeconds as Any), ("query", query as Any)]) - case .inputMediaDocumentExternal(let flags, let url, let ttlSeconds, let videoCover, let videoTimestamp): - return ("inputMediaDocumentExternal", [("flags", flags as Any), ("url", url as Any), ("ttlSeconds", ttlSeconds as Any), ("videoCover", videoCover as Any), ("videoTimestamp", videoTimestamp as Any)]) - case .inputMediaEmpty: + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .inputMediaVenue(let _data): + if boxed { + buffer.appendInt32(-1052959727) + } + _data.geoPoint.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.address, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + serializeString(_data.venueId, buffer: buffer, boxed: false) + serializeString(_data.venueType, buffer: buffer, boxed: false) + break + case .inputMediaWebPage(let _data): + if boxed { + buffer.appendInt32(-1038383031) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMediaContact(let _data): + return ("inputMediaContact", [("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any)]) + case .inputMediaDice(let _data): + return ("inputMediaDice", [("emoticon", _data.emoticon as Any)]) + case .inputMediaDocument(let _data): + return ("inputMediaDocument", [("flags", _data.flags as Any), ("id", _data.id as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("query", _data.query as Any)]) + case .inputMediaDocumentExternal(let _data): + return ("inputMediaDocumentExternal", [("flags", _data.flags as Any), ("url", _data.url as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any)]) + case .inputMediaEmpty: return ("inputMediaEmpty", []) - case .inputMediaGame(let id): - return ("inputMediaGame", [("id", id as Any)]) - case .inputMediaGeoLive(let flags, let geoPoint, let heading, let period, let proximityNotificationRadius): - return ("inputMediaGeoLive", [("flags", flags as Any), ("geoPoint", geoPoint as Any), ("heading", heading as Any), ("period", period as Any), ("proximityNotificationRadius", proximityNotificationRadius as Any)]) - case .inputMediaGeoPoint(let geoPoint): - return ("inputMediaGeoPoint", [("geoPoint", geoPoint as Any)]) - case .inputMediaInvoice(let flags, let title, let description, let photo, let invoice, let payload, let provider, let providerData, let startParam, let extendedMedia): - return ("inputMediaInvoice", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("payload", payload as Any), ("provider", provider as Any), ("providerData", providerData as Any), ("startParam", startParam as Any), ("extendedMedia", extendedMedia as Any)]) - case .inputMediaPaidMedia(let flags, let starsAmount, let extendedMedia, let payload): - return ("inputMediaPaidMedia", [("flags", flags as Any), ("starsAmount", starsAmount as Any), ("extendedMedia", extendedMedia as Any), ("payload", payload as Any)]) - case .inputMediaPhoto(let flags, let id, let ttlSeconds): - return ("inputMediaPhoto", [("flags", flags as Any), ("id", id as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .inputMediaPhotoExternal(let flags, let url, let ttlSeconds): - return ("inputMediaPhotoExternal", [("flags", flags as Any), ("url", url as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .inputMediaPoll(let flags, let poll, let correctAnswers, let solution, let solutionEntities): - return ("inputMediaPoll", [("flags", flags as Any), ("poll", poll as Any), ("correctAnswers", correctAnswers as Any), ("solution", solution as Any), ("solutionEntities", solutionEntities as Any)]) - case .inputMediaStakeDice(let gameHash, let tonAmount, let clientSeed): - return ("inputMediaStakeDice", [("gameHash", gameHash as Any), ("tonAmount", tonAmount as Any), ("clientSeed", clientSeed as Any)]) - case .inputMediaStory(let peer, let id): - return ("inputMediaStory", [("peer", peer as Any), ("id", id as Any)]) - case .inputMediaTodo(let todo): - return ("inputMediaTodo", [("todo", todo as Any)]) - case .inputMediaUploadedDocument(let flags, let file, let thumb, let mimeType, let attributes, let stickers, let videoCover, let videoTimestamp, let ttlSeconds): - return ("inputMediaUploadedDocument", [("flags", flags as Any), ("file", file as Any), ("thumb", thumb as Any), ("mimeType", mimeType as Any), ("attributes", attributes as Any), ("stickers", stickers as Any), ("videoCover", videoCover as Any), ("videoTimestamp", videoTimestamp as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .inputMediaUploadedPhoto(let flags, let file, let stickers, let ttlSeconds): - return ("inputMediaUploadedPhoto", [("flags", flags as Any), ("file", file as Any), ("stickers", stickers as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .inputMediaVenue(let geoPoint, let title, let address, let provider, let venueId, let venueType): - return ("inputMediaVenue", [("geoPoint", geoPoint as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any)]) - case .inputMediaWebPage(let flags, let url): - return ("inputMediaWebPage", [("flags", flags as Any), ("url", url as Any)]) - } - } - + case .inputMediaGame(let _data): + return ("inputMediaGame", [("id", _data.id as Any)]) + case .inputMediaGeoLive(let _data): + return ("inputMediaGeoLive", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any)]) + case .inputMediaGeoPoint(let _data): + return ("inputMediaGeoPoint", [("geoPoint", _data.geoPoint as Any)]) + case .inputMediaInvoice(let _data): + return ("inputMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("payload", _data.payload as Any), ("provider", _data.provider as Any), ("providerData", _data.providerData as Any), ("startParam", _data.startParam as Any), ("extendedMedia", _data.extendedMedia as Any)]) + case .inputMediaPaidMedia(let _data): + return ("inputMediaPaidMedia", [("flags", _data.flags as Any), ("starsAmount", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any), ("payload", _data.payload as Any)]) + case .inputMediaPhoto(let _data): + return ("inputMediaPhoto", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .inputMediaPhotoExternal(let _data): + return ("inputMediaPhotoExternal", [("flags", _data.flags as Any), ("url", _data.url as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .inputMediaPoll(let _data): + return ("inputMediaPoll", [("flags", _data.flags as Any), ("poll", _data.poll as Any), ("correctAnswers", _data.correctAnswers as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any)]) + case .inputMediaStakeDice(let _data): + return ("inputMediaStakeDice", [("gameHash", _data.gameHash as Any), ("tonAmount", _data.tonAmount as Any), ("clientSeed", _data.clientSeed as Any)]) + case .inputMediaStory(let _data): + return ("inputMediaStory", [("peer", _data.peer as Any), ("id", _data.id as Any)]) + case .inputMediaTodo(let _data): + return ("inputMediaTodo", [("todo", _data.todo as Any)]) + case .inputMediaUploadedDocument(let _data): + return ("inputMediaUploadedDocument", [("flags", _data.flags as Any), ("file", _data.file as Any), ("thumb", _data.thumb as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any), ("stickers", _data.stickers as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .inputMediaUploadedPhoto(let _data): + return ("inputMediaUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("stickers", _data.stickers as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .inputMediaVenue(let _data): + return ("inputMediaVenue", [("geoPoint", _data.geoPoint as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + case .inputMediaWebPage(let _data): + return ("inputMediaWebPage", [("flags", _data.flags as Any), ("url", _data.url as Any)]) + } + } + public static func parse_inputMediaContact(_ reader: BufferReader) -> InputMedia? { var _1: String? _1 = parseString(reader) @@ -285,7 +564,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputMedia.inputMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!) + return Api.InputMedia.inputMediaContact(Cons_inputMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!)) } else { return nil @@ -296,7 +575,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputMedia.inputMediaDice(emoticon: _1!) + return Api.InputMedia.inputMediaDice(Cons_inputMediaDice(emoticon: _1!)) } else { return nil @@ -310,15 +589,23 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputDocument } var _3: Api.InputPhoto? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputPhoto - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputPhoto + } + } var _4: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } var _6: String? - if Int(_1!) & Int(1 << 1) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil @@ -326,7 +613,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputMedia.inputMediaDocument(flags: _1!, id: _2!, videoCover: _3, videoTimestamp: _4, ttlSeconds: _5, query: _6) + return Api.InputMedia.inputMediaDocument(Cons_inputMediaDocument(flags: _1!, id: _2!, videoCover: _3, videoTimestamp: _4, ttlSeconds: _5, query: _6)) } else { return nil @@ -338,20 +625,26 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.InputPhoto? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputPhoto - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputPhoto + } + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputMedia.inputMediaDocumentExternal(flags: _1!, url: _2!, ttlSeconds: _3, videoCover: _4, videoTimestamp: _5) + return Api.InputMedia.inputMediaDocumentExternal(Cons_inputMediaDocumentExternal(flags: _1!, url: _2!, ttlSeconds: _3, videoCover: _4, videoTimestamp: _5)) } else { return nil @@ -367,7 +660,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputMedia.inputMediaGame(id: _1!) + return Api.InputMedia.inputMediaGame(Cons_inputMediaGame(id: _1!)) } else { return nil @@ -381,18 +674,24 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint } var _3: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputMedia.inputMediaGeoLive(flags: _1!, geoPoint: _2!, heading: _3, period: _4, proximityNotificationRadius: _5) + return Api.InputMedia.inputMediaGeoLive(Cons_inputMediaGeoLive(flags: _1!, geoPoint: _2!, heading: _3, period: _4, proximityNotificationRadius: _5)) } else { return nil @@ -405,7 +704,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputMedia.inputMediaGeoPoint(geoPoint: _1!) + return Api.InputMedia.inputMediaGeoPoint(Cons_inputMediaGeoPoint(geoPoint: _1!)) } else { return nil @@ -419,9 +718,11 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.InputWebDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputWebDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputWebDocument + } + } var _5: Api.Invoice? if let signature = reader.readInt32() { _5 = Api.parse(reader, signature: signature) as? Api.Invoice @@ -429,17 +730,23 @@ public extension Api { var _6: Buffer? _6 = parseBytes(reader) var _7: String? - if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } var _8: Api.DataJSON? if let signature = reader.readInt32() { _8 = Api.parse(reader, signature: signature) as? Api.DataJSON } var _9: String? - if Int(_1!) & Int(1 << 1) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _9 = parseString(reader) + } var _10: Api.InputMedia? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.InputMedia - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.InputMedia + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -451,7 +758,7 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 1) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 2) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.InputMedia.inputMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, invoice: _5!, payload: _6!, provider: _7, providerData: _8!, startParam: _9, extendedMedia: _10) + return Api.InputMedia.inputMediaInvoice(Cons_inputMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, invoice: _5!, payload: _6!, provider: _7, providerData: _8!, startParam: _9, extendedMedia: _10)) } else { return nil @@ -467,13 +774,15 @@ public extension Api { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputMedia.self) } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputMedia.inputMediaPaidMedia(flags: _1!, starsAmount: _2!, extendedMedia: _3!, payload: _4) + return Api.InputMedia.inputMediaPaidMedia(Cons_inputMediaPaidMedia(flags: _1!, starsAmount: _2!, extendedMedia: _3!, payload: _4)) } else { return nil @@ -487,12 +796,14 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputPhoto } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.InputMedia.inputMediaPhoto(flags: _1!, id: _2!, ttlSeconds: _3) + return Api.InputMedia.inputMediaPhoto(Cons_inputMediaPhoto(flags: _1!, id: _2!, ttlSeconds: _3)) } else { return nil @@ -504,12 +815,14 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.InputMedia.inputMediaPhotoExternal(flags: _1!, url: _2!, ttlSeconds: _3) + return Api.InputMedia.inputMediaPhotoExternal(Cons_inputMediaPhotoExternal(flags: _1!, url: _2!, ttlSeconds: _3)) } else { return nil @@ -523,22 +836,28 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Poll } var _3: [Buffer]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputMedia.inputMediaPoll(flags: _1!, poll: _2!, correctAnswers: _3, solution: _4, solutionEntities: _5) + return Api.InputMedia.inputMediaPoll(Cons_inputMediaPoll(flags: _1!, poll: _2!, correctAnswers: _3, solution: _4, solutionEntities: _5)) } else { return nil @@ -555,7 +874,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputMedia.inputMediaStakeDice(gameHash: _1!, tonAmount: _2!, clientSeed: _3!) + return Api.InputMedia.inputMediaStakeDice(Cons_inputMediaStakeDice(gameHash: _1!, tonAmount: _2!, clientSeed: _3!)) } else { return nil @@ -571,7 +890,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputMedia.inputMediaStory(peer: _1!, id: _2!) + return Api.InputMedia.inputMediaStory(Cons_inputMediaStory(peer: _1!, id: _2!)) } else { return nil @@ -584,7 +903,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputMedia.inputMediaTodo(todo: _1!) + return Api.InputMedia.inputMediaTodo(Cons_inputMediaTodo(todo: _1!)) } else { return nil @@ -598,9 +917,11 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputFile } var _3: Api.InputFile? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputFile - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputFile + } + } var _4: String? _4 = parseString(reader) var _5: [Api.DocumentAttribute]? @@ -608,17 +929,25 @@ public extension Api { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self) } var _6: [Api.InputDocument]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputDocument.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputDocument.self) + } + } var _7: Api.InputPhoto? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.InputPhoto - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.InputPhoto + } + } var _8: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _8 = reader.readInt32() + } var _9: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _9 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil @@ -629,7 +958,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 7) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 1) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputMedia.inputMediaUploadedDocument(flags: _1!, file: _2!, thumb: _3, mimeType: _4!, attributes: _5!, stickers: _6, videoCover: _7, videoTimestamp: _8, ttlSeconds: _9) + return Api.InputMedia.inputMediaUploadedDocument(Cons_inputMediaUploadedDocument(flags: _1!, file: _2!, thumb: _3, mimeType: _4!, attributes: _5!, stickers: _6, videoCover: _7, videoTimestamp: _8, ttlSeconds: _9)) } else { return nil @@ -643,17 +972,21 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputFile } var _3: [Api.InputDocument]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputDocument.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputDocument.self) + } + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputMedia.inputMediaUploadedPhoto(flags: _1!, file: _2!, stickers: _3, ttlSeconds: _4) + return Api.InputMedia.inputMediaUploadedPhoto(Cons_inputMediaUploadedPhoto(flags: _1!, file: _2!, stickers: _3, ttlSeconds: _4)) } else { return nil @@ -681,7 +1014,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputMedia.inputMediaVenue(geoPoint: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!) + return Api.InputMedia.inputMediaVenue(Cons_inputMediaVenue(geoPoint: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!)) } else { return nil @@ -695,65 +1028,83 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputMedia.inputMediaWebPage(flags: _1!, url: _2!) + return Api.InputMedia.inputMediaWebPage(Cons_inputMediaWebPage(flags: _1!, url: _2!)) } else { return nil } } - } } public extension Api { enum InputMessage: TypeConstructorDescription { - case inputMessageCallbackQuery(id: Int32, queryId: Int64) - case inputMessageID(id: Int32) + public class Cons_inputMessageCallbackQuery { + public var id: Int32 + public var queryId: Int64 + public init(id: Int32, queryId: Int64) { + self.id = id + self.queryId = queryId + } + } + public class Cons_inputMessageID { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + } + public class Cons_inputMessageReplyTo { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + } + case inputMessageCallbackQuery(Cons_inputMessageCallbackQuery) + case inputMessageID(Cons_inputMessageID) case inputMessagePinned - case inputMessageReplyTo(id: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputMessageCallbackQuery(let id, let queryId): - if boxed { - buffer.appendInt32(-1392895362) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - break - case .inputMessageID(let id): - if boxed { - buffer.appendInt32(-1502174430) - } - serializeInt32(id, buffer: buffer, boxed: false) - break - case .inputMessagePinned: - if boxed { - buffer.appendInt32(-2037963464) - } - - break - case .inputMessageReplyTo(let id): - if boxed { - buffer.appendInt32(-1160215659) - } - serializeInt32(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputMessageCallbackQuery(let id, let queryId): - return ("inputMessageCallbackQuery", [("id", id as Any), ("queryId", queryId as Any)]) - case .inputMessageID(let id): - return ("inputMessageID", [("id", id as Any)]) - case .inputMessagePinned: + case inputMessageReplyTo(Cons_inputMessageReplyTo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMessageCallbackQuery(let _data): + if boxed { + buffer.appendInt32(-1392895362) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + break + case .inputMessageID(let _data): + if boxed { + buffer.appendInt32(-1502174430) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + case .inputMessagePinned: + if boxed { + buffer.appendInt32(-2037963464) + } + break + case .inputMessageReplyTo(let _data): + if boxed { + buffer.appendInt32(-1160215659) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMessageCallbackQuery(let _data): + return ("inputMessageCallbackQuery", [("id", _data.id as Any), ("queryId", _data.queryId as Any)]) + case .inputMessageID(let _data): + return ("inputMessageID", [("id", _data.id as Any)]) + case .inputMessagePinned: return ("inputMessagePinned", []) - case .inputMessageReplyTo(let id): - return ("inputMessageReplyTo", [("id", id as Any)]) - } - } - + case .inputMessageReplyTo(let _data): + return ("inputMessageReplyTo", [("id", _data.id as Any)]) + } + } + public static func parse_inputMessageCallbackQuery(_ reader: BufferReader) -> InputMessage? { var _1: Int32? _1 = reader.readInt32() @@ -762,7 +1113,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputMessage.inputMessageCallbackQuery(id: _1!, queryId: _2!) + return Api.InputMessage.inputMessageCallbackQuery(Cons_inputMessageCallbackQuery(id: _1!, queryId: _2!)) } else { return nil @@ -773,7 +1124,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputMessage.inputMessageID(id: _1!) + return Api.InputMessage.inputMessageID(Cons_inputMessageID(id: _1!)) } else { return nil @@ -787,74 +1138,84 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputMessage.inputMessageReplyTo(id: _1!) + return Api.InputMessage.inputMessageReplyTo(Cons_inputMessageReplyTo(id: _1!)) } else { return nil } } - } } public extension Api { indirect enum InputNotifyPeer: TypeConstructorDescription { + public class Cons_inputNotifyForumTopic { + public var peer: Api.InputPeer + public var topMsgId: Int32 + public init(peer: Api.InputPeer, topMsgId: Int32) { + self.peer = peer + self.topMsgId = topMsgId + } + } + public class Cons_inputNotifyPeer { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + } case inputNotifyBroadcasts case inputNotifyChats - case inputNotifyForumTopic(peer: Api.InputPeer, topMsgId: Int32) - case inputNotifyPeer(peer: Api.InputPeer) + case inputNotifyForumTopic(Cons_inputNotifyForumTopic) + case inputNotifyPeer(Cons_inputNotifyPeer) case inputNotifyUsers - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputNotifyBroadcasts: - if boxed { - buffer.appendInt32(-1311015810) - } - - break - case .inputNotifyChats: - if boxed { - buffer.appendInt32(1251338318) - } - - break - case .inputNotifyForumTopic(let peer, let topMsgId): - if boxed { - buffer.appendInt32(1548122514) - } - peer.serialize(buffer, true) - serializeInt32(topMsgId, buffer: buffer, boxed: false) - break - case .inputNotifyPeer(let peer): - if boxed { - buffer.appendInt32(-1195615476) - } - peer.serialize(buffer, true) - break - case .inputNotifyUsers: - if boxed { - buffer.appendInt32(423314455) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputNotifyBroadcasts: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputNotifyBroadcasts: + if boxed { + buffer.appendInt32(-1311015810) + } + break + case .inputNotifyChats: + if boxed { + buffer.appendInt32(1251338318) + } + break + case .inputNotifyForumTopic(let _data): + if boxed { + buffer.appendInt32(1548122514) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMsgId, buffer: buffer, boxed: false) + break + case .inputNotifyPeer(let _data): + if boxed { + buffer.appendInt32(-1195615476) + } + _data.peer.serialize(buffer, true) + break + case .inputNotifyUsers: + if boxed { + buffer.appendInt32(423314455) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputNotifyBroadcasts: return ("inputNotifyBroadcasts", []) - case .inputNotifyChats: + case .inputNotifyChats: return ("inputNotifyChats", []) - case .inputNotifyForumTopic(let peer, let topMsgId): - return ("inputNotifyForumTopic", [("peer", peer as Any), ("topMsgId", topMsgId as Any)]) - case .inputNotifyPeer(let peer): - return ("inputNotifyPeer", [("peer", peer as Any)]) - case .inputNotifyUsers: + case .inputNotifyForumTopic(let _data): + return ("inputNotifyForumTopic", [("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any)]) + case .inputNotifyPeer(let _data): + return ("inputNotifyPeer", [("peer", _data.peer as Any)]) + case .inputNotifyUsers: return ("inputNotifyUsers", []) - } - } - + } + } + public static func parse_inputNotifyBroadcasts(_ reader: BufferReader) -> InputNotifyPeer? { return Api.InputNotifyPeer.inputNotifyBroadcasts } @@ -871,7 +1232,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputNotifyPeer.inputNotifyForumTopic(peer: _1!, topMsgId: _2!) + return Api.InputNotifyPeer.inputNotifyForumTopic(Cons_inputNotifyForumTopic(peer: _1!, topMsgId: _2!)) } else { return nil @@ -884,7 +1245,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputNotifyPeer.inputNotifyPeer(peer: _1!) + return Api.InputNotifyPeer.inputNotifyPeer(Cons_inputNotifyPeer(peer: _1!)) } else { return nil @@ -893,48 +1254,63 @@ public extension Api { public static func parse_inputNotifyUsers(_ reader: BufferReader) -> InputNotifyPeer? { return Api.InputNotifyPeer.inputNotifyUsers } - } } public extension Api { enum InputPasskeyCredential: TypeConstructorDescription { - case inputPasskeyCredentialFirebasePNV(pnvToken: String) - case inputPasskeyCredentialPublicKey(id: String, rawId: String, response: Api.InputPasskeyResponse) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPasskeyCredentialFirebasePNV(let pnvToken): - if boxed { - buffer.appendInt32(1528613672) - } - serializeString(pnvToken, buffer: buffer, boxed: false) - break - case .inputPasskeyCredentialPublicKey(let id, let rawId, let response): - if boxed { - buffer.appendInt32(1009235855) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(rawId, buffer: buffer, boxed: false) - response.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPasskeyCredentialFirebasePNV(let pnvToken): - return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", pnvToken as Any)]) - case .inputPasskeyCredentialPublicKey(let id, let rawId, let response): - return ("inputPasskeyCredentialPublicKey", [("id", id as Any), ("rawId", rawId as Any), ("response", response as Any)]) - } - } - + public class Cons_inputPasskeyCredentialFirebasePNV { + public var pnvToken: String + public init(pnvToken: String) { + self.pnvToken = pnvToken + } + } + public class Cons_inputPasskeyCredentialPublicKey { + public var id: String + public var rawId: String + public var response: Api.InputPasskeyResponse + public init(id: String, rawId: String, response: Api.InputPasskeyResponse) { + self.id = id + self.rawId = rawId + self.response = response + } + } + case inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV) + case inputPasskeyCredentialPublicKey(Cons_inputPasskeyCredentialPublicKey) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPasskeyCredentialFirebasePNV(let _data): + if boxed { + buffer.appendInt32(1528613672) + } + serializeString(_data.pnvToken, buffer: buffer, boxed: false) + break + case .inputPasskeyCredentialPublicKey(let _data): + if boxed { + buffer.appendInt32(1009235855) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.rawId, buffer: buffer, boxed: false) + _data.response.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPasskeyCredentialFirebasePNV(let _data): + return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", _data.pnvToken as Any)]) + case .inputPasskeyCredentialPublicKey(let _data): + return ("inputPasskeyCredentialPublicKey", [("id", _data.id as Any), ("rawId", _data.rawId as Any), ("response", _data.response as Any)]) + } + } + public static func parse_inputPasskeyCredentialFirebasePNV(_ reader: BufferReader) -> InputPasskeyCredential? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputPasskeyCredential.inputPasskeyCredentialFirebasePNV(pnvToken: _1!) + return Api.InputPasskeyCredential.inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV(pnvToken: _1!)) } else { return nil @@ -953,50 +1329,69 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputPasskeyCredential.inputPasskeyCredentialPublicKey(id: _1!, rawId: _2!, response: _3!) + return Api.InputPasskeyCredential.inputPasskeyCredentialPublicKey(Cons_inputPasskeyCredentialPublicKey(id: _1!, rawId: _2!, response: _3!)) } else { return nil } } - } } public extension Api { enum InputPasskeyResponse: TypeConstructorDescription { - case inputPasskeyResponseLogin(clientData: Api.DataJSON, authenticatorData: Buffer, signature: Buffer, userHandle: String) - case inputPasskeyResponseRegister(clientData: Api.DataJSON, attestationData: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPasskeyResponseLogin(let clientData, let authenticatorData, let signature, let userHandle): - if boxed { - buffer.appendInt32(-1021329078) - } - clientData.serialize(buffer, true) - serializeBytes(authenticatorData, buffer: buffer, boxed: false) - serializeBytes(signature, buffer: buffer, boxed: false) - serializeString(userHandle, buffer: buffer, boxed: false) - break - case .inputPasskeyResponseRegister(let clientData, let attestationData): - if boxed { - buffer.appendInt32(1046713180) - } - clientData.serialize(buffer, true) - serializeBytes(attestationData, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPasskeyResponseLogin(let clientData, let authenticatorData, let signature, let userHandle): - return ("inputPasskeyResponseLogin", [("clientData", clientData as Any), ("authenticatorData", authenticatorData as Any), ("signature", signature as Any), ("userHandle", userHandle as Any)]) - case .inputPasskeyResponseRegister(let clientData, let attestationData): - return ("inputPasskeyResponseRegister", [("clientData", clientData as Any), ("attestationData", attestationData as Any)]) - } - } - + public class Cons_inputPasskeyResponseLogin { + public var clientData: Api.DataJSON + public var authenticatorData: Buffer + public var signature: Buffer + public var userHandle: String + public init(clientData: Api.DataJSON, authenticatorData: Buffer, signature: Buffer, userHandle: String) { + self.clientData = clientData + self.authenticatorData = authenticatorData + self.signature = signature + self.userHandle = userHandle + } + } + public class Cons_inputPasskeyResponseRegister { + public var clientData: Api.DataJSON + public var attestationData: Buffer + public init(clientData: Api.DataJSON, attestationData: Buffer) { + self.clientData = clientData + self.attestationData = attestationData + } + } + case inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin) + case inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPasskeyResponseLogin(let _data): + if boxed { + buffer.appendInt32(-1021329078) + } + _data.clientData.serialize(buffer, true) + serializeBytes(_data.authenticatorData, buffer: buffer, boxed: false) + serializeBytes(_data.signature, buffer: buffer, boxed: false) + serializeString(_data.userHandle, buffer: buffer, boxed: false) + break + case .inputPasskeyResponseRegister(let _data): + if boxed { + buffer.appendInt32(1046713180) + } + _data.clientData.serialize(buffer, true) + serializeBytes(_data.attestationData, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPasskeyResponseLogin(let _data): + return ("inputPasskeyResponseLogin", [("clientData", _data.clientData as Any), ("authenticatorData", _data.authenticatorData as Any), ("signature", _data.signature as Any), ("userHandle", _data.userHandle as Any)]) + case .inputPasskeyResponseRegister(let _data): + return ("inputPasskeyResponseRegister", [("clientData", _data.clientData as Any), ("attestationData", _data.attestationData as Any)]) + } + } + public static func parse_inputPasskeyResponseLogin(_ reader: BufferReader) -> InputPasskeyResponse? { var _1: Api.DataJSON? if let signature = reader.readInt32() { @@ -1013,7 +1408,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputPasskeyResponse.inputPasskeyResponseLogin(clientData: _1!, authenticatorData: _2!, signature: _3!, userHandle: _4!) + return Api.InputPasskeyResponse.inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin(clientData: _1!, authenticatorData: _2!, signature: _3!, userHandle: _4!)) } else { return nil @@ -1029,12 +1424,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPasskeyResponse.inputPasskeyResponseRegister(clientData: _1!, attestationData: _2!) + return Api.InputPasskeyResponse.inputPasskeyResponseRegister(Cons_inputPasskeyResponseRegister(clientData: _1!, attestationData: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api12.swift b/submodules/TelegramApi/Sources/Api12.swift index 2a09b85776..fcccdfe53d 100644 --- a/submodules/TelegramApi/Sources/Api12.swift +++ b/submodules/TelegramApi/Sources/Api12.swift @@ -1,54 +1,82 @@ public extension Api { enum InputPaymentCredentials: TypeConstructorDescription { - case inputPaymentCredentials(flags: Int32, data: Api.DataJSON) - case inputPaymentCredentialsApplePay(paymentData: Api.DataJSON) - case inputPaymentCredentialsGooglePay(paymentToken: Api.DataJSON) - case inputPaymentCredentialsSaved(id: String, tmpPassword: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPaymentCredentials(let flags, let data): - if boxed { - buffer.appendInt32(873977640) - } - serializeInt32(flags, buffer: buffer, boxed: false) - data.serialize(buffer, true) - break - case .inputPaymentCredentialsApplePay(let paymentData): - if boxed { - buffer.appendInt32(178373535) - } - paymentData.serialize(buffer, true) - break - case .inputPaymentCredentialsGooglePay(let paymentToken): - if boxed { - buffer.appendInt32(-1966921727) - } - paymentToken.serialize(buffer, true) - break - case .inputPaymentCredentialsSaved(let id, let tmpPassword): - if boxed { - buffer.appendInt32(-1056001329) - } - serializeString(id, buffer: buffer, boxed: false) - serializeBytes(tmpPassword, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPaymentCredentials(let flags, let data): - return ("inputPaymentCredentials", [("flags", flags as Any), ("data", data as Any)]) - case .inputPaymentCredentialsApplePay(let paymentData): - return ("inputPaymentCredentialsApplePay", [("paymentData", paymentData as Any)]) - case .inputPaymentCredentialsGooglePay(let paymentToken): - return ("inputPaymentCredentialsGooglePay", [("paymentToken", paymentToken as Any)]) - case .inputPaymentCredentialsSaved(let id, let tmpPassword): - return ("inputPaymentCredentialsSaved", [("id", id as Any), ("tmpPassword", tmpPassword as Any)]) - } - } - + public class Cons_inputPaymentCredentials { + public var flags: Int32 + public var data: Api.DataJSON + public init(flags: Int32, data: Api.DataJSON) { + self.flags = flags + self.data = data + } + } + public class Cons_inputPaymentCredentialsApplePay { + public var paymentData: Api.DataJSON + public init(paymentData: Api.DataJSON) { + self.paymentData = paymentData + } + } + public class Cons_inputPaymentCredentialsGooglePay { + public var paymentToken: Api.DataJSON + public init(paymentToken: Api.DataJSON) { + self.paymentToken = paymentToken + } + } + public class Cons_inputPaymentCredentialsSaved { + public var id: String + public var tmpPassword: Buffer + public init(id: String, tmpPassword: Buffer) { + self.id = id + self.tmpPassword = tmpPassword + } + } + case inputPaymentCredentials(Cons_inputPaymentCredentials) + case inputPaymentCredentialsApplePay(Cons_inputPaymentCredentialsApplePay) + case inputPaymentCredentialsGooglePay(Cons_inputPaymentCredentialsGooglePay) + case inputPaymentCredentialsSaved(Cons_inputPaymentCredentialsSaved) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPaymentCredentials(let _data): + if boxed { + buffer.appendInt32(873977640) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.data.serialize(buffer, true) + break + case .inputPaymentCredentialsApplePay(let _data): + if boxed { + buffer.appendInt32(178373535) + } + _data.paymentData.serialize(buffer, true) + break + case .inputPaymentCredentialsGooglePay(let _data): + if boxed { + buffer.appendInt32(-1966921727) + } + _data.paymentToken.serialize(buffer, true) + break + case .inputPaymentCredentialsSaved(let _data): + if boxed { + buffer.appendInt32(-1056001329) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeBytes(_data.tmpPassword, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPaymentCredentials(let _data): + return ("inputPaymentCredentials", [("flags", _data.flags as Any), ("data", _data.data as Any)]) + case .inputPaymentCredentialsApplePay(let _data): + return ("inputPaymentCredentialsApplePay", [("paymentData", _data.paymentData as Any)]) + case .inputPaymentCredentialsGooglePay(let _data): + return ("inputPaymentCredentialsGooglePay", [("paymentToken", _data.paymentToken as Any)]) + case .inputPaymentCredentialsSaved(let _data): + return ("inputPaymentCredentialsSaved", [("id", _data.id as Any), ("tmpPassword", _data.tmpPassword as Any)]) + } + } + public static func parse_inputPaymentCredentials(_ reader: BufferReader) -> InputPaymentCredentials? { var _1: Int32? _1 = reader.readInt32() @@ -59,7 +87,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPaymentCredentials.inputPaymentCredentials(flags: _1!, data: _2!) + return Api.InputPaymentCredentials.inputPaymentCredentials(Cons_inputPaymentCredentials(flags: _1!, data: _2!)) } else { return nil @@ -72,7 +100,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPaymentCredentials.inputPaymentCredentialsApplePay(paymentData: _1!) + return Api.InputPaymentCredentials.inputPaymentCredentialsApplePay(Cons_inputPaymentCredentialsApplePay(paymentData: _1!)) } else { return nil @@ -85,7 +113,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPaymentCredentials.inputPaymentCredentialsGooglePay(paymentToken: _1!) + return Api.InputPaymentCredentials.inputPaymentCredentialsGooglePay(Cons_inputPaymentCredentialsGooglePay(paymentToken: _1!)) } else { return nil @@ -99,97 +127,136 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPaymentCredentials.inputPaymentCredentialsSaved(id: _1!, tmpPassword: _2!) + return Api.InputPaymentCredentials.inputPaymentCredentialsSaved(Cons_inputPaymentCredentialsSaved(id: _1!, tmpPassword: _2!)) } else { return nil } } - } } public extension Api { indirect enum InputPeer: TypeConstructorDescription { - case inputPeerChannel(channelId: Int64, accessHash: Int64) - case inputPeerChannelFromMessage(peer: Api.InputPeer, msgId: Int32, channelId: Int64) - case inputPeerChat(chatId: Int64) + public class Cons_inputPeerChannel { + public var channelId: Int64 + public var accessHash: Int64 + public init(channelId: Int64, accessHash: Int64) { + self.channelId = channelId + self.accessHash = accessHash + } + } + public class Cons_inputPeerChannelFromMessage { + public var peer: Api.InputPeer + public var msgId: Int32 + public var channelId: Int64 + public init(peer: Api.InputPeer, msgId: Int32, channelId: Int64) { + self.peer = peer + self.msgId = msgId + self.channelId = channelId + } + } + public class Cons_inputPeerChat { + public var chatId: Int64 + public init(chatId: Int64) { + self.chatId = chatId + } + } + public class Cons_inputPeerUser { + public var userId: Int64 + public var accessHash: Int64 + public init(userId: Int64, accessHash: Int64) { + self.userId = userId + self.accessHash = accessHash + } + } + public class Cons_inputPeerUserFromMessage { + public var peer: Api.InputPeer + public var msgId: Int32 + public var userId: Int64 + public init(peer: Api.InputPeer, msgId: Int32, userId: Int64) { + self.peer = peer + self.msgId = msgId + self.userId = userId + } + } + case inputPeerChannel(Cons_inputPeerChannel) + case inputPeerChannelFromMessage(Cons_inputPeerChannelFromMessage) + case inputPeerChat(Cons_inputPeerChat) case inputPeerEmpty case inputPeerSelf - case inputPeerUser(userId: Int64, accessHash: Int64) - case inputPeerUserFromMessage(peer: Api.InputPeer, msgId: Int32, userId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPeerChannel(let channelId, let accessHash): - if boxed { - buffer.appendInt32(666680316) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputPeerChannelFromMessage(let peer, let msgId, let channelId): - if boxed { - buffer.appendInt32(-1121318848) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - break - case .inputPeerChat(let chatId): - if boxed { - buffer.appendInt32(900291769) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - break - case .inputPeerEmpty: - if boxed { - buffer.appendInt32(2134579434) - } - - break - case .inputPeerSelf: - if boxed { - buffer.appendInt32(2107670217) - } - - break - case .inputPeerUser(let userId, let accessHash): - if boxed { - buffer.appendInt32(-571955892) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputPeerUserFromMessage(let peer, let msgId, let userId): - if boxed { - buffer.appendInt32(-1468331492) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPeerChannel(let channelId, let accessHash): - return ("inputPeerChannel", [("channelId", channelId as Any), ("accessHash", accessHash as Any)]) - case .inputPeerChannelFromMessage(let peer, let msgId, let channelId): - return ("inputPeerChannelFromMessage", [("peer", peer as Any), ("msgId", msgId as Any), ("channelId", channelId as Any)]) - case .inputPeerChat(let chatId): - return ("inputPeerChat", [("chatId", chatId as Any)]) - case .inputPeerEmpty: + case inputPeerUser(Cons_inputPeerUser) + case inputPeerUserFromMessage(Cons_inputPeerUserFromMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPeerChannel(let _data): + if boxed { + buffer.appendInt32(666680316) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputPeerChannelFromMessage(let _data): + if boxed { + buffer.appendInt32(-1121318848) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + break + case .inputPeerChat(let _data): + if boxed { + buffer.appendInt32(900291769) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + break + case .inputPeerEmpty: + if boxed { + buffer.appendInt32(2134579434) + } + break + case .inputPeerSelf: + if boxed { + buffer.appendInt32(2107670217) + } + break + case .inputPeerUser(let _data): + if boxed { + buffer.appendInt32(-571955892) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputPeerUserFromMessage(let _data): + if boxed { + buffer.appendInt32(-1468331492) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPeerChannel(let _data): + return ("inputPeerChannel", [("channelId", _data.channelId as Any), ("accessHash", _data.accessHash as Any)]) + case .inputPeerChannelFromMessage(let _data): + return ("inputPeerChannelFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("channelId", _data.channelId as Any)]) + case .inputPeerChat(let _data): + return ("inputPeerChat", [("chatId", _data.chatId as Any)]) + case .inputPeerEmpty: return ("inputPeerEmpty", []) - case .inputPeerSelf: + case .inputPeerSelf: return ("inputPeerSelf", []) - case .inputPeerUser(let userId, let accessHash): - return ("inputPeerUser", [("userId", userId as Any), ("accessHash", accessHash as Any)]) - case .inputPeerUserFromMessage(let peer, let msgId, let userId): - return ("inputPeerUserFromMessage", [("peer", peer as Any), ("msgId", msgId as Any), ("userId", userId as Any)]) - } - } - + case .inputPeerUser(let _data): + return ("inputPeerUser", [("userId", _data.userId as Any), ("accessHash", _data.accessHash as Any)]) + case .inputPeerUserFromMessage(let _data): + return ("inputPeerUserFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("userId", _data.userId as Any)]) + } + } + public static func parse_inputPeerChannel(_ reader: BufferReader) -> InputPeer? { var _1: Int64? _1 = reader.readInt64() @@ -198,7 +265,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPeer.inputPeerChannel(channelId: _1!, accessHash: _2!) + return Api.InputPeer.inputPeerChannel(Cons_inputPeerChannel(channelId: _1!, accessHash: _2!)) } else { return nil @@ -217,7 +284,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputPeer.inputPeerChannelFromMessage(peer: _1!, msgId: _2!, channelId: _3!) + return Api.InputPeer.inputPeerChannelFromMessage(Cons_inputPeerChannelFromMessage(peer: _1!, msgId: _2!, channelId: _3!)) } else { return nil @@ -228,7 +295,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.InputPeer.inputPeerChat(chatId: _1!) + return Api.InputPeer.inputPeerChat(Cons_inputPeerChat(chatId: _1!)) } else { return nil @@ -248,7 +315,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPeer.inputPeerUser(userId: _1!, accessHash: _2!) + return Api.InputPeer.inputPeerUser(Cons_inputPeerUser(userId: _1!, accessHash: _2!)) } else { return nil @@ -267,73 +334,120 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputPeer.inputPeerUserFromMessage(peer: _1!, msgId: _2!, userId: _3!) + return Api.InputPeer.inputPeerUserFromMessage(Cons_inputPeerUserFromMessage(peer: _1!, msgId: _2!, userId: _3!)) } else { return nil } } - } } public extension Api { enum InputPeerNotifySettings: TypeConstructorDescription { - case inputPeerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesSound: Api.NotificationSound?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound, let storiesMuted, let storiesHideSender, let storiesSound): - if boxed { - buffer.appendInt32(-892638494) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {showPreviews!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {silent!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(muteUntil!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {sound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {storiesMuted!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {storiesHideSender!.serialize(buffer, true)} - if Int(flags) & Int(1 << 8) != 0 {storiesSound!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound, let storiesMuted, let storiesHideSender, let storiesSound): - return ("inputPeerNotifySettings", [("flags", flags as Any), ("showPreviews", showPreviews as Any), ("silent", silent as Any), ("muteUntil", muteUntil as Any), ("sound", sound as Any), ("storiesMuted", storiesMuted as Any), ("storiesHideSender", storiesHideSender as Any), ("storiesSound", storiesSound as Any)]) - } - } - + public class Cons_inputPeerNotifySettings { + public var flags: Int32 + public var showPreviews: Api.Bool? + public var silent: Api.Bool? + public var muteUntil: Int32? + public var sound: Api.NotificationSound? + public var storiesMuted: Api.Bool? + public var storiesHideSender: Api.Bool? + public var storiesSound: Api.NotificationSound? + public init(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesSound: Api.NotificationSound?) { + self.flags = flags + self.showPreviews = showPreviews + self.silent = silent + self.muteUntil = muteUntil + self.sound = sound + self.storiesMuted = storiesMuted + self.storiesHideSender = storiesHideSender + self.storiesSound = storiesSound + } + } + case inputPeerNotifySettings(Cons_inputPeerNotifySettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPeerNotifySettings(let _data): + if boxed { + buffer.appendInt32(-892638494) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.showPreviews!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.silent!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.muteUntil!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.sound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.storiesMuted!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + _data.storiesHideSender!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.storiesSound!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPeerNotifySettings(let _data): + return ("inputPeerNotifySettings", [("flags", _data.flags as Any), ("showPreviews", _data.showPreviews as Any), ("silent", _data.silent as Any), ("muteUntil", _data.muteUntil as Any), ("sound", _data.sound as Any), ("storiesMuted", _data.storiesMuted as Any), ("storiesHideSender", _data.storiesHideSender as Any), ("storiesSound", _data.storiesSound as Any)]) + } + } + public static func parse_inputPeerNotifySettings(_ reader: BufferReader) -> InputPeerNotifySettings? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: Api.Bool? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: Api.NotificationSound? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _6: Api.Bool? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _7: Api.Bool? - if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _8: Api.NotificationSound? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -343,38 +457,45 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 8) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.InputPeerNotifySettings.inputPeerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, sound: _5, storiesMuted: _6, storiesHideSender: _7, storiesSound: _8) + return Api.InputPeerNotifySettings.inputPeerNotifySettings(Cons_inputPeerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, sound: _5, storiesMuted: _6, storiesHideSender: _7, storiesSound: _8)) } else { return nil } } - } } public extension Api { enum InputPhoneCall: TypeConstructorDescription { - case inputPhoneCall(id: Int64, accessHash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPhoneCall(let id, let accessHash): - if boxed { - buffer.appendInt32(506920429) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPhoneCall(let id, let accessHash): - return ("inputPhoneCall", [("id", id as Any), ("accessHash", accessHash as Any)]) - } - } - + public class Cons_inputPhoneCall { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + case inputPhoneCall(Cons_inputPhoneCall) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPhoneCall(let _data): + if boxed { + buffer.appendInt32(506920429) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPhoneCall(let _data): + return ("inputPhoneCall", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + } + } + public static func parse_inputPhoneCall(_ reader: BufferReader) -> InputPhoneCall? { var _1: Int64? _1 = reader.readInt64() @@ -383,48 +504,56 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputPhoneCall.inputPhoneCall(id: _1!, accessHash: _2!) + return Api.InputPhoneCall.inputPhoneCall(Cons_inputPhoneCall(id: _1!, accessHash: _2!)) } else { return nil } } - } } public extension Api { enum InputPhoto: TypeConstructorDescription { - case inputPhoto(id: Int64, accessHash: Int64, fileReference: Buffer) + public class Cons_inputPhoto { + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public init(id: Int64, accessHash: Int64, fileReference: Buffer) { + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + } + } + case inputPhoto(Cons_inputPhoto) case inputPhotoEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPhoto(let id, let accessHash, let fileReference): - if boxed { - buffer.appendInt32(1001634122) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - break - case .inputPhotoEmpty: - if boxed { - buffer.appendInt32(483901197) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPhoto(let id, let accessHash, let fileReference): - return ("inputPhoto", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any)]) - case .inputPhotoEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPhoto(let _data): + if boxed { + buffer.appendInt32(1001634122) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + break + case .inputPhotoEmpty: + if boxed { + buffer.appendInt32(483901197) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPhoto(let _data): + return ("inputPhoto", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any)]) + case .inputPhotoEmpty: return ("inputPhotoEmpty", []) - } - } - + } + } + public static func parse_inputPhoto(_ reader: BufferReader) -> InputPhoto? { var _1: Int64? _1 = reader.readInt64() @@ -436,7 +565,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputPhoto.inputPhoto(id: _1!, accessHash: _2!, fileReference: _3!) + return Api.InputPhoto.inputPhoto(Cons_inputPhoto(id: _1!, accessHash: _2!, fileReference: _3!)) } else { return nil @@ -445,7 +574,6 @@ public extension Api { public static func parse_inputPhotoEmpty(_ reader: BufferReader) -> InputPhoto? { return Api.InputPhoto.inputPhotoEmpty } - } } public extension Api { @@ -464,129 +592,115 @@ public extension Api { case inputPrivacyKeyStarGiftsAutoSave case inputPrivacyKeyStatusTimestamp case inputPrivacyKeyVoiceMessages - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPrivacyKeyAbout: - if boxed { - buffer.appendInt32(941870144) - } - - break - case .inputPrivacyKeyAddedByPhone: - if boxed { - buffer.appendInt32(-786326563) - } - - break - case .inputPrivacyKeyBirthday: - if boxed { - buffer.appendInt32(-698740276) - } - - break - case .inputPrivacyKeyChatInvite: - if boxed { - buffer.appendInt32(-1107622874) - } - - break - case .inputPrivacyKeyForwards: - if boxed { - buffer.appendInt32(-1529000952) - } - - break - case .inputPrivacyKeyNoPaidMessages: - if boxed { - buffer.appendInt32(-1111124044) - } - - break - case .inputPrivacyKeyPhoneCall: - if boxed { - buffer.appendInt32(-88417185) - } - - break - case .inputPrivacyKeyPhoneNumber: - if boxed { - buffer.appendInt32(55761658) - } - - break - case .inputPrivacyKeyPhoneP2P: - if boxed { - buffer.appendInt32(-610373422) - } - - break - case .inputPrivacyKeyProfilePhoto: - if boxed { - buffer.appendInt32(1461304012) - } - - break - case .inputPrivacyKeySavedMusic: - if boxed { - buffer.appendInt32(1304334886) - } - - break - case .inputPrivacyKeyStarGiftsAutoSave: - if boxed { - buffer.appendInt32(-512548031) - } - - break - case .inputPrivacyKeyStatusTimestamp: - if boxed { - buffer.appendInt32(1335282456) - } - - break - case .inputPrivacyKeyVoiceMessages: - if boxed { - buffer.appendInt32(-1360618136) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPrivacyKeyAbout: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPrivacyKeyAbout: + if boxed { + buffer.appendInt32(941870144) + } + break + case .inputPrivacyKeyAddedByPhone: + if boxed { + buffer.appendInt32(-786326563) + } + break + case .inputPrivacyKeyBirthday: + if boxed { + buffer.appendInt32(-698740276) + } + break + case .inputPrivacyKeyChatInvite: + if boxed { + buffer.appendInt32(-1107622874) + } + break + case .inputPrivacyKeyForwards: + if boxed { + buffer.appendInt32(-1529000952) + } + break + case .inputPrivacyKeyNoPaidMessages: + if boxed { + buffer.appendInt32(-1111124044) + } + break + case .inputPrivacyKeyPhoneCall: + if boxed { + buffer.appendInt32(-88417185) + } + break + case .inputPrivacyKeyPhoneNumber: + if boxed { + buffer.appendInt32(55761658) + } + break + case .inputPrivacyKeyPhoneP2P: + if boxed { + buffer.appendInt32(-610373422) + } + break + case .inputPrivacyKeyProfilePhoto: + if boxed { + buffer.appendInt32(1461304012) + } + break + case .inputPrivacyKeySavedMusic: + if boxed { + buffer.appendInt32(1304334886) + } + break + case .inputPrivacyKeyStarGiftsAutoSave: + if boxed { + buffer.appendInt32(-512548031) + } + break + case .inputPrivacyKeyStatusTimestamp: + if boxed { + buffer.appendInt32(1335282456) + } + break + case .inputPrivacyKeyVoiceMessages: + if boxed { + buffer.appendInt32(-1360618136) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPrivacyKeyAbout: return ("inputPrivacyKeyAbout", []) - case .inputPrivacyKeyAddedByPhone: + case .inputPrivacyKeyAddedByPhone: return ("inputPrivacyKeyAddedByPhone", []) - case .inputPrivacyKeyBirthday: + case .inputPrivacyKeyBirthday: return ("inputPrivacyKeyBirthday", []) - case .inputPrivacyKeyChatInvite: + case .inputPrivacyKeyChatInvite: return ("inputPrivacyKeyChatInvite", []) - case .inputPrivacyKeyForwards: + case .inputPrivacyKeyForwards: return ("inputPrivacyKeyForwards", []) - case .inputPrivacyKeyNoPaidMessages: + case .inputPrivacyKeyNoPaidMessages: return ("inputPrivacyKeyNoPaidMessages", []) - case .inputPrivacyKeyPhoneCall: + case .inputPrivacyKeyPhoneCall: return ("inputPrivacyKeyPhoneCall", []) - case .inputPrivacyKeyPhoneNumber: + case .inputPrivacyKeyPhoneNumber: return ("inputPrivacyKeyPhoneNumber", []) - case .inputPrivacyKeyPhoneP2P: + case .inputPrivacyKeyPhoneP2P: return ("inputPrivacyKeyPhoneP2P", []) - case .inputPrivacyKeyProfilePhoto: + case .inputPrivacyKeyProfilePhoto: return ("inputPrivacyKeyProfilePhoto", []) - case .inputPrivacyKeySavedMusic: + case .inputPrivacyKeySavedMusic: return ("inputPrivacyKeySavedMusic", []) - case .inputPrivacyKeyStarGiftsAutoSave: + case .inputPrivacyKeyStarGiftsAutoSave: return ("inputPrivacyKeyStarGiftsAutoSave", []) - case .inputPrivacyKeyStatusTimestamp: + case .inputPrivacyKeyStatusTimestamp: return ("inputPrivacyKeyStatusTimestamp", []) - case .inputPrivacyKeyVoiceMessages: + case .inputPrivacyKeyVoiceMessages: return ("inputPrivacyKeyVoiceMessages", []) - } - } - + } + } + public static func parse_inputPrivacyKeyAbout(_ reader: BufferReader) -> InputPrivacyKey? { return Api.InputPrivacyKey.inputPrivacyKeyAbout } @@ -629,146 +743,161 @@ public extension Api { public static func parse_inputPrivacyKeyVoiceMessages(_ reader: BufferReader) -> InputPrivacyKey? { return Api.InputPrivacyKey.inputPrivacyKeyVoiceMessages } - } } public extension Api { enum InputPrivacyRule: TypeConstructorDescription { + public class Cons_inputPrivacyValueAllowChatParticipants { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + } + public class Cons_inputPrivacyValueAllowUsers { + public var users: [Api.InputUser] + public init(users: [Api.InputUser]) { + self.users = users + } + } + public class Cons_inputPrivacyValueDisallowChatParticipants { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + } + public class Cons_inputPrivacyValueDisallowUsers { + public var users: [Api.InputUser] + public init(users: [Api.InputUser]) { + self.users = users + } + } case inputPrivacyValueAllowAll case inputPrivacyValueAllowBots - case inputPrivacyValueAllowChatParticipants(chats: [Int64]) + case inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants) case inputPrivacyValueAllowCloseFriends case inputPrivacyValueAllowContacts case inputPrivacyValueAllowPremium - case inputPrivacyValueAllowUsers(users: [Api.InputUser]) + case inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers) case inputPrivacyValueDisallowAll case inputPrivacyValueDisallowBots - case inputPrivacyValueDisallowChatParticipants(chats: [Int64]) + case inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants) case inputPrivacyValueDisallowContacts - case inputPrivacyValueDisallowUsers(users: [Api.InputUser]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPrivacyValueAllowAll: - if boxed { - buffer.appendInt32(407582158) - } - - break - case .inputPrivacyValueAllowBots: - if boxed { - buffer.appendInt32(1515179237) - } - - break - case .inputPrivacyValueAllowChatParticipants(let chats): - if boxed { - buffer.appendInt32(-2079962673) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .inputPrivacyValueAllowCloseFriends: - if boxed { - buffer.appendInt32(793067081) - } - - break - case .inputPrivacyValueAllowContacts: - if boxed { - buffer.appendInt32(218751099) - } - - break - case .inputPrivacyValueAllowPremium: - if boxed { - buffer.appendInt32(2009975281) - } - - break - case .inputPrivacyValueAllowUsers(let users): - if boxed { - buffer.appendInt32(320652927) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .inputPrivacyValueDisallowAll: - if boxed { - buffer.appendInt32(-697604407) - } - - break - case .inputPrivacyValueDisallowBots: - if boxed { - buffer.appendInt32(-991594219) - } - - break - case .inputPrivacyValueDisallowChatParticipants(let chats): - if boxed { - buffer.appendInt32(-380694650) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .inputPrivacyValueDisallowContacts: - if boxed { - buffer.appendInt32(195371015) - } - - break - case .inputPrivacyValueDisallowUsers(let users): - if boxed { - buffer.appendInt32(-1877932953) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPrivacyValueAllowAll: + case inputPrivacyValueDisallowUsers(Cons_inputPrivacyValueDisallowUsers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPrivacyValueAllowAll: + if boxed { + buffer.appendInt32(407582158) + } + break + case .inputPrivacyValueAllowBots: + if boxed { + buffer.appendInt32(1515179237) + } + break + case .inputPrivacyValueAllowChatParticipants(let _data): + if boxed { + buffer.appendInt32(-2079962673) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .inputPrivacyValueAllowCloseFriends: + if boxed { + buffer.appendInt32(793067081) + } + break + case .inputPrivacyValueAllowContacts: + if boxed { + buffer.appendInt32(218751099) + } + break + case .inputPrivacyValueAllowPremium: + if boxed { + buffer.appendInt32(2009975281) + } + break + case .inputPrivacyValueAllowUsers(let _data): + if boxed { + buffer.appendInt32(320652927) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .inputPrivacyValueDisallowAll: + if boxed { + buffer.appendInt32(-697604407) + } + break + case .inputPrivacyValueDisallowBots: + if boxed { + buffer.appendInt32(-991594219) + } + break + case .inputPrivacyValueDisallowChatParticipants(let _data): + if boxed { + buffer.appendInt32(-380694650) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .inputPrivacyValueDisallowContacts: + if boxed { + buffer.appendInt32(195371015) + } + break + case .inputPrivacyValueDisallowUsers(let _data): + if boxed { + buffer.appendInt32(-1877932953) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPrivacyValueAllowAll: return ("inputPrivacyValueAllowAll", []) - case .inputPrivacyValueAllowBots: + case .inputPrivacyValueAllowBots: return ("inputPrivacyValueAllowBots", []) - case .inputPrivacyValueAllowChatParticipants(let chats): - return ("inputPrivacyValueAllowChatParticipants", [("chats", chats as Any)]) - case .inputPrivacyValueAllowCloseFriends: + case .inputPrivacyValueAllowChatParticipants(let _data): + return ("inputPrivacyValueAllowChatParticipants", [("chats", _data.chats as Any)]) + case .inputPrivacyValueAllowCloseFriends: return ("inputPrivacyValueAllowCloseFriends", []) - case .inputPrivacyValueAllowContacts: + case .inputPrivacyValueAllowContacts: return ("inputPrivacyValueAllowContacts", []) - case .inputPrivacyValueAllowPremium: + case .inputPrivacyValueAllowPremium: return ("inputPrivacyValueAllowPremium", []) - case .inputPrivacyValueAllowUsers(let users): - return ("inputPrivacyValueAllowUsers", [("users", users as Any)]) - case .inputPrivacyValueDisallowAll: + case .inputPrivacyValueAllowUsers(let _data): + return ("inputPrivacyValueAllowUsers", [("users", _data.users as Any)]) + case .inputPrivacyValueDisallowAll: return ("inputPrivacyValueDisallowAll", []) - case .inputPrivacyValueDisallowBots: + case .inputPrivacyValueDisallowBots: return ("inputPrivacyValueDisallowBots", []) - case .inputPrivacyValueDisallowChatParticipants(let chats): - return ("inputPrivacyValueDisallowChatParticipants", [("chats", chats as Any)]) - case .inputPrivacyValueDisallowContacts: + case .inputPrivacyValueDisallowChatParticipants(let _data): + return ("inputPrivacyValueDisallowChatParticipants", [("chats", _data.chats as Any)]) + case .inputPrivacyValueDisallowContacts: return ("inputPrivacyValueDisallowContacts", []) - case .inputPrivacyValueDisallowUsers(let users): - return ("inputPrivacyValueDisallowUsers", [("users", users as Any)]) - } - } - + case .inputPrivacyValueDisallowUsers(let _data): + return ("inputPrivacyValueDisallowUsers", [("users", _data.users as Any)]) + } + } + public static func parse_inputPrivacyValueAllowAll(_ reader: BufferReader) -> InputPrivacyRule? { return Api.InputPrivacyRule.inputPrivacyValueAllowAll } @@ -782,7 +911,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(chats: _1!) + return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants(chats: _1!)) } else { return nil @@ -804,7 +933,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(users: _1!) + return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers(users: _1!)) } else { return nil @@ -823,7 +952,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueDisallowChatParticipants(chats: _1!) + return Api.InputPrivacyRule.inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants(chats: _1!)) } else { return nil @@ -839,12 +968,11 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueDisallowUsers(users: _1!) + return Api.InputPrivacyRule.inputPrivacyValueDisallowUsers(Cons_inputPrivacyValueDisallowUsers(users: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api13.swift b/submodules/TelegramApi/Sources/Api13.swift index 4350470266..85cb63ae6a 100644 --- a/submodules/TelegramApi/Sources/Api13.swift +++ b/submodules/TelegramApi/Sources/Api13.swift @@ -1,40 +1,52 @@ public extension Api { enum InputQuickReplyShortcut: TypeConstructorDescription { - case inputQuickReplyShortcut(shortcut: String) - case inputQuickReplyShortcutId(shortcutId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputQuickReplyShortcut(let shortcut): - if boxed { - buffer.appendInt32(609840449) - } - serializeString(shortcut, buffer: buffer, boxed: false) - break - case .inputQuickReplyShortcutId(let shortcutId): - if boxed { - buffer.appendInt32(18418929) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputQuickReplyShortcut(let shortcut): - return ("inputQuickReplyShortcut", [("shortcut", shortcut as Any)]) - case .inputQuickReplyShortcutId(let shortcutId): - return ("inputQuickReplyShortcutId", [("shortcutId", shortcutId as Any)]) - } - } - + public class Cons_inputQuickReplyShortcut { + public var shortcut: String + public init(shortcut: String) { + self.shortcut = shortcut + } + } + public class Cons_inputQuickReplyShortcutId { + public var shortcutId: Int32 + public init(shortcutId: Int32) { + self.shortcutId = shortcutId + } + } + case inputQuickReplyShortcut(Cons_inputQuickReplyShortcut) + case inputQuickReplyShortcutId(Cons_inputQuickReplyShortcutId) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputQuickReplyShortcut(let _data): + if boxed { + buffer.appendInt32(609840449) + } + serializeString(_data.shortcut, buffer: buffer, boxed: false) + break + case .inputQuickReplyShortcutId(let _data): + if boxed { + buffer.appendInt32(18418929) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputQuickReplyShortcut(let _data): + return ("inputQuickReplyShortcut", [("shortcut", _data.shortcut as Any)]) + case .inputQuickReplyShortcutId(let _data): + return ("inputQuickReplyShortcutId", [("shortcutId", _data.shortcutId as Any)]) + } + } + public static func parse_inputQuickReplyShortcut(_ reader: BufferReader) -> InputQuickReplyShortcut? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputQuickReplyShortcut.inputQuickReplyShortcut(shortcut: _1!) + return Api.InputQuickReplyShortcut.inputQuickReplyShortcut(Cons_inputQuickReplyShortcut(shortcut: _1!)) } else { return nil @@ -45,93 +57,156 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputQuickReplyShortcut.inputQuickReplyShortcutId(shortcutId: _1!) + return Api.InputQuickReplyShortcut.inputQuickReplyShortcutId(Cons_inputQuickReplyShortcutId(shortcutId: _1!)) } else { return nil } } - } } public extension Api { indirect enum InputReplyTo: TypeConstructorDescription { - case inputReplyToMessage(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?, replyToPeerId: Api.InputPeer?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, monoforumPeerId: Api.InputPeer?, todoItemId: Int32?) - case inputReplyToMonoForum(monoforumPeerId: Api.InputPeer) - case inputReplyToStory(peer: Api.InputPeer, storyId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputReplyToMessage(let flags, let replyToMsgId, let topMsgId, let replyToPeerId, let quoteText, let quoteEntities, let quoteOffset, let monoforumPeerId, let todoItemId): - if boxed { - buffer.appendInt32(-2036351472) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(replyToMsgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {replyToPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(quoteText!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(quoteEntities!.count)) - for item in quoteEntities! { + public class Cons_inputReplyToMessage { + public var flags: Int32 + public var replyToMsgId: Int32 + public var topMsgId: Int32? + public var replyToPeerId: Api.InputPeer? + public var quoteText: String? + public var quoteEntities: [Api.MessageEntity]? + public var quoteOffset: Int32? + public var monoforumPeerId: Api.InputPeer? + public var todoItemId: Int32? + public init(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?, replyToPeerId: Api.InputPeer?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, monoforumPeerId: Api.InputPeer?, todoItemId: Int32?) { + self.flags = flags + self.replyToMsgId = replyToMsgId + self.topMsgId = topMsgId + self.replyToPeerId = replyToPeerId + self.quoteText = quoteText + self.quoteEntities = quoteEntities + self.quoteOffset = quoteOffset + self.monoforumPeerId = monoforumPeerId + self.todoItemId = todoItemId + } + } + public class Cons_inputReplyToMonoForum { + public var monoforumPeerId: Api.InputPeer + public init(monoforumPeerId: Api.InputPeer) { + self.monoforumPeerId = monoforumPeerId + } + } + public class Cons_inputReplyToStory { + public var peer: Api.InputPeer + public var storyId: Int32 + public init(peer: Api.InputPeer, storyId: Int32) { + self.peer = peer + self.storyId = storyId + } + } + case inputReplyToMessage(Cons_inputReplyToMessage) + case inputReplyToMonoForum(Cons_inputReplyToMonoForum) + case inputReplyToStory(Cons_inputReplyToStory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputReplyToMessage(let _data): + if boxed { + buffer.appendInt32(-2036351472) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.replyToMsgId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.replyToPeerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.quoteText!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.quoteEntities!.count)) + for item in _data.quoteEntities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(quoteOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {monoforumPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(todoItemId!, buffer: buffer, boxed: false)} - break - case .inputReplyToMonoForum(let monoforumPeerId): - if boxed { - buffer.appendInt32(1775660101) } - monoforumPeerId.serialize(buffer, true) - break - case .inputReplyToStory(let peer, let storyId): - if boxed { - buffer.appendInt32(1484862010) - } - peer.serialize(buffer, true) - serializeInt32(storyId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputReplyToMessage(let flags, let replyToMsgId, let topMsgId, let replyToPeerId, let quoteText, let quoteEntities, let quoteOffset, let monoforumPeerId, let todoItemId): - return ("inputReplyToMessage", [("flags", flags as Any), ("replyToMsgId", replyToMsgId as Any), ("topMsgId", topMsgId as Any), ("replyToPeerId", replyToPeerId as Any), ("quoteText", quoteText as Any), ("quoteEntities", quoteEntities as Any), ("quoteOffset", quoteOffset as Any), ("monoforumPeerId", monoforumPeerId as Any), ("todoItemId", todoItemId as Any)]) - case .inputReplyToMonoForum(let monoforumPeerId): - return ("inputReplyToMonoForum", [("monoforumPeerId", monoforumPeerId as Any)]) - case .inputReplyToStory(let peer, let storyId): - return ("inputReplyToStory", [("peer", peer as Any), ("storyId", storyId as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.quoteOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.monoforumPeerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.todoItemId!, buffer: buffer, boxed: false) + } + break + case .inputReplyToMonoForum(let _data): + if boxed { + buffer.appendInt32(1775660101) + } + _data.monoforumPeerId.serialize(buffer, true) + break + case .inputReplyToStory(let _data): + if boxed { + buffer.appendInt32(1484862010) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.storyId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputReplyToMessage(let _data): + return ("inputReplyToMessage", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("topMsgId", _data.topMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("monoforumPeerId", _data.monoforumPeerId as Any), ("todoItemId", _data.todoItemId as Any)]) + case .inputReplyToMonoForum(let _data): + return ("inputReplyToMonoForum", [("monoforumPeerId", _data.monoforumPeerId as Any)]) + case .inputReplyToStory(let _data): + return ("inputReplyToStory", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any)]) + } + } + public static func parse_inputReplyToMessage(_ reader: BufferReader) -> InputReplyTo? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.InputPeer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputPeer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _7: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = reader.readInt32() + } var _8: Api.InputPeer? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.InputPeer - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + } var _9: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _9 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -142,7 +217,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputReplyTo.inputReplyToMessage(flags: _1!, replyToMsgId: _2!, topMsgId: _3, replyToPeerId: _4, quoteText: _5, quoteEntities: _6, quoteOffset: _7, monoforumPeerId: _8, todoItemId: _9) + return Api.InputReplyTo.inputReplyToMessage(Cons_inputReplyToMessage(flags: _1!, replyToMsgId: _2!, topMsgId: _3, replyToPeerId: _4, quoteText: _5, quoteEntities: _6, quoteOffset: _7, monoforumPeerId: _8, todoItemId: _9)) } else { return nil @@ -155,7 +230,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputReplyTo.inputReplyToMonoForum(monoforumPeerId: _1!) + return Api.InputReplyTo.inputReplyToMonoForum(Cons_inputReplyToMonoForum(monoforumPeerId: _1!)) } else { return nil @@ -171,56 +246,75 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputReplyTo.inputReplyToStory(peer: _1!, storyId: _2!) + return Api.InputReplyTo.inputReplyToStory(Cons_inputReplyToStory(peer: _1!, storyId: _2!)) } else { return nil } } - } } public extension Api { indirect enum InputSavedStarGift: TypeConstructorDescription { - case inputSavedStarGiftChat(peer: Api.InputPeer, savedId: Int64) - case inputSavedStarGiftSlug(slug: String) - case inputSavedStarGiftUser(msgId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputSavedStarGiftChat(let peer, let savedId): - if boxed { - buffer.appendInt32(-251549057) - } - peer.serialize(buffer, true) - serializeInt64(savedId, buffer: buffer, boxed: false) - break - case .inputSavedStarGiftSlug(let slug): - if boxed { - buffer.appendInt32(545636920) - } - serializeString(slug, buffer: buffer, boxed: false) - break - case .inputSavedStarGiftUser(let msgId): - if boxed { - buffer.appendInt32(1764202389) - } - serializeInt32(msgId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputSavedStarGiftChat(let peer, let savedId): - return ("inputSavedStarGiftChat", [("peer", peer as Any), ("savedId", savedId as Any)]) - case .inputSavedStarGiftSlug(let slug): - return ("inputSavedStarGiftSlug", [("slug", slug as Any)]) - case .inputSavedStarGiftUser(let msgId): - return ("inputSavedStarGiftUser", [("msgId", msgId as Any)]) - } - } - + public class Cons_inputSavedStarGiftChat { + public var peer: Api.InputPeer + public var savedId: Int64 + public init(peer: Api.InputPeer, savedId: Int64) { + self.peer = peer + self.savedId = savedId + } + } + public class Cons_inputSavedStarGiftSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + public class Cons_inputSavedStarGiftUser { + public var msgId: Int32 + public init(msgId: Int32) { + self.msgId = msgId + } + } + case inputSavedStarGiftChat(Cons_inputSavedStarGiftChat) + case inputSavedStarGiftSlug(Cons_inputSavedStarGiftSlug) + case inputSavedStarGiftUser(Cons_inputSavedStarGiftUser) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputSavedStarGiftChat(let _data): + if boxed { + buffer.appendInt32(-251549057) + } + _data.peer.serialize(buffer, true) + serializeInt64(_data.savedId, buffer: buffer, boxed: false) + break + case .inputSavedStarGiftSlug(let _data): + if boxed { + buffer.appendInt32(545636920) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + case .inputSavedStarGiftUser(let _data): + if boxed { + buffer.appendInt32(1764202389) + } + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputSavedStarGiftChat(let _data): + return ("inputSavedStarGiftChat", [("peer", _data.peer as Any), ("savedId", _data.savedId as Any)]) + case .inputSavedStarGiftSlug(let _data): + return ("inputSavedStarGiftSlug", [("slug", _data.slug as Any)]) + case .inputSavedStarGiftUser(let _data): + return ("inputSavedStarGiftUser", [("msgId", _data.msgId as Any)]) + } + } + public static func parse_inputSavedStarGiftChat(_ reader: BufferReader) -> InputSavedStarGift? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -231,7 +325,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputSavedStarGift.inputSavedStarGiftChat(peer: _1!, savedId: _2!) + return Api.InputSavedStarGift.inputSavedStarGiftChat(Cons_inputSavedStarGiftChat(peer: _1!, savedId: _2!)) } else { return nil @@ -242,7 +336,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputSavedStarGift.inputSavedStarGiftSlug(slug: _1!) + return Api.InputSavedStarGift.inputSavedStarGiftSlug(Cons_inputSavedStarGiftSlug(slug: _1!)) } else { return nil @@ -253,51 +347,72 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputSavedStarGift.inputSavedStarGiftUser(msgId: _1!) + return Api.InputSavedStarGift.inputSavedStarGiftUser(Cons_inputSavedStarGiftUser(msgId: _1!)) } else { return nil } } - } } public extension Api { enum InputSecureFile: TypeConstructorDescription { - case inputSecureFile(id: Int64, accessHash: Int64) - case inputSecureFileUploaded(id: Int64, parts: Int32, md5Checksum: String, fileHash: Buffer, secret: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputSecureFile(let id, let accessHash): - if boxed { - buffer.appendInt32(1399317950) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputSecureFileUploaded(let id, let parts, let md5Checksum, let fileHash, let secret): - if boxed { - buffer.appendInt32(859091184) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(parts, buffer: buffer, boxed: false) - serializeString(md5Checksum, buffer: buffer, boxed: false) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeBytes(secret, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputSecureFile(let id, let accessHash): - return ("inputSecureFile", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputSecureFileUploaded(let id, let parts, let md5Checksum, let fileHash, let secret): - return ("inputSecureFileUploaded", [("id", id as Any), ("parts", parts as Any), ("md5Checksum", md5Checksum as Any), ("fileHash", fileHash as Any), ("secret", secret as Any)]) - } - } - + public class Cons_inputSecureFile { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputSecureFileUploaded { + public var id: Int64 + public var parts: Int32 + public var md5Checksum: String + public var fileHash: Buffer + public var secret: Buffer + public init(id: Int64, parts: Int32, md5Checksum: String, fileHash: Buffer, secret: Buffer) { + self.id = id + self.parts = parts + self.md5Checksum = md5Checksum + self.fileHash = fileHash + self.secret = secret + } + } + case inputSecureFile(Cons_inputSecureFile) + case inputSecureFileUploaded(Cons_inputSecureFileUploaded) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputSecureFile(let _data): + if boxed { + buffer.appendInt32(1399317950) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputSecureFileUploaded(let _data): + if boxed { + buffer.appendInt32(859091184) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.parts, buffer: buffer, boxed: false) + serializeString(_data.md5Checksum, buffer: buffer, boxed: false) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeBytes(_data.secret, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputSecureFile(let _data): + return ("inputSecureFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputSecureFileUploaded(let _data): + return ("inputSecureFileUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("md5Checksum", _data.md5Checksum as Any), ("fileHash", _data.fileHash as Any), ("secret", _data.secret as Any)]) + } + } + public static func parse_inputSecureFile(_ reader: BufferReader) -> InputSecureFile? { var _1: Int64? _1 = reader.readInt64() @@ -306,7 +421,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputSecureFile.inputSecureFile(id: _1!, accessHash: _2!) + return Api.InputSecureFile.inputSecureFile(Cons_inputSecureFile(id: _1!, accessHash: _2!)) } else { return nil @@ -329,53 +444,88 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputSecureFile.inputSecureFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, fileHash: _4!, secret: _5!) + return Api.InputSecureFile.inputSecureFileUploaded(Cons_inputSecureFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, fileHash: _4!, secret: _5!)) } else { return nil } } - } } public extension Api { enum InputSecureValue: TypeConstructorDescription { - case inputSecureValue(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.InputSecureFile?, reverseSide: Api.InputSecureFile?, selfie: Api.InputSecureFile?, translation: [Api.InputSecureFile]?, files: [Api.InputSecureFile]?, plainData: Api.SecurePlainData?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputSecureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData): - if boxed { - buffer.appendInt32(-618540889) + public class Cons_inputSecureValue { + public var flags: Int32 + public var type: Api.SecureValueType + public var data: Api.SecureData? + public var frontSide: Api.InputSecureFile? + public var reverseSide: Api.InputSecureFile? + public var selfie: Api.InputSecureFile? + public var translation: [Api.InputSecureFile]? + public var files: [Api.InputSecureFile]? + public var plainData: Api.SecurePlainData? + public init(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.InputSecureFile?, reverseSide: Api.InputSecureFile?, selfie: Api.InputSecureFile?, translation: [Api.InputSecureFile]?, files: [Api.InputSecureFile]?, plainData: Api.SecurePlainData?) { + self.flags = flags + self.type = type + self.data = data + self.frontSide = frontSide + self.reverseSide = reverseSide + self.selfie = selfie + self.translation = translation + self.files = files + self.plainData = plainData + } + } + case inputSecureValue(Cons_inputSecureValue) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputSecureValue(let _data): + if boxed { + buffer.appendInt32(-618540889) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.type.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.data!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.frontSide!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.reverseSide!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.selfie!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.translation!.count)) + for item in _data.translation! { + item.serialize(buffer, true) } - serializeInt32(flags, buffer: buffer, boxed: false) - type.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {data!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {frontSide!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {reverseSide!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {selfie!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(translation!.count)) - for item in translation! { + } + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.files!.count)) + for item in _data.files! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(files!.count)) - for item in files! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 5) != 0 {plainData!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputSecureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData): - return ("inputSecureValue", [("flags", flags as Any), ("type", type as Any), ("data", data as Any), ("frontSide", frontSide as Any), ("reverseSide", reverseSide as Any), ("selfie", selfie as Any), ("translation", translation as Any), ("files", files as Any), ("plainData", plainData as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.plainData!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputSecureValue(let _data): + return ("inputSecureValue", [("flags", _data.flags as Any), ("type", _data.type as Any), ("data", _data.data as Any), ("frontSide", _data.frontSide as Any), ("reverseSide", _data.reverseSide as Any), ("selfie", _data.selfie as Any), ("translation", _data.translation as Any), ("files", _data.files as Any), ("plainData", _data.plainData as Any)]) + } + } + public static func parse_inputSecureValue(_ reader: BufferReader) -> InputSecureValue? { var _1: Int32? _1 = reader.readInt32() @@ -384,33 +534,47 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType } var _3: Api.SecureData? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.SecureData - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.SecureData + } + } var _4: Api.InputSecureFile? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputSecureFile - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputSecureFile + } + } var _5: Api.InputSecureFile? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.InputSecureFile - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.InputSecureFile + } + } var _6: Api.InputSecureFile? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InputSecureFile - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InputSecureFile + } + } var _7: [Api.InputSecureFile]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self) + } + } var _8: [Api.InputSecureFile]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self) + } + } var _9: Api.SecurePlainData? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.SecurePlainData - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.SecurePlainData + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -421,45 +585,60 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 5) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputSecureValue.inputSecureValue(flags: _1!, type: _2!, data: _3, frontSide: _4, reverseSide: _5, selfie: _6, translation: _7, files: _8, plainData: _9) + return Api.InputSecureValue.inputSecureValue(Cons_inputSecureValue(flags: _1!, type: _2!, data: _3, frontSide: _4, reverseSide: _5, selfie: _6, translation: _7, files: _8, plainData: _9)) } else { return nil } } - } } public extension Api { indirect enum InputSingleMedia: TypeConstructorDescription { - case inputSingleMedia(flags: Int32, media: Api.InputMedia, randomId: Int64, message: String, entities: [Api.MessageEntity]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputSingleMedia(let flags, let media, let randomId, let message, let entities): - if boxed { - buffer.appendInt32(482797855) - } - serializeInt32(flags, buffer: buffer, boxed: false) - media.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_inputSingleMedia { + public var flags: Int32 + public var media: Api.InputMedia + public var randomId: Int64 + public var message: String + public var entities: [Api.MessageEntity]? + public init(flags: Int32, media: Api.InputMedia, randomId: Int64, message: String, entities: [Api.MessageEntity]?) { + self.flags = flags + self.media = media + self.randomId = randomId + self.message = message + self.entities = entities + } + } + case inputSingleMedia(Cons_inputSingleMedia) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputSingleMedia(let _data): + if boxed { + buffer.appendInt32(482797855) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.media.serialize(buffer, true) + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputSingleMedia(let flags, let media, let randomId, let message, let entities): - return ("inputSingleMedia", [("flags", flags as Any), ("media", media as Any), ("randomId", randomId as Any), ("message", message as Any), ("entities", entities as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputSingleMedia(let _data): + return ("inputSingleMedia", [("flags", _data.flags as Any), ("media", _data.media as Any), ("randomId", _data.randomId as Any), ("message", _data.message as Any), ("entities", _data.entities as Any)]) + } + } + public static func parse_inputSingleMedia(_ reader: BufferReader) -> InputSingleMedia? { var _1: Int32? _1 = reader.readInt32() @@ -472,61 +651,74 @@ public extension Api { var _4: String? _4 = parseString(reader) var _5: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputSingleMedia.inputSingleMedia(flags: _1!, media: _2!, randomId: _3!, message: _4!, entities: _5) + return Api.InputSingleMedia.inputSingleMedia(Cons_inputSingleMedia(flags: _1!, media: _2!, randomId: _3!, message: _4!, entities: _5)) } else { return nil } } - } } public extension Api { enum InputStarGiftAuction: TypeConstructorDescription { - case inputStarGiftAuction(giftId: Int64) - case inputStarGiftAuctionSlug(slug: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStarGiftAuction(let giftId): - if boxed { - buffer.appendInt32(48327832) - } - serializeInt64(giftId, buffer: buffer, boxed: false) - break - case .inputStarGiftAuctionSlug(let slug): - if boxed { - buffer.appendInt32(2058715912) - } - serializeString(slug, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStarGiftAuction(let giftId): - return ("inputStarGiftAuction", [("giftId", giftId as Any)]) - case .inputStarGiftAuctionSlug(let slug): - return ("inputStarGiftAuctionSlug", [("slug", slug as Any)]) - } - } - + public class Cons_inputStarGiftAuction { + public var giftId: Int64 + public init(giftId: Int64) { + self.giftId = giftId + } + } + public class Cons_inputStarGiftAuctionSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + case inputStarGiftAuction(Cons_inputStarGiftAuction) + case inputStarGiftAuctionSlug(Cons_inputStarGiftAuctionSlug) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStarGiftAuction(let _data): + if boxed { + buffer.appendInt32(48327832) + } + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + break + case .inputStarGiftAuctionSlug(let _data): + if boxed { + buffer.appendInt32(2058715912) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStarGiftAuction(let _data): + return ("inputStarGiftAuction", [("giftId", _data.giftId as Any)]) + case .inputStarGiftAuctionSlug(let _data): + return ("inputStarGiftAuctionSlug", [("slug", _data.slug as Any)]) + } + } + public static func parse_inputStarGiftAuction(_ reader: BufferReader) -> InputStarGiftAuction? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.InputStarGiftAuction.inputStarGiftAuction(giftId: _1!) + return Api.InputStarGiftAuction.inputStarGiftAuction(Cons_inputStarGiftAuction(giftId: _1!)) } else { return nil @@ -537,38 +729,45 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputStarGiftAuction.inputStarGiftAuctionSlug(slug: _1!) + return Api.InputStarGiftAuction.inputStarGiftAuctionSlug(Cons_inputStarGiftAuctionSlug(slug: _1!)) } else { return nil } } - } } public extension Api { enum InputStarsTransaction: TypeConstructorDescription { - case inputStarsTransaction(flags: Int32, id: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStarsTransaction(let flags, let id): - if boxed { - buffer.appendInt32(543876817) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStarsTransaction(let flags, let id): - return ("inputStarsTransaction", [("flags", flags as Any), ("id", id as Any)]) - } - } - + public class Cons_inputStarsTransaction { + public var flags: Int32 + public var id: String + public init(flags: Int32, id: String) { + self.flags = flags + self.id = id + } + } + case inputStarsTransaction(Cons_inputStarsTransaction) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStarsTransaction(let _data): + if boxed { + buffer.appendInt32(543876817) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStarsTransaction(let _data): + return ("inputStarsTransaction", [("flags", _data.flags as Any), ("id", _data.id as Any)]) + } + } + public static func parse_inputStarsTransaction(_ reader: BufferReader) -> InputStarsTransaction? { var _1: Int32? _1 = reader.readInt32() @@ -577,137 +776,147 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputStarsTransaction.inputStarsTransaction(flags: _1!, id: _2!) + return Api.InputStarsTransaction.inputStarsTransaction(Cons_inputStarsTransaction(flags: _1!, id: _2!)) } else { return nil } } - } } public extension Api { enum InputStickerSet: TypeConstructorDescription { + public class Cons_inputStickerSetDice { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + public class Cons_inputStickerSetID { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputStickerSetShortName { + public var shortName: String + public init(shortName: String) { + self.shortName = shortName + } + } case inputStickerSetAnimatedEmoji case inputStickerSetAnimatedEmojiAnimations - case inputStickerSetDice(emoticon: String) + case inputStickerSetDice(Cons_inputStickerSetDice) case inputStickerSetEmojiChannelDefaultStatuses case inputStickerSetEmojiDefaultStatuses case inputStickerSetEmojiDefaultTopicIcons case inputStickerSetEmojiGenericAnimations case inputStickerSetEmpty - case inputStickerSetID(id: Int64, accessHash: Int64) + case inputStickerSetID(Cons_inputStickerSetID) case inputStickerSetPremiumGifts - case inputStickerSetShortName(shortName: String) + case inputStickerSetShortName(Cons_inputStickerSetShortName) case inputStickerSetTonGifts - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStickerSetAnimatedEmoji: - if boxed { - buffer.appendInt32(42402760) - } - - break - case .inputStickerSetAnimatedEmojiAnimations: - if boxed { - buffer.appendInt32(215889721) - } - - break - case .inputStickerSetDice(let emoticon): - if boxed { - buffer.appendInt32(-427863538) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .inputStickerSetEmojiChannelDefaultStatuses: - if boxed { - buffer.appendInt32(1232373075) - } - - break - case .inputStickerSetEmojiDefaultStatuses: - if boxed { - buffer.appendInt32(701560302) - } - - break - case .inputStickerSetEmojiDefaultTopicIcons: - if boxed { - buffer.appendInt32(1153562857) - } - - break - case .inputStickerSetEmojiGenericAnimations: - if boxed { - buffer.appendInt32(80008398) - } - - break - case .inputStickerSetEmpty: - if boxed { - buffer.appendInt32(-4838507) - } - - break - case .inputStickerSetID(let id, let accessHash): - if boxed { - buffer.appendInt32(-1645763991) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputStickerSetPremiumGifts: - if boxed { - buffer.appendInt32(-930399486) - } - - break - case .inputStickerSetShortName(let shortName): - if boxed { - buffer.appendInt32(-2044933984) - } - serializeString(shortName, buffer: buffer, boxed: false) - break - case .inputStickerSetTonGifts: - if boxed { - buffer.appendInt32(485912992) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStickerSetAnimatedEmoji: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStickerSetAnimatedEmoji: + if boxed { + buffer.appendInt32(42402760) + } + break + case .inputStickerSetAnimatedEmojiAnimations: + if boxed { + buffer.appendInt32(215889721) + } + break + case .inputStickerSetDice(let _data): + if boxed { + buffer.appendInt32(-427863538) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .inputStickerSetEmojiChannelDefaultStatuses: + if boxed { + buffer.appendInt32(1232373075) + } + break + case .inputStickerSetEmojiDefaultStatuses: + if boxed { + buffer.appendInt32(701560302) + } + break + case .inputStickerSetEmojiDefaultTopicIcons: + if boxed { + buffer.appendInt32(1153562857) + } + break + case .inputStickerSetEmojiGenericAnimations: + if boxed { + buffer.appendInt32(80008398) + } + break + case .inputStickerSetEmpty: + if boxed { + buffer.appendInt32(-4838507) + } + break + case .inputStickerSetID(let _data): + if boxed { + buffer.appendInt32(-1645763991) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputStickerSetPremiumGifts: + if boxed { + buffer.appendInt32(-930399486) + } + break + case .inputStickerSetShortName(let _data): + if boxed { + buffer.appendInt32(-2044933984) + } + serializeString(_data.shortName, buffer: buffer, boxed: false) + break + case .inputStickerSetTonGifts: + if boxed { + buffer.appendInt32(485912992) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStickerSetAnimatedEmoji: return ("inputStickerSetAnimatedEmoji", []) - case .inputStickerSetAnimatedEmojiAnimations: + case .inputStickerSetAnimatedEmojiAnimations: return ("inputStickerSetAnimatedEmojiAnimations", []) - case .inputStickerSetDice(let emoticon): - return ("inputStickerSetDice", [("emoticon", emoticon as Any)]) - case .inputStickerSetEmojiChannelDefaultStatuses: + case .inputStickerSetDice(let _data): + return ("inputStickerSetDice", [("emoticon", _data.emoticon as Any)]) + case .inputStickerSetEmojiChannelDefaultStatuses: return ("inputStickerSetEmojiChannelDefaultStatuses", []) - case .inputStickerSetEmojiDefaultStatuses: + case .inputStickerSetEmojiDefaultStatuses: return ("inputStickerSetEmojiDefaultStatuses", []) - case .inputStickerSetEmojiDefaultTopicIcons: + case .inputStickerSetEmojiDefaultTopicIcons: return ("inputStickerSetEmojiDefaultTopicIcons", []) - case .inputStickerSetEmojiGenericAnimations: + case .inputStickerSetEmojiGenericAnimations: return ("inputStickerSetEmojiGenericAnimations", []) - case .inputStickerSetEmpty: + case .inputStickerSetEmpty: return ("inputStickerSetEmpty", []) - case .inputStickerSetID(let id, let accessHash): - return ("inputStickerSetID", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputStickerSetPremiumGifts: + case .inputStickerSetID(let _data): + return ("inputStickerSetID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputStickerSetPremiumGifts: return ("inputStickerSetPremiumGifts", []) - case .inputStickerSetShortName(let shortName): - return ("inputStickerSetShortName", [("shortName", shortName as Any)]) - case .inputStickerSetTonGifts: + case .inputStickerSetShortName(let _data): + return ("inputStickerSetShortName", [("shortName", _data.shortName as Any)]) + case .inputStickerSetTonGifts: return ("inputStickerSetTonGifts", []) - } - } - + } + } + public static func parse_inputStickerSetAnimatedEmoji(_ reader: BufferReader) -> InputStickerSet? { return Api.InputStickerSet.inputStickerSetAnimatedEmoji } @@ -719,7 +928,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputStickerSet.inputStickerSetDice(emoticon: _1!) + return Api.InputStickerSet.inputStickerSetDice(Cons_inputStickerSetDice(emoticon: _1!)) } else { return nil @@ -748,7 +957,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputStickerSet.inputStickerSetID(id: _1!, accessHash: _2!) + return Api.InputStickerSet.inputStickerSetID(Cons_inputStickerSetID(id: _1!, accessHash: _2!)) } else { return nil @@ -762,7 +971,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputStickerSet.inputStickerSetShortName(shortName: _1!) + return Api.InputStickerSet.inputStickerSetShortName(Cons_inputStickerSetShortName(shortName: _1!)) } else { return nil @@ -771,35 +980,52 @@ public extension Api { public static func parse_inputStickerSetTonGifts(_ reader: BufferReader) -> InputStickerSet? { return Api.InputStickerSet.inputStickerSetTonGifts } - } } public extension Api { enum InputStickerSetItem: TypeConstructorDescription { - case inputStickerSetItem(flags: Int32, document: Api.InputDocument, emoji: String, maskCoords: Api.MaskCoords?, keywords: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStickerSetItem(let flags, let document, let emoji, let maskCoords, let keywords): - if boxed { - buffer.appendInt32(853188252) - } - serializeInt32(flags, buffer: buffer, boxed: false) - document.serialize(buffer, true) - serializeString(emoji, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {maskCoords!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(keywords!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStickerSetItem(let flags, let document, let emoji, let maskCoords, let keywords): - return ("inputStickerSetItem", [("flags", flags as Any), ("document", document as Any), ("emoji", emoji as Any), ("maskCoords", maskCoords as Any), ("keywords", keywords as Any)]) - } - } - + public class Cons_inputStickerSetItem { + public var flags: Int32 + public var document: Api.InputDocument + public var emoji: String + public var maskCoords: Api.MaskCoords? + public var keywords: String? + public init(flags: Int32, document: Api.InputDocument, emoji: String, maskCoords: Api.MaskCoords?, keywords: String?) { + self.flags = flags + self.document = document + self.emoji = emoji + self.maskCoords = maskCoords + self.keywords = keywords + } + } + case inputStickerSetItem(Cons_inputStickerSetItem) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStickerSetItem(let _data): + if boxed { + buffer.appendInt32(853188252) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.document.serialize(buffer, true) + serializeString(_data.emoji, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.maskCoords!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.keywords!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStickerSetItem(let _data): + return ("inputStickerSetItem", [("flags", _data.flags as Any), ("document", _data.document as Any), ("emoji", _data.emoji as Any), ("maskCoords", _data.maskCoords as Any), ("keywords", _data.keywords as Any)]) + } + } + public static func parse_inputStickerSetItem(_ reader: BufferReader) -> InputStickerSetItem? { var _1: Int32? _1 = reader.readInt32() @@ -810,57 +1036,72 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.MaskCoords? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords + } + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputStickerSetItem.inputStickerSetItem(flags: _1!, document: _2!, emoji: _3!, maskCoords: _4, keywords: _5) + return Api.InputStickerSetItem.inputStickerSetItem(Cons_inputStickerSetItem(flags: _1!, document: _2!, emoji: _3!, maskCoords: _4, keywords: _5)) } else { return nil } } - } } public extension Api { enum InputStickeredMedia: TypeConstructorDescription { - case inputStickeredMediaDocument(id: Api.InputDocument) - case inputStickeredMediaPhoto(id: Api.InputPhoto) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStickeredMediaDocument(let id): - if boxed { - buffer.appendInt32(70813275) - } - id.serialize(buffer, true) - break - case .inputStickeredMediaPhoto(let id): - if boxed { - buffer.appendInt32(1251549527) - } - id.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStickeredMediaDocument(let id): - return ("inputStickeredMediaDocument", [("id", id as Any)]) - case .inputStickeredMediaPhoto(let id): - return ("inputStickeredMediaPhoto", [("id", id as Any)]) - } - } - + public class Cons_inputStickeredMediaDocument { + public var id: Api.InputDocument + public init(id: Api.InputDocument) { + self.id = id + } + } + public class Cons_inputStickeredMediaPhoto { + public var id: Api.InputPhoto + public init(id: Api.InputPhoto) { + self.id = id + } + } + case inputStickeredMediaDocument(Cons_inputStickeredMediaDocument) + case inputStickeredMediaPhoto(Cons_inputStickeredMediaPhoto) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStickeredMediaDocument(let _data): + if boxed { + buffer.appendInt32(70813275) + } + _data.id.serialize(buffer, true) + break + case .inputStickeredMediaPhoto(let _data): + if boxed { + buffer.appendInt32(1251549527) + } + _data.id.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStickeredMediaDocument(let _data): + return ("inputStickeredMediaDocument", [("id", _data.id as Any)]) + case .inputStickeredMediaPhoto(let _data): + return ("inputStickeredMediaPhoto", [("id", _data.id as Any)]) + } + } + public static func parse_inputStickeredMediaDocument(_ reader: BufferReader) -> InputStickeredMedia? { var _1: Api.InputDocument? if let signature = reader.readInt32() { @@ -868,7 +1109,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputStickeredMedia.inputStickeredMediaDocument(id: _1!) + return Api.InputStickeredMedia.inputStickeredMediaDocument(Cons_inputStickeredMediaDocument(id: _1!)) } else { return nil @@ -881,156 +1122,293 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputStickeredMedia.inputStickeredMediaPhoto(id: _1!) + return Api.InputStickeredMedia.inputStickeredMediaPhoto(Cons_inputStickeredMediaPhoto(id: _1!)) } else { return nil } } - } } public extension Api { indirect enum InputStorePaymentPurpose: TypeConstructorDescription { - case inputStorePaymentAuthCode(flags: Int32, phoneNumber: String, phoneCodeHash: String, currency: String, amount: Int64) - case inputStorePaymentGiftPremium(userId: Api.InputUser, currency: String, amount: Int64) - case inputStorePaymentPremiumGiftCode(flags: Int32, users: [Api.InputUser], boostPeer: Api.InputPeer?, currency: String, amount: Int64, message: Api.TextWithEntities?) - case inputStorePaymentPremiumGiveaway(flags: Int32, boostPeer: Api.InputPeer, additionalPeers: [Api.InputPeer]?, countriesIso2: [String]?, prizeDescription: String?, randomId: Int64, untilDate: Int32, currency: String, amount: Int64) - case inputStorePaymentPremiumSubscription(flags: Int32) - case inputStorePaymentStarsGift(userId: Api.InputUser, stars: Int64, currency: String, amount: Int64) - case inputStorePaymentStarsGiveaway(flags: Int32, stars: Int64, boostPeer: Api.InputPeer, additionalPeers: [Api.InputPeer]?, countriesIso2: [String]?, prizeDescription: String?, randomId: Int64, untilDate: Int32, currency: String, amount: Int64, users: Int32) - case inputStorePaymentStarsTopup(flags: Int32, stars: Int64, currency: String, amount: Int64, spendPurposePeer: Api.InputPeer?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputStorePaymentAuthCode(let flags, let phoneNumber, let phoneCodeHash, let currency, let amount): - if boxed { - buffer.appendInt32(-1682807955) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - case .inputStorePaymentGiftPremium(let userId, let currency, let amount): - if boxed { - buffer.appendInt32(1634697192) - } - userId.serialize(buffer, true) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - case .inputStorePaymentPremiumGiftCode(let flags, let users, let boostPeer, let currency, let amount, let message): - if boxed { - buffer.appendInt32(-75955309) - } - serializeInt32(flags, buffer: buffer, boxed: false) + public class Cons_inputStorePaymentAuthCode { + public var flags: Int32 + public var phoneNumber: String + public var phoneCodeHash: String + public var currency: String + public var amount: Int64 + public init(flags: Int32, phoneNumber: String, phoneCodeHash: String, currency: String, amount: Int64) { + self.flags = flags + self.phoneNumber = phoneNumber + self.phoneCodeHash = phoneCodeHash + self.currency = currency + self.amount = amount + } + } + public class Cons_inputStorePaymentGiftPremium { + public var userId: Api.InputUser + public var currency: String + public var amount: Int64 + public init(userId: Api.InputUser, currency: String, amount: Int64) { + self.userId = userId + self.currency = currency + self.amount = amount + } + } + public class Cons_inputStorePaymentPremiumGiftCode { + public var flags: Int32 + public var users: [Api.InputUser] + public var boostPeer: Api.InputPeer? + public var currency: String + public var amount: Int64 + public var message: Api.TextWithEntities? + public init(flags: Int32, users: [Api.InputUser], boostPeer: Api.InputPeer?, currency: String, amount: Int64, message: Api.TextWithEntities?) { + self.flags = flags + self.users = users + self.boostPeer = boostPeer + self.currency = currency + self.amount = amount + self.message = message + } + } + public class Cons_inputStorePaymentPremiumGiveaway { + public var flags: Int32 + public var boostPeer: Api.InputPeer + public var additionalPeers: [Api.InputPeer]? + public var countriesIso2: [String]? + public var prizeDescription: String? + public var randomId: Int64 + public var untilDate: Int32 + public var currency: String + public var amount: Int64 + public init(flags: Int32, boostPeer: Api.InputPeer, additionalPeers: [Api.InputPeer]?, countriesIso2: [String]?, prizeDescription: String?, randomId: Int64, untilDate: Int32, currency: String, amount: Int64) { + self.flags = flags + self.boostPeer = boostPeer + self.additionalPeers = additionalPeers + self.countriesIso2 = countriesIso2 + self.prizeDescription = prizeDescription + self.randomId = randomId + self.untilDate = untilDate + self.currency = currency + self.amount = amount + } + } + public class Cons_inputStorePaymentPremiumSubscription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_inputStorePaymentStarsGift { + public var userId: Api.InputUser + public var stars: Int64 + public var currency: String + public var amount: Int64 + public init(userId: Api.InputUser, stars: Int64, currency: String, amount: Int64) { + self.userId = userId + self.stars = stars + self.currency = currency + self.amount = amount + } + } + public class Cons_inputStorePaymentStarsGiveaway { + public var flags: Int32 + public var stars: Int64 + public var boostPeer: Api.InputPeer + public var additionalPeers: [Api.InputPeer]? + public var countriesIso2: [String]? + public var prizeDescription: String? + public var randomId: Int64 + public var untilDate: Int32 + public var currency: String + public var amount: Int64 + public var users: Int32 + public init(flags: Int32, stars: Int64, boostPeer: Api.InputPeer, additionalPeers: [Api.InputPeer]?, countriesIso2: [String]?, prizeDescription: String?, randomId: Int64, untilDate: Int32, currency: String, amount: Int64, users: Int32) { + self.flags = flags + self.stars = stars + self.boostPeer = boostPeer + self.additionalPeers = additionalPeers + self.countriesIso2 = countriesIso2 + self.prizeDescription = prizeDescription + self.randomId = randomId + self.untilDate = untilDate + self.currency = currency + self.amount = amount + self.users = users + } + } + public class Cons_inputStorePaymentStarsTopup { + public var flags: Int32 + public var stars: Int64 + public var currency: String + public var amount: Int64 + public var spendPurposePeer: Api.InputPeer? + public init(flags: Int32, stars: Int64, currency: String, amount: Int64, spendPurposePeer: Api.InputPeer?) { + self.flags = flags + self.stars = stars + self.currency = currency + self.amount = amount + self.spendPurposePeer = spendPurposePeer + } + } + case inputStorePaymentAuthCode(Cons_inputStorePaymentAuthCode) + case inputStorePaymentGiftPremium(Cons_inputStorePaymentGiftPremium) + case inputStorePaymentPremiumGiftCode(Cons_inputStorePaymentPremiumGiftCode) + case inputStorePaymentPremiumGiveaway(Cons_inputStorePaymentPremiumGiveaway) + case inputStorePaymentPremiumSubscription(Cons_inputStorePaymentPremiumSubscription) + case inputStorePaymentStarsGift(Cons_inputStorePaymentStarsGift) + case inputStorePaymentStarsGiveaway(Cons_inputStorePaymentStarsGiveaway) + case inputStorePaymentStarsTopup(Cons_inputStorePaymentStarsTopup) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputStorePaymentAuthCode(let _data): + if boxed { + buffer.appendInt32(-1682807955) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + case .inputStorePaymentGiftPremium(let _data): + if boxed { + buffer.appendInt32(1634697192) + } + _data.userId.serialize(buffer, true) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + case .inputStorePaymentPremiumGiftCode(let _data): + if boxed { + buffer.appendInt32(-75955309) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.boostPeer!.serialize(buffer, true) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .inputStorePaymentPremiumGiveaway(let _data): + if boxed { + buffer.appendInt32(369444042) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.boostPeer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { + buffer.appendInt32(Int32(_data.additionalPeers!.count)) + for item in _data.additionalPeers! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 0) != 0 {boostPeer!.serialize(buffer, true)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - break - case .inputStorePaymentPremiumGiveaway(let flags, let boostPeer, let additionalPeers, let countriesIso2, let prizeDescription, let randomId, let untilDate, let currency, let amount): - if boxed { - buffer.appendInt32(369444042) - } - serializeInt32(flags, buffer: buffer, boxed: false) - boostPeer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(additionalPeers!.count)) - for item in additionalPeers! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(countriesIso2!.count)) - for item in countriesIso2! { + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countriesIso2!.count)) + for item in _data.countriesIso2! { serializeString(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeString(prizeDescription!, buffer: buffer, boxed: false)} - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeInt32(untilDate, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - case .inputStorePaymentPremiumSubscription(let flags): - if boxed { - buffer.appendInt32(-1502273946) } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .inputStorePaymentStarsGift(let userId, let stars, let currency, let amount): - if boxed { - buffer.appendInt32(494149367) - } - userId.serialize(buffer, true) - serializeInt64(stars, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - case .inputStorePaymentStarsGiveaway(let flags, let stars, let boostPeer, let additionalPeers, let countriesIso2, let prizeDescription, let randomId, let untilDate, let currency, let amount, let users): - if boxed { - buffer.appendInt32(1964968186) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - boostPeer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(additionalPeers!.count)) - for item in additionalPeers! { + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.prizeDescription!, buffer: buffer, boxed: false) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + case .inputStorePaymentPremiumSubscription(let _data): + if boxed { + buffer.appendInt32(-1502273946) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .inputStorePaymentStarsGift(let _data): + if boxed { + buffer.appendInt32(494149367) + } + _data.userId.serialize(buffer, true) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + case .inputStorePaymentStarsGiveaway(let _data): + if boxed { + buffer.appendInt32(1964968186) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + _data.boostPeer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.additionalPeers!.count)) + for item in _data.additionalPeers! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(countriesIso2!.count)) - for item in countriesIso2! { - serializeString(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeString(prizeDescription!, buffer: buffer, boxed: false)} - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeInt32(untilDate, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeInt32(users, buffer: buffer, boxed: false) - break - case .inputStorePaymentStarsTopup(let flags, let stars, let currency, let amount, let spendPurposePeer): - if boxed { - buffer.appendInt32(-106780981) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {spendPurposePeer!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputStorePaymentAuthCode(let flags, let phoneNumber, let phoneCodeHash, let currency, let amount): - return ("inputStorePaymentAuthCode", [("flags", flags as Any), ("phoneNumber", phoneNumber as Any), ("phoneCodeHash", phoneCodeHash as Any), ("currency", currency as Any), ("amount", amount as Any)]) - case .inputStorePaymentGiftPremium(let userId, let currency, let amount): - return ("inputStorePaymentGiftPremium", [("userId", userId as Any), ("currency", currency as Any), ("amount", amount as Any)]) - case .inputStorePaymentPremiumGiftCode(let flags, let users, let boostPeer, let currency, let amount, let message): - return ("inputStorePaymentPremiumGiftCode", [("flags", flags as Any), ("users", users as Any), ("boostPeer", boostPeer as Any), ("currency", currency as Any), ("amount", amount as Any), ("message", message as Any)]) - case .inputStorePaymentPremiumGiveaway(let flags, let boostPeer, let additionalPeers, let countriesIso2, let prizeDescription, let randomId, let untilDate, let currency, let amount): - return ("inputStorePaymentPremiumGiveaway", [("flags", flags as Any), ("boostPeer", boostPeer as Any), ("additionalPeers", additionalPeers as Any), ("countriesIso2", countriesIso2 as Any), ("prizeDescription", prizeDescription as Any), ("randomId", randomId as Any), ("untilDate", untilDate as Any), ("currency", currency as Any), ("amount", amount as Any)]) - case .inputStorePaymentPremiumSubscription(let flags): - return ("inputStorePaymentPremiumSubscription", [("flags", flags as Any)]) - case .inputStorePaymentStarsGift(let userId, let stars, let currency, let amount): - return ("inputStorePaymentStarsGift", [("userId", userId as Any), ("stars", stars as Any), ("currency", currency as Any), ("amount", amount as Any)]) - case .inputStorePaymentStarsGiveaway(let flags, let stars, let boostPeer, let additionalPeers, let countriesIso2, let prizeDescription, let randomId, let untilDate, let currency, let amount, let users): - return ("inputStorePaymentStarsGiveaway", [("flags", flags as Any), ("stars", stars as Any), ("boostPeer", boostPeer as Any), ("additionalPeers", additionalPeers as Any), ("countriesIso2", countriesIso2 as Any), ("prizeDescription", prizeDescription as Any), ("randomId", randomId as Any), ("untilDate", untilDate as Any), ("currency", currency as Any), ("amount", amount as Any), ("users", users as Any)]) - case .inputStorePaymentStarsTopup(let flags, let stars, let currency, let amount, let spendPurposePeer): - return ("inputStorePaymentStarsTopup", [("flags", flags as Any), ("stars", stars as Any), ("currency", currency as Any), ("amount", amount as Any), ("spendPurposePeer", spendPurposePeer as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countriesIso2!.count)) + for item in _data.countriesIso2! { + serializeString(item, buffer: buffer, boxed: false) + } + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.prizeDescription!, buffer: buffer, boxed: false) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeInt32(_data.users, buffer: buffer, boxed: false) + break + case .inputStorePaymentStarsTopup(let _data): + if boxed { + buffer.appendInt32(-106780981) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.spendPurposePeer!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputStorePaymentAuthCode(let _data): + return ("inputStorePaymentAuthCode", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + case .inputStorePaymentGiftPremium(let _data): + return ("inputStorePaymentGiftPremium", [("userId", _data.userId as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + case .inputStorePaymentPremiumGiftCode(let _data): + return ("inputStorePaymentPremiumGiftCode", [("flags", _data.flags as Any), ("users", _data.users as Any), ("boostPeer", _data.boostPeer as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("message", _data.message as Any)]) + case .inputStorePaymentPremiumGiveaway(let _data): + return ("inputStorePaymentPremiumGiveaway", [("flags", _data.flags as Any), ("boostPeer", _data.boostPeer as Any), ("additionalPeers", _data.additionalPeers as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("randomId", _data.randomId as Any), ("untilDate", _data.untilDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + case .inputStorePaymentPremiumSubscription(let _data): + return ("inputStorePaymentPremiumSubscription", [("flags", _data.flags as Any)]) + case .inputStorePaymentStarsGift(let _data): + return ("inputStorePaymentStarsGift", [("userId", _data.userId as Any), ("stars", _data.stars as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + case .inputStorePaymentStarsGiveaway(let _data): + return ("inputStorePaymentStarsGiveaway", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("boostPeer", _data.boostPeer as Any), ("additionalPeers", _data.additionalPeers as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("randomId", _data.randomId as Any), ("untilDate", _data.untilDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("users", _data.users as Any)]) + case .inputStorePaymentStarsTopup(let _data): + return ("inputStorePaymentStarsTopup", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("spendPurposePeer", _data.spendPurposePeer as Any)]) + } + } + public static func parse_inputStorePaymentAuthCode(_ reader: BufferReader) -> InputStorePaymentPurpose? { var _1: Int32? _1 = reader.readInt32() @@ -1048,7 +1426,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputStorePaymentPurpose.inputStorePaymentAuthCode(flags: _1!, phoneNumber: _2!, phoneCodeHash: _3!, currency: _4!, amount: _5!) + return Api.InputStorePaymentPurpose.inputStorePaymentAuthCode(Cons_inputStorePaymentAuthCode(flags: _1!, phoneNumber: _2!, phoneCodeHash: _3!, currency: _4!, amount: _5!)) } else { return nil @@ -1067,7 +1445,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!) + return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(Cons_inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!)) } else { return nil @@ -1081,17 +1459,21 @@ public extension Api { _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) } var _3: Api.InputPeer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputPeer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + } var _4: String? _4 = parseString(reader) var _5: Int64? _5 = reader.readInt64() var _6: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -1099,7 +1481,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiftCode(flags: _1!, users: _2!, boostPeer: _3, currency: _4!, amount: _5!, message: _6) + return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiftCode(Cons_inputStorePaymentPremiumGiftCode(flags: _1!, users: _2!, boostPeer: _3, currency: _4!, amount: _5!, message: _6)) } else { return nil @@ -1113,15 +1495,21 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputPeer } var _3: [Api.InputPeer]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) + } + } var _4: [String]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } var _5: String? - if Int(_1!) & Int(1 << 4) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = parseString(reader) + } var _6: Int64? _6 = reader.readInt64() var _7: Int32? @@ -1140,7 +1528,7 @@ public extension Api { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiveaway(flags: _1!, boostPeer: _2!, additionalPeers: _3, countriesIso2: _4, prizeDescription: _5, randomId: _6!, untilDate: _7!, currency: _8!, amount: _9!) + return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiveaway(Cons_inputStorePaymentPremiumGiveaway(flags: _1!, boostPeer: _2!, additionalPeers: _3, countriesIso2: _4, prizeDescription: _5, randomId: _6!, untilDate: _7!, currency: _8!, amount: _9!)) } else { return nil @@ -1151,7 +1539,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputStorePaymentPurpose.inputStorePaymentPremiumSubscription(flags: _1!) + return Api.InputStorePaymentPurpose.inputStorePaymentPremiumSubscription(Cons_inputStorePaymentPremiumSubscription(flags: _1!)) } else { return nil @@ -1173,7 +1561,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputStorePaymentPurpose.inputStorePaymentStarsGift(userId: _1!, stars: _2!, currency: _3!, amount: _4!) + return Api.InputStorePaymentPurpose.inputStorePaymentStarsGift(Cons_inputStorePaymentStarsGift(userId: _1!, stars: _2!, currency: _3!, amount: _4!)) } else { return nil @@ -1189,15 +1577,21 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.InputPeer } var _4: [Api.InputPeer]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) + } + } var _5: [String]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } var _6: String? - if Int(_1!) & Int(1 << 4) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = parseString(reader) + } var _7: Int64? _7 = reader.readInt64() var _8: Int32? @@ -1220,7 +1614,7 @@ public extension Api { let _c10 = _10 != nil let _c11 = _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.InputStorePaymentPurpose.inputStorePaymentStarsGiveaway(flags: _1!, stars: _2!, boostPeer: _3!, additionalPeers: _4, countriesIso2: _5, prizeDescription: _6, randomId: _7!, untilDate: _8!, currency: _9!, amount: _10!, users: _11!) + return Api.InputStorePaymentPurpose.inputStorePaymentStarsGiveaway(Cons_inputStorePaymentStarsGiveaway(flags: _1!, stars: _2!, boostPeer: _3!, additionalPeers: _4, countriesIso2: _5, prizeDescription: _6, randomId: _7!, untilDate: _8!, currency: _9!, amount: _10!, users: _11!)) } else { return nil @@ -1236,21 +1630,22 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Api.InputPeer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.InputPeer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputStorePaymentPurpose.inputStorePaymentStarsTopup(flags: _1!, stars: _2!, currency: _3!, amount: _4!, spendPurposePeer: _5) + return Api.InputStorePaymentPurpose.inputStorePaymentStarsTopup(Cons_inputStorePaymentStarsTopup(flags: _1!, stars: _2!, currency: _3!, amount: _4!, spendPurposePeer: _5)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api14.swift b/submodules/TelegramApi/Sources/Api14.swift index 5f436a0687..f69f3880bf 100644 --- a/submodules/TelegramApi/Sources/Api14.swift +++ b/submodules/TelegramApi/Sources/Api14.swift @@ -1,35 +1,49 @@ public extension Api { enum InputTheme: TypeConstructorDescription { - case inputTheme(id: Int64, accessHash: Int64) - case inputThemeSlug(slug: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputTheme(let id, let accessHash): - if boxed { - buffer.appendInt32(1012306921) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputThemeSlug(let slug): - if boxed { - buffer.appendInt32(-175567375) - } - serializeString(slug, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputTheme(let id, let accessHash): - return ("inputTheme", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputThemeSlug(let slug): - return ("inputThemeSlug", [("slug", slug as Any)]) - } - } - + public class Cons_inputTheme { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputThemeSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + case inputTheme(Cons_inputTheme) + case inputThemeSlug(Cons_inputThemeSlug) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputTheme(let _data): + if boxed { + buffer.appendInt32(1012306921) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputThemeSlug(let _data): + if boxed { + buffer.appendInt32(-175567375) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputTheme(let _data): + return ("inputTheme", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputThemeSlug(let _data): + return ("inputThemeSlug", [("slug", _data.slug as Any)]) + } + } + public static func parse_inputTheme(_ reader: BufferReader) -> InputTheme? { var _1: Int64? _1 = reader.readInt64() @@ -38,7 +52,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputTheme.inputTheme(id: _1!, accessHash: _2!) + return Api.InputTheme.inputTheme(Cons_inputTheme(id: _1!, accessHash: _2!)) } else { return nil @@ -49,47 +63,72 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputTheme.inputThemeSlug(slug: _1!) + return Api.InputTheme.inputThemeSlug(Cons_inputThemeSlug(slug: _1!)) } else { return nil } } - } } public extension Api { enum InputThemeSettings: TypeConstructorDescription { - case inputThemeSettings(flags: Int32, baseTheme: Api.BaseTheme, accentColor: Int32, outboxAccentColor: Int32?, messageColors: [Int32]?, wallpaper: Api.InputWallPaper?, wallpaperSettings: Api.WallPaperSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputThemeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper, let wallpaperSettings): - if boxed { - buffer.appendInt32(-1881255857) - } - serializeInt32(flags, buffer: buffer, boxed: false) - baseTheme.serialize(buffer, true) - serializeInt32(accentColor, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(outboxAccentColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messageColors!.count)) - for item in messageColors! { + public class Cons_inputThemeSettings { + public var flags: Int32 + public var baseTheme: Api.BaseTheme + public var accentColor: Int32 + public var outboxAccentColor: Int32? + public var messageColors: [Int32]? + public var wallpaper: Api.InputWallPaper? + public var wallpaperSettings: Api.WallPaperSettings? + public init(flags: Int32, baseTheme: Api.BaseTheme, accentColor: Int32, outboxAccentColor: Int32?, messageColors: [Int32]?, wallpaper: Api.InputWallPaper?, wallpaperSettings: Api.WallPaperSettings?) { + self.flags = flags + self.baseTheme = baseTheme + self.accentColor = accentColor + self.outboxAccentColor = outboxAccentColor + self.messageColors = messageColors + self.wallpaper = wallpaper + self.wallpaperSettings = wallpaperSettings + } + } + case inputThemeSettings(Cons_inputThemeSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputThemeSettings(let _data): + if boxed { + buffer.appendInt32(-1881255857) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.baseTheme.serialize(buffer, true) + serializeInt32(_data.accentColor, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.outboxAccentColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messageColors!.count)) + for item in _data.messageColors! { serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 1) != 0 {wallpaper!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {wallpaperSettings!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputThemeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper, let wallpaperSettings): - return ("inputThemeSettings", [("flags", flags as Any), ("baseTheme", baseTheme as Any), ("accentColor", accentColor as Any), ("outboxAccentColor", outboxAccentColor as Any), ("messageColors", messageColors as Any), ("wallpaper", wallpaper as Any), ("wallpaperSettings", wallpaperSettings as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.wallpaperSettings!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputThemeSettings(let _data): + return ("inputThemeSettings", [("flags", _data.flags as Any), ("baseTheme", _data.baseTheme as Any), ("accentColor", _data.accentColor as Any), ("outboxAccentColor", _data.outboxAccentColor as Any), ("messageColors", _data.messageColors as Any), ("wallpaper", _data.wallpaper as Any), ("wallpaperSettings", _data.wallpaperSettings as Any)]) + } + } + public static func parse_inputThemeSettings(_ reader: BufferReader) -> InputThemeSettings? { var _1: Int32? _1 = reader.readInt32() @@ -100,19 +139,27 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } var _5: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } var _6: Api.InputWallPaper? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InputWallPaper - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InputWallPaper + } + } var _7: Api.WallPaperSettings? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -121,67 +168,82 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.InputThemeSettings.inputThemeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6, wallpaperSettings: _7) + return Api.InputThemeSettings.inputThemeSettings(Cons_inputThemeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6, wallpaperSettings: _7)) } else { return nil } } - } } public extension Api { indirect enum InputUser: TypeConstructorDescription { - case inputUser(userId: Int64, accessHash: Int64) + public class Cons_inputUser { + public var userId: Int64 + public var accessHash: Int64 + public init(userId: Int64, accessHash: Int64) { + self.userId = userId + self.accessHash = accessHash + } + } + public class Cons_inputUserFromMessage { + public var peer: Api.InputPeer + public var msgId: Int32 + public var userId: Int64 + public init(peer: Api.InputPeer, msgId: Int32, userId: Int64) { + self.peer = peer + self.msgId = msgId + self.userId = userId + } + } + case inputUser(Cons_inputUser) case inputUserEmpty - case inputUserFromMessage(peer: Api.InputPeer, msgId: Int32, userId: Int64) + case inputUserFromMessage(Cons_inputUserFromMessage) case inputUserSelf - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputUser(let userId, let accessHash): - if boxed { - buffer.appendInt32(-233744186) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputUserEmpty: - if boxed { - buffer.appendInt32(-1182234929) - } - - break - case .inputUserFromMessage(let peer, let msgId, let userId): - if boxed { - buffer.appendInt32(497305826) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .inputUserSelf: - if boxed { - buffer.appendInt32(-138301121) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputUser(let userId, let accessHash): - return ("inputUser", [("userId", userId as Any), ("accessHash", accessHash as Any)]) - case .inputUserEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputUser(let _data): + if boxed { + buffer.appendInt32(-233744186) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputUserEmpty: + if boxed { + buffer.appendInt32(-1182234929) + } + break + case .inputUserFromMessage(let _data): + if boxed { + buffer.appendInt32(497305826) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .inputUserSelf: + if boxed { + buffer.appendInt32(-138301121) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputUser(let _data): + return ("inputUser", [("userId", _data.userId as Any), ("accessHash", _data.accessHash as Any)]) + case .inputUserEmpty: return ("inputUserEmpty", []) - case .inputUserFromMessage(let peer, let msgId, let userId): - return ("inputUserFromMessage", [("peer", peer as Any), ("msgId", msgId as Any), ("userId", userId as Any)]) - case .inputUserSelf: + case .inputUserFromMessage(let _data): + return ("inputUserFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("userId", _data.userId as Any)]) + case .inputUserSelf: return ("inputUserSelf", []) - } - } - + } + } + public static func parse_inputUser(_ reader: BufferReader) -> InputUser? { var _1: Int64? _1 = reader.readInt64() @@ -190,7 +252,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputUser.inputUser(userId: _1!, accessHash: _2!) + return Api.InputUser.inputUser(Cons_inputUser(userId: _1!, accessHash: _2!)) } else { return nil @@ -212,7 +274,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputUser.inputUserFromMessage(peer: _1!, msgId: _2!, userId: _3!) + return Api.InputUser.inputUserFromMessage(Cons_inputUserFromMessage(peer: _1!, msgId: _2!, userId: _3!)) } else { return nil @@ -221,50 +283,69 @@ public extension Api { public static func parse_inputUserSelf(_ reader: BufferReader) -> InputUser? { return Api.InputUser.inputUserSelf } - } } public extension Api { enum InputWallPaper: TypeConstructorDescription { - case inputWallPaper(id: Int64, accessHash: Int64) - case inputWallPaperNoFile(id: Int64) - case inputWallPaperSlug(slug: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputWallPaper(let id, let accessHash): - if boxed { - buffer.appendInt32(-433014407) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputWallPaperNoFile(let id): - if boxed { - buffer.appendInt32(-1770371538) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .inputWallPaperSlug(let slug): - if boxed { - buffer.appendInt32(1913199744) - } - serializeString(slug, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputWallPaper(let id, let accessHash): - return ("inputWallPaper", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputWallPaperNoFile(let id): - return ("inputWallPaperNoFile", [("id", id as Any)]) - case .inputWallPaperSlug(let slug): - return ("inputWallPaperSlug", [("slug", slug as Any)]) - } - } - + public class Cons_inputWallPaper { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputWallPaperNoFile { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + public class Cons_inputWallPaperSlug { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + case inputWallPaper(Cons_inputWallPaper) + case inputWallPaperNoFile(Cons_inputWallPaperNoFile) + case inputWallPaperSlug(Cons_inputWallPaperSlug) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputWallPaper(let _data): + if boxed { + buffer.appendInt32(-433014407) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputWallPaperNoFile(let _data): + if boxed { + buffer.appendInt32(-1770371538) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + case .inputWallPaperSlug(let _data): + if boxed { + buffer.appendInt32(1913199744) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputWallPaper(let _data): + return ("inputWallPaper", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputWallPaperNoFile(let _data): + return ("inputWallPaperNoFile", [("id", _data.id as Any)]) + case .inputWallPaperSlug(let _data): + return ("inputWallPaperSlug", [("slug", _data.slug as Any)]) + } + } + public static func parse_inputWallPaper(_ reader: BufferReader) -> InputWallPaper? { var _1: Int64? _1 = reader.readInt64() @@ -273,7 +354,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputWallPaper.inputWallPaper(id: _1!, accessHash: _2!) + return Api.InputWallPaper.inputWallPaper(Cons_inputWallPaper(id: _1!, accessHash: _2!)) } else { return nil @@ -284,7 +365,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.InputWallPaper.inputWallPaperNoFile(id: _1!) + return Api.InputWallPaper.inputWallPaperNoFile(Cons_inputWallPaperNoFile(id: _1!)) } else { return nil @@ -295,44 +376,55 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputWallPaper.inputWallPaperSlug(slug: _1!) + return Api.InputWallPaper.inputWallPaperSlug(Cons_inputWallPaperSlug(slug: _1!)) } else { return nil } } - } } public extension Api { enum InputWebDocument: TypeConstructorDescription { - case inputWebDocument(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputWebDocument(let url, let size, let mimeType, let attributes): - if boxed { - buffer.appendInt32(-1678949555) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputWebDocument(let url, let size, let mimeType, let attributes): - return ("inputWebDocument", [("url", url as Any), ("size", size as Any), ("mimeType", mimeType as Any), ("attributes", attributes as Any)]) - } - } - + public class Cons_inputWebDocument { + public var url: String + public var size: Int32 + public var mimeType: String + public var attributes: [Api.DocumentAttribute] + public init(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) { + self.url = url + self.size = size + self.mimeType = mimeType + self.attributes = attributes + } + } + case inputWebDocument(Cons_inputWebDocument) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputWebDocument(let _data): + if boxed { + buffer.appendInt32(-1678949555) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.size, buffer: buffer, boxed: false) + serializeString(_data.mimeType, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputWebDocument(let _data): + return ("inputWebDocument", [("url", _data.url as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + } + } + public static func parse_inputWebDocument(_ reader: BufferReader) -> InputWebDocument? { var _1: String? _1 = parseString(reader) @@ -349,81 +441,128 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputWebDocument.inputWebDocument(url: _1!, size: _2!, mimeType: _3!, attributes: _4!) + return Api.InputWebDocument.inputWebDocument(Cons_inputWebDocument(url: _1!, size: _2!, mimeType: _3!, attributes: _4!)) } else { return nil } } - } } public extension Api { enum InputWebFileLocation: TypeConstructorDescription { - case inputWebFileAudioAlbumThumbLocation(flags: Int32, document: Api.InputDocument?, title: String?, performer: String?) - case inputWebFileGeoPointLocation(geoPoint: Api.InputGeoPoint, accessHash: Int64, w: Int32, h: Int32, zoom: Int32, scale: Int32) - case inputWebFileLocation(url: String, accessHash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputWebFileAudioAlbumThumbLocation(let flags, let document, let title, let performer): - if boxed { - buffer.appendInt32(-193992412) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(performer!, buffer: buffer, boxed: false)} - break - case .inputWebFileGeoPointLocation(let geoPoint, let accessHash, let w, let h, let zoom, let scale): - if boxed { - buffer.appendInt32(-1625153079) - } - geoPoint.serialize(buffer, true) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeInt32(zoom, buffer: buffer, boxed: false) - serializeInt32(scale, buffer: buffer, boxed: false) - break - case .inputWebFileLocation(let url, let accessHash): - if boxed { - buffer.appendInt32(-1036396922) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputWebFileAudioAlbumThumbLocation(let flags, let document, let title, let performer): - return ("inputWebFileAudioAlbumThumbLocation", [("flags", flags as Any), ("document", document as Any), ("title", title as Any), ("performer", performer as Any)]) - case .inputWebFileGeoPointLocation(let geoPoint, let accessHash, let w, let h, let zoom, let scale): - return ("inputWebFileGeoPointLocation", [("geoPoint", geoPoint as Any), ("accessHash", accessHash as Any), ("w", w as Any), ("h", h as Any), ("zoom", zoom as Any), ("scale", scale as Any)]) - case .inputWebFileLocation(let url, let accessHash): - return ("inputWebFileLocation", [("url", url as Any), ("accessHash", accessHash as Any)]) - } - } - + public class Cons_inputWebFileAudioAlbumThumbLocation { + public var flags: Int32 + public var document: Api.InputDocument? + public var title: String? + public var performer: String? + public init(flags: Int32, document: Api.InputDocument?, title: String?, performer: String?) { + self.flags = flags + self.document = document + self.title = title + self.performer = performer + } + } + public class Cons_inputWebFileGeoPointLocation { + public var geoPoint: Api.InputGeoPoint + public var accessHash: Int64 + public var w: Int32 + public var h: Int32 + public var zoom: Int32 + public var scale: Int32 + public init(geoPoint: Api.InputGeoPoint, accessHash: Int64, w: Int32, h: Int32, zoom: Int32, scale: Int32) { + self.geoPoint = geoPoint + self.accessHash = accessHash + self.w = w + self.h = h + self.zoom = zoom + self.scale = scale + } + } + public class Cons_inputWebFileLocation { + public var url: String + public var accessHash: Int64 + public init(url: String, accessHash: Int64) { + self.url = url + self.accessHash = accessHash + } + } + case inputWebFileAudioAlbumThumbLocation(Cons_inputWebFileAudioAlbumThumbLocation) + case inputWebFileGeoPointLocation(Cons_inputWebFileGeoPointLocation) + case inputWebFileLocation(Cons_inputWebFileLocation) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputWebFileAudioAlbumThumbLocation(let _data): + if boxed { + buffer.appendInt32(-193992412) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.performer!, buffer: buffer, boxed: false) + } + break + case .inputWebFileGeoPointLocation(let _data): + if boxed { + buffer.appendInt32(-1625153079) + } + _data.geoPoint.serialize(buffer, true) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + serializeInt32(_data.zoom, buffer: buffer, boxed: false) + serializeInt32(_data.scale, buffer: buffer, boxed: false) + break + case .inputWebFileLocation(let _data): + if boxed { + buffer.appendInt32(-1036396922) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputWebFileAudioAlbumThumbLocation(let _data): + return ("inputWebFileAudioAlbumThumbLocation", [("flags", _data.flags as Any), ("document", _data.document as Any), ("title", _data.title as Any), ("performer", _data.performer as Any)]) + case .inputWebFileGeoPointLocation(let _data): + return ("inputWebFileGeoPointLocation", [("geoPoint", _data.geoPoint as Any), ("accessHash", _data.accessHash as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("zoom", _data.zoom as Any), ("scale", _data.scale as Any)]) + case .inputWebFileLocation(let _data): + return ("inputWebFileLocation", [("url", _data.url as Any), ("accessHash", _data.accessHash as Any)]) + } + } + public static func parse_inputWebFileAudioAlbumThumbLocation(_ reader: BufferReader) -> InputWebFileLocation? { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + } var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputWebFileLocation.inputWebFileAudioAlbumThumbLocation(flags: _1!, document: _2, title: _3, performer: _4) + return Api.InputWebFileLocation.inputWebFileAudioAlbumThumbLocation(Cons_inputWebFileAudioAlbumThumbLocation(flags: _1!, document: _2, title: _3, performer: _4)) } else { return nil @@ -451,7 +590,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputWebFileLocation.inputWebFileGeoPointLocation(geoPoint: _1!, accessHash: _2!, w: _3!, h: _4!, zoom: _5!, scale: _6!) + return Api.InputWebFileLocation.inputWebFileGeoPointLocation(Cons_inputWebFileGeoPointLocation(geoPoint: _1!, accessHash: _2!, w: _3!, h: _4!, zoom: _5!, scale: _6!)) } else { return nil @@ -465,51 +604,76 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputWebFileLocation.inputWebFileLocation(url: _1!, accessHash: _2!) + return Api.InputWebFileLocation.inputWebFileLocation(Cons_inputWebFileLocation(url: _1!, accessHash: _2!)) } else { return nil } } - } } public extension Api { enum Invoice: TypeConstructorDescription { - case invoice(flags: Int32, currency: String, prices: [Api.LabeledPrice], maxTipAmount: Int64?, suggestedTipAmounts: [Int64]?, termsUrl: String?, subscriptionPeriod: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .invoice(let flags, let currency, let prices, let maxTipAmount, let suggestedTipAmounts, let termsUrl, let subscriptionPeriod): - if boxed { - buffer.appendInt32(77522308) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) + public class Cons_invoice { + public var flags: Int32 + public var currency: String + public var prices: [Api.LabeledPrice] + public var maxTipAmount: Int64? + public var suggestedTipAmounts: [Int64]? + public var termsUrl: String? + public var subscriptionPeriod: Int32? + public init(flags: Int32, currency: String, prices: [Api.LabeledPrice], maxTipAmount: Int64?, suggestedTipAmounts: [Int64]?, termsUrl: String?, subscriptionPeriod: Int32?) { + self.flags = flags + self.currency = currency + self.prices = prices + self.maxTipAmount = maxTipAmount + self.suggestedTipAmounts = suggestedTipAmounts + self.termsUrl = termsUrl + self.subscriptionPeriod = subscriptionPeriod + } + } + case invoice(Cons_invoice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .invoice(let _data): + if boxed { + buffer.appendInt32(77522308) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prices.count)) + for item in _data.prices { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.maxTipAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prices.count)) - for item in prices { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(maxTipAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(suggestedTipAmounts!.count)) - for item in suggestedTipAmounts! { + buffer.appendInt32(Int32(_data.suggestedTipAmounts!.count)) + for item in _data.suggestedTipAmounts! { serializeInt64(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 10) != 0 {serializeString(termsUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(subscriptionPeriod!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .invoice(let flags, let currency, let prices, let maxTipAmount, let suggestedTipAmounts, let termsUrl, let subscriptionPeriod): - return ("invoice", [("flags", flags as Any), ("currency", currency as Any), ("prices", prices as Any), ("maxTipAmount", maxTipAmount as Any), ("suggestedTipAmounts", suggestedTipAmounts as Any), ("termsUrl", termsUrl as Any), ("subscriptionPeriod", subscriptionPeriod as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeString(_data.termsUrl!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.subscriptionPeriod!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .invoice(let _data): + return ("invoice", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("prices", _data.prices as Any), ("maxTipAmount", _data.maxTipAmount as Any), ("suggestedTipAmounts", _data.suggestedTipAmounts as Any), ("termsUrl", _data.termsUrl as Any), ("subscriptionPeriod", _data.subscriptionPeriod as Any)]) + } + } + public static func parse_invoice(_ reader: BufferReader) -> Invoice? { var _1: Int32? _1 = reader.readInt32() @@ -520,15 +684,23 @@ public extension Api { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.LabeledPrice.self) } var _4: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _4 = reader.readInt64() + } var _5: [Int64]? - if Int(_1!) & Int(1 << 8) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } var _6: String? - if Int(_1!) & Int(1 << 10) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 10) != 0 { + _6 = parseString(reader) + } var _7: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _7 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -537,38 +709,45 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 10) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 11) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Invoice.invoice(flags: _1!, currency: _2!, prices: _3!, maxTipAmount: _4, suggestedTipAmounts: _5, termsUrl: _6, subscriptionPeriod: _7) + return Api.Invoice.invoice(Cons_invoice(flags: _1!, currency: _2!, prices: _3!, maxTipAmount: _4, suggestedTipAmounts: _5, termsUrl: _6, subscriptionPeriod: _7)) } else { return nil } } - } } public extension Api { enum JSONObjectValue: TypeConstructorDescription { - case jsonObjectValue(key: String, value: Api.JSONValue) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .jsonObjectValue(let key, let value): - if boxed { - buffer.appendInt32(-1059185703) - } - serializeString(key, buffer: buffer, boxed: false) - value.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .jsonObjectValue(let key, let value): - return ("jsonObjectValue", [("key", key as Any), ("value", value as Any)]) - } - } - + public class Cons_jsonObjectValue { + public var key: String + public var value: Api.JSONValue + public init(key: String, value: Api.JSONValue) { + self.key = key + self.value = value + } + } + case jsonObjectValue(Cons_jsonObjectValue) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .jsonObjectValue(let _data): + if boxed { + buffer.appendInt32(-1059185703) + } + serializeString(_data.key, buffer: buffer, boxed: false) + _data.value.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .jsonObjectValue(let _data): + return ("jsonObjectValue", [("key", _data.key as Any), ("value", _data.value as Any)]) + } + } + public static func parse_jsonObjectValue(_ reader: BufferReader) -> JSONObjectValue? { var _1: String? _1 = parseString(reader) @@ -579,90 +758,118 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.JSONObjectValue.jsonObjectValue(key: _1!, value: _2!) + return Api.JSONObjectValue.jsonObjectValue(Cons_jsonObjectValue(key: _1!, value: _2!)) } else { return nil } } - } } public extension Api { enum JSONValue: TypeConstructorDescription { - case jsonArray(value: [Api.JSONValue]) - case jsonBool(value: Api.Bool) + public class Cons_jsonArray { + public var value: [Api.JSONValue] + public init(value: [Api.JSONValue]) { + self.value = value + } + } + public class Cons_jsonBool { + public var value: Api.Bool + public init(value: Api.Bool) { + self.value = value + } + } + public class Cons_jsonNumber { + public var value: Double + public init(value: Double) { + self.value = value + } + } + public class Cons_jsonObject { + public var value: [Api.JSONObjectValue] + public init(value: [Api.JSONObjectValue]) { + self.value = value + } + } + public class Cons_jsonString { + public var value: String + public init(value: String) { + self.value = value + } + } + case jsonArray(Cons_jsonArray) + case jsonBool(Cons_jsonBool) case jsonNull - case jsonNumber(value: Double) - case jsonObject(value: [Api.JSONObjectValue]) - case jsonString(value: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .jsonArray(let value): - if boxed { - buffer.appendInt32(-146520221) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(value.count)) - for item in value { - item.serialize(buffer, true) - } - break - case .jsonBool(let value): - if boxed { - buffer.appendInt32(-952869270) - } - value.serialize(buffer, true) - break - case .jsonNull: - if boxed { - buffer.appendInt32(1064139624) - } - - break - case .jsonNumber(let value): - if boxed { - buffer.appendInt32(736157604) - } - serializeDouble(value, buffer: buffer, boxed: false) - break - case .jsonObject(let value): - if boxed { - buffer.appendInt32(-1715350371) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(value.count)) - for item in value { - item.serialize(buffer, true) - } - break - case .jsonString(let value): - if boxed { - buffer.appendInt32(-1222740358) - } - serializeString(value, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .jsonArray(let value): - return ("jsonArray", [("value", value as Any)]) - case .jsonBool(let value): - return ("jsonBool", [("value", value as Any)]) - case .jsonNull: + case jsonNumber(Cons_jsonNumber) + case jsonObject(Cons_jsonObject) + case jsonString(Cons_jsonString) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .jsonArray(let _data): + if boxed { + buffer.appendInt32(-146520221) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.value.count)) + for item in _data.value { + item.serialize(buffer, true) + } + break + case .jsonBool(let _data): + if boxed { + buffer.appendInt32(-952869270) + } + _data.value.serialize(buffer, true) + break + case .jsonNull: + if boxed { + buffer.appendInt32(1064139624) + } + break + case .jsonNumber(let _data): + if boxed { + buffer.appendInt32(736157604) + } + serializeDouble(_data.value, buffer: buffer, boxed: false) + break + case .jsonObject(let _data): + if boxed { + buffer.appendInt32(-1715350371) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.value.count)) + for item in _data.value { + item.serialize(buffer, true) + } + break + case .jsonString(let _data): + if boxed { + buffer.appendInt32(-1222740358) + } + serializeString(_data.value, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .jsonArray(let _data): + return ("jsonArray", [("value", _data.value as Any)]) + case .jsonBool(let _data): + return ("jsonBool", [("value", _data.value as Any)]) + case .jsonNull: return ("jsonNull", []) - case .jsonNumber(let value): - return ("jsonNumber", [("value", value as Any)]) - case .jsonObject(let value): - return ("jsonObject", [("value", value as Any)]) - case .jsonString(let value): - return ("jsonString", [("value", value as Any)]) - } - } - + case .jsonNumber(let _data): + return ("jsonNumber", [("value", _data.value as Any)]) + case .jsonObject(let _data): + return ("jsonObject", [("value", _data.value as Any)]) + case .jsonString(let _data): + return ("jsonString", [("value", _data.value as Any)]) + } + } + public static func parse_jsonArray(_ reader: BufferReader) -> JSONValue? { var _1: [Api.JSONValue]? if let _ = reader.readInt32() { @@ -670,7 +877,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.JSONValue.jsonArray(value: _1!) + return Api.JSONValue.jsonArray(Cons_jsonArray(value: _1!)) } else { return nil @@ -683,7 +890,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.JSONValue.jsonBool(value: _1!) + return Api.JSONValue.jsonBool(Cons_jsonBool(value: _1!)) } else { return nil @@ -697,7 +904,7 @@ public extension Api { _1 = reader.readDouble() let _c1 = _1 != nil if _c1 { - return Api.JSONValue.jsonNumber(value: _1!) + return Api.JSONValue.jsonNumber(Cons_jsonNumber(value: _1!)) } else { return nil @@ -710,7 +917,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.JSONValue.jsonObject(value: _1!) + return Api.JSONValue.jsonObject(Cons_jsonObject(value: _1!)) } else { return nil @@ -721,222 +928,393 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.JSONValue.jsonString(value: _1!) + return Api.JSONValue.jsonString(Cons_jsonString(value: _1!)) } else { return nil } } - } } public extension Api { indirect enum KeyboardButton: TypeConstructorDescription { - case inputKeyboardButtonRequestPeer(flags: Int32, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) - case inputKeyboardButtonUrlAuth(flags: Int32, text: String, fwdText: String?, url: String, bot: Api.InputUser) - case inputKeyboardButtonUserProfile(text: String, userId: Api.InputUser) - case keyboardButton(text: String) - case keyboardButtonBuy(text: String) - case keyboardButtonCallback(flags: Int32, text: String, data: Buffer) - case keyboardButtonCopy(text: String, copyText: String) - case keyboardButtonGame(text: String) - case keyboardButtonRequestGeoLocation(text: String) - case keyboardButtonRequestPeer(text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) - case keyboardButtonRequestPhone(text: String) - case keyboardButtonRequestPoll(flags: Int32, quiz: Api.Bool?, text: String) - case keyboardButtonSimpleWebView(text: String, url: String) - case keyboardButtonSwitchInline(flags: Int32, text: String, query: String, peerTypes: [Api.InlineQueryPeerType]?) - case keyboardButtonUrl(text: String, url: String) - case keyboardButtonUrlAuth(flags: Int32, text: String, fwdText: String?, url: String, buttonId: Int32) - case keyboardButtonUserProfile(text: String, userId: Int64) - case keyboardButtonWebView(text: String, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputKeyboardButtonRequestPeer(let flags, let text, let buttonId, let peerType, let maxQuantity): - if boxed { - buffer.appendInt32(-916050683) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - serializeInt32(buttonId, buffer: buffer, boxed: false) - peerType.serialize(buffer, true) - serializeInt32(maxQuantity, buffer: buffer, boxed: false) - break - case .inputKeyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let bot): - if boxed { - buffer.appendInt32(-802258988) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(fwdText!, buffer: buffer, boxed: false)} - serializeString(url, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - break - case .inputKeyboardButtonUserProfile(let text, let userId): - if boxed { - buffer.appendInt32(-376962181) - } - serializeString(text, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - break - case .keyboardButton(let text): - if boxed { - buffer.appendInt32(-1560655744) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonBuy(let text): - if boxed { - buffer.appendInt32(-1344716869) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonCallback(let flags, let text, let data): - if boxed { - buffer.appendInt32(901503851) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - serializeBytes(data, buffer: buffer, boxed: false) - break - case .keyboardButtonCopy(let text, let copyText): - if boxed { - buffer.appendInt32(1976723854) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(copyText, buffer: buffer, boxed: false) - break - case .keyboardButtonGame(let text): - if boxed { - buffer.appendInt32(1358175439) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestGeoLocation(let text): - if boxed { - buffer.appendInt32(-59151553) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestPeer(let text, let buttonId, let peerType, let maxQuantity): - if boxed { - buffer.appendInt32(1406648280) - } - serializeString(text, buffer: buffer, boxed: false) - serializeInt32(buttonId, buffer: buffer, boxed: false) - peerType.serialize(buffer, true) - serializeInt32(maxQuantity, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestPhone(let text): - if boxed { - buffer.appendInt32(-1318425559) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestPoll(let flags, let quiz, let text): - if boxed { - buffer.appendInt32(-1144565411) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {quiz!.serialize(buffer, true)} - serializeString(text, buffer: buffer, boxed: false) - break - case .keyboardButtonSimpleWebView(let text, let url): - if boxed { - buffer.appendInt32(-1598009252) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - case .keyboardButtonSwitchInline(let flags, let text, let query, let peerTypes): - if boxed { - buffer.appendInt32(-1816527947) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - serializeString(query, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peerTypes!.count)) - for item in peerTypes! { + public class Cons_inputKeyboardButtonRequestPeer { + public var flags: Int32 + public var text: String + public var buttonId: Int32 + public var peerType: Api.RequestPeerType + public var maxQuantity: Int32 + public init(flags: Int32, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { + self.flags = flags + self.text = text + self.buttonId = buttonId + self.peerType = peerType + self.maxQuantity = maxQuantity + } + } + public class Cons_inputKeyboardButtonUrlAuth { + public var flags: Int32 + public var text: String + public var fwdText: String? + public var url: String + public var bot: Api.InputUser + public init(flags: Int32, text: String, fwdText: String?, url: String, bot: Api.InputUser) { + self.flags = flags + self.text = text + self.fwdText = fwdText + self.url = url + self.bot = bot + } + } + public class Cons_inputKeyboardButtonUserProfile { + public var text: String + public var userId: Api.InputUser + public init(text: String, userId: Api.InputUser) { + self.text = text + self.userId = userId + } + } + public class Cons_keyboardButton { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_keyboardButtonBuy { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_keyboardButtonCallback { + public var flags: Int32 + public var text: String + public var data: Buffer + public init(flags: Int32, text: String, data: Buffer) { + self.flags = flags + self.text = text + self.data = data + } + } + public class Cons_keyboardButtonCopy { + public var text: String + public var copyText: String + public init(text: String, copyText: String) { + self.text = text + self.copyText = copyText + } + } + public class Cons_keyboardButtonGame { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_keyboardButtonRequestGeoLocation { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_keyboardButtonRequestPeer { + public var text: String + public var buttonId: Int32 + public var peerType: Api.RequestPeerType + public var maxQuantity: Int32 + public init(text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { + self.text = text + self.buttonId = buttonId + self.peerType = peerType + self.maxQuantity = maxQuantity + } + } + public class Cons_keyboardButtonRequestPhone { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_keyboardButtonRequestPoll { + public var flags: Int32 + public var quiz: Api.Bool? + public var text: String + public init(flags: Int32, quiz: Api.Bool?, text: String) { + self.flags = flags + self.quiz = quiz + self.text = text + } + } + public class Cons_keyboardButtonSimpleWebView { + public var text: String + public var url: String + public init(text: String, url: String) { + self.text = text + self.url = url + } + } + public class Cons_keyboardButtonSwitchInline { + public var flags: Int32 + public var text: String + public var query: String + public var peerTypes: [Api.InlineQueryPeerType]? + public init(flags: Int32, text: String, query: String, peerTypes: [Api.InlineQueryPeerType]?) { + self.flags = flags + self.text = text + self.query = query + self.peerTypes = peerTypes + } + } + public class Cons_keyboardButtonUrl { + public var text: String + public var url: String + public init(text: String, url: String) { + self.text = text + self.url = url + } + } + public class Cons_keyboardButtonUrlAuth { + public var flags: Int32 + public var text: String + public var fwdText: String? + public var url: String + public var buttonId: Int32 + public init(flags: Int32, text: String, fwdText: String?, url: String, buttonId: Int32) { + self.flags = flags + self.text = text + self.fwdText = fwdText + self.url = url + self.buttonId = buttonId + } + } + public class Cons_keyboardButtonUserProfile { + public var text: String + public var userId: Int64 + public init(text: String, userId: Int64) { + self.text = text + self.userId = userId + } + } + public class Cons_keyboardButtonWebView { + public var text: String + public var url: String + public init(text: String, url: String) { + self.text = text + self.url = url + } + } + case inputKeyboardButtonRequestPeer(Cons_inputKeyboardButtonRequestPeer) + case inputKeyboardButtonUrlAuth(Cons_inputKeyboardButtonUrlAuth) + case inputKeyboardButtonUserProfile(Cons_inputKeyboardButtonUserProfile) + case keyboardButton(Cons_keyboardButton) + case keyboardButtonBuy(Cons_keyboardButtonBuy) + case keyboardButtonCallback(Cons_keyboardButtonCallback) + case keyboardButtonCopy(Cons_keyboardButtonCopy) + case keyboardButtonGame(Cons_keyboardButtonGame) + case keyboardButtonRequestGeoLocation(Cons_keyboardButtonRequestGeoLocation) + case keyboardButtonRequestPeer(Cons_keyboardButtonRequestPeer) + case keyboardButtonRequestPhone(Cons_keyboardButtonRequestPhone) + case keyboardButtonRequestPoll(Cons_keyboardButtonRequestPoll) + case keyboardButtonSimpleWebView(Cons_keyboardButtonSimpleWebView) + case keyboardButtonSwitchInline(Cons_keyboardButtonSwitchInline) + case keyboardButtonUrl(Cons_keyboardButtonUrl) + case keyboardButtonUrlAuth(Cons_keyboardButtonUrlAuth) + case keyboardButtonUserProfile(Cons_keyboardButtonUserProfile) + case keyboardButtonWebView(Cons_keyboardButtonWebView) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputKeyboardButtonRequestPeer(let _data): + if boxed { + buffer.appendInt32(-916050683) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + serializeInt32(_data.buttonId, buffer: buffer, boxed: false) + _data.peerType.serialize(buffer, true) + serializeInt32(_data.maxQuantity, buffer: buffer, boxed: false) + break + case .inputKeyboardButtonUrlAuth(let _data): + if boxed { + buffer.appendInt32(-802258988) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.fwdText!, buffer: buffer, boxed: false) + } + serializeString(_data.url, buffer: buffer, boxed: false) + _data.bot.serialize(buffer, true) + break + case .inputKeyboardButtonUserProfile(let _data): + if boxed { + buffer.appendInt32(-376962181) + } + serializeString(_data.text, buffer: buffer, boxed: false) + _data.userId.serialize(buffer, true) + break + case .keyboardButton(let _data): + if boxed { + buffer.appendInt32(-1560655744) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonBuy(let _data): + if boxed { + buffer.appendInt32(-1344716869) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonCallback(let _data): + if boxed { + buffer.appendInt32(901503851) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + serializeBytes(_data.data, buffer: buffer, boxed: false) + break + case .keyboardButtonCopy(let _data): + if boxed { + buffer.appendInt32(1976723854) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.copyText, buffer: buffer, boxed: false) + break + case .keyboardButtonGame(let _data): + if boxed { + buffer.appendInt32(1358175439) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestGeoLocation(let _data): + if boxed { + buffer.appendInt32(-59151553) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestPeer(let _data): + if boxed { + buffer.appendInt32(1406648280) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeInt32(_data.buttonId, buffer: buffer, boxed: false) + _data.peerType.serialize(buffer, true) + serializeInt32(_data.maxQuantity, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestPhone(let _data): + if boxed { + buffer.appendInt32(-1318425559) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestPoll(let _data): + if boxed { + buffer.appendInt32(-1144565411) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.quiz!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonSimpleWebView(let _data): + if boxed { + buffer.appendInt32(-1598009252) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .keyboardButtonSwitchInline(let _data): + if boxed { + buffer.appendInt32(-1816527947) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.query, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peerTypes!.count)) + for item in _data.peerTypes! { item.serialize(buffer, true) - }} - break - case .keyboardButtonUrl(let text, let url): - if boxed { - buffer.appendInt32(629866245) } - serializeString(text, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - case .keyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let buttonId): - if boxed { - buffer.appendInt32(280464681) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(fwdText!, buffer: buffer, boxed: false)} - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(buttonId, buffer: buffer, boxed: false) - break - case .keyboardButtonUserProfile(let text, let userId): - if boxed { - buffer.appendInt32(814112961) - } - serializeString(text, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .keyboardButtonWebView(let text, let url): - if boxed { - buffer.appendInt32(326529584) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputKeyboardButtonRequestPeer(let flags, let text, let buttonId, let peerType, let maxQuantity): - return ("inputKeyboardButtonRequestPeer", [("flags", flags as Any), ("text", text as Any), ("buttonId", buttonId as Any), ("peerType", peerType as Any), ("maxQuantity", maxQuantity as Any)]) - case .inputKeyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let bot): - return ("inputKeyboardButtonUrlAuth", [("flags", flags as Any), ("text", text as Any), ("fwdText", fwdText as Any), ("url", url as Any), ("bot", bot as Any)]) - case .inputKeyboardButtonUserProfile(let text, let userId): - return ("inputKeyboardButtonUserProfile", [("text", text as Any), ("userId", userId as Any)]) - case .keyboardButton(let text): - return ("keyboardButton", [("text", text as Any)]) - case .keyboardButtonBuy(let text): - return ("keyboardButtonBuy", [("text", text as Any)]) - case .keyboardButtonCallback(let flags, let text, let data): - return ("keyboardButtonCallback", [("flags", flags as Any), ("text", text as Any), ("data", data as Any)]) - case .keyboardButtonCopy(let text, let copyText): - return ("keyboardButtonCopy", [("text", text as Any), ("copyText", copyText as Any)]) - case .keyboardButtonGame(let text): - return ("keyboardButtonGame", [("text", text as Any)]) - case .keyboardButtonRequestGeoLocation(let text): - return ("keyboardButtonRequestGeoLocation", [("text", text as Any)]) - case .keyboardButtonRequestPeer(let text, let buttonId, let peerType, let maxQuantity): - return ("keyboardButtonRequestPeer", [("text", text as Any), ("buttonId", buttonId as Any), ("peerType", peerType as Any), ("maxQuantity", maxQuantity as Any)]) - case .keyboardButtonRequestPhone(let text): - return ("keyboardButtonRequestPhone", [("text", text as Any)]) - case .keyboardButtonRequestPoll(let flags, let quiz, let text): - return ("keyboardButtonRequestPoll", [("flags", flags as Any), ("quiz", quiz as Any), ("text", text as Any)]) - case .keyboardButtonSimpleWebView(let text, let url): - return ("keyboardButtonSimpleWebView", [("text", text as Any), ("url", url as Any)]) - case .keyboardButtonSwitchInline(let flags, let text, let query, let peerTypes): - return ("keyboardButtonSwitchInline", [("flags", flags as Any), ("text", text as Any), ("query", query as Any), ("peerTypes", peerTypes as Any)]) - case .keyboardButtonUrl(let text, let url): - return ("keyboardButtonUrl", [("text", text as Any), ("url", url as Any)]) - case .keyboardButtonUrlAuth(let flags, let text, let fwdText, let url, let buttonId): - return ("keyboardButtonUrlAuth", [("flags", flags as Any), ("text", text as Any), ("fwdText", fwdText as Any), ("url", url as Any), ("buttonId", buttonId as Any)]) - case .keyboardButtonUserProfile(let text, let userId): - return ("keyboardButtonUserProfile", [("text", text as Any), ("userId", userId as Any)]) - case .keyboardButtonWebView(let text, let url): - return ("keyboardButtonWebView", [("text", text as Any), ("url", url as Any)]) - } - } - + } + break + case .keyboardButtonUrl(let _data): + if boxed { + buffer.appendInt32(629866245) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .keyboardButtonUrlAuth(let _data): + if boxed { + buffer.appendInt32(280464681) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.fwdText!, buffer: buffer, boxed: false) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.buttonId, buffer: buffer, boxed: false) + break + case .keyboardButtonUserProfile(let _data): + if boxed { + buffer.appendInt32(814112961) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .keyboardButtonWebView(let _data): + if boxed { + buffer.appendInt32(326529584) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputKeyboardButtonRequestPeer(let _data): + return ("inputKeyboardButtonRequestPeer", [("flags", _data.flags as Any), ("text", _data.text as Any), ("buttonId", _data.buttonId as Any), ("peerType", _data.peerType as Any), ("maxQuantity", _data.maxQuantity as Any)]) + case .inputKeyboardButtonUrlAuth(let _data): + return ("inputKeyboardButtonUrlAuth", [("flags", _data.flags as Any), ("text", _data.text as Any), ("fwdText", _data.fwdText as Any), ("url", _data.url as Any), ("bot", _data.bot as Any)]) + case .inputKeyboardButtonUserProfile(let _data): + return ("inputKeyboardButtonUserProfile", [("text", _data.text as Any), ("userId", _data.userId as Any)]) + case .keyboardButton(let _data): + return ("keyboardButton", [("text", _data.text as Any)]) + case .keyboardButtonBuy(let _data): + return ("keyboardButtonBuy", [("text", _data.text as Any)]) + case .keyboardButtonCallback(let _data): + return ("keyboardButtonCallback", [("flags", _data.flags as Any), ("text", _data.text as Any), ("data", _data.data as Any)]) + case .keyboardButtonCopy(let _data): + return ("keyboardButtonCopy", [("text", _data.text as Any), ("copyText", _data.copyText as Any)]) + case .keyboardButtonGame(let _data): + return ("keyboardButtonGame", [("text", _data.text as Any)]) + case .keyboardButtonRequestGeoLocation(let _data): + return ("keyboardButtonRequestGeoLocation", [("text", _data.text as Any)]) + case .keyboardButtonRequestPeer(let _data): + return ("keyboardButtonRequestPeer", [("text", _data.text as Any), ("buttonId", _data.buttonId as Any), ("peerType", _data.peerType as Any), ("maxQuantity", _data.maxQuantity as Any)]) + case .keyboardButtonRequestPhone(let _data): + return ("keyboardButtonRequestPhone", [("text", _data.text as Any)]) + case .keyboardButtonRequestPoll(let _data): + return ("keyboardButtonRequestPoll", [("flags", _data.flags as Any), ("quiz", _data.quiz as Any), ("text", _data.text as Any)]) + case .keyboardButtonSimpleWebView(let _data): + return ("keyboardButtonSimpleWebView", [("text", _data.text as Any), ("url", _data.url as Any)]) + case .keyboardButtonSwitchInline(let _data): + return ("keyboardButtonSwitchInline", [("flags", _data.flags as Any), ("text", _data.text as Any), ("query", _data.query as Any), ("peerTypes", _data.peerTypes as Any)]) + case .keyboardButtonUrl(let _data): + return ("keyboardButtonUrl", [("text", _data.text as Any), ("url", _data.url as Any)]) + case .keyboardButtonUrlAuth(let _data): + return ("keyboardButtonUrlAuth", [("flags", _data.flags as Any), ("text", _data.text as Any), ("fwdText", _data.fwdText as Any), ("url", _data.url as Any), ("buttonId", _data.buttonId as Any)]) + case .keyboardButtonUserProfile(let _data): + return ("keyboardButtonUserProfile", [("text", _data.text as Any), ("userId", _data.userId as Any)]) + case .keyboardButtonWebView(let _data): + return ("keyboardButtonWebView", [("text", _data.text as Any), ("url", _data.url as Any)]) + } + } + public static func parse_inputKeyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? { var _1: Int32? _1 = reader.readInt32() @@ -956,7 +1334,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.KeyboardButton.inputKeyboardButtonRequestPeer(flags: _1!, text: _2!, buttonId: _3!, peerType: _4!, maxQuantity: _5!) + return Api.KeyboardButton.inputKeyboardButtonRequestPeer(Cons_inputKeyboardButtonRequestPeer(flags: _1!, text: _2!, buttonId: _3!, peerType: _4!, maxQuantity: _5!)) } else { return nil @@ -968,7 +1346,9 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: String? _4 = parseString(reader) var _5: Api.InputUser? @@ -981,7 +1361,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.KeyboardButton.inputKeyboardButtonUrlAuth(flags: _1!, text: _2!, fwdText: _3, url: _4!, bot: _5!) + return Api.KeyboardButton.inputKeyboardButtonUrlAuth(Cons_inputKeyboardButtonUrlAuth(flags: _1!, text: _2!, fwdText: _3, url: _4!, bot: _5!)) } else { return nil @@ -997,7 +1377,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.inputKeyboardButtonUserProfile(text: _1!, userId: _2!) + return Api.KeyboardButton.inputKeyboardButtonUserProfile(Cons_inputKeyboardButtonUserProfile(text: _1!, userId: _2!)) } else { return nil @@ -1008,7 +1388,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.KeyboardButton.keyboardButton(text: _1!) + return Api.KeyboardButton.keyboardButton(Cons_keyboardButton(text: _1!)) } else { return nil @@ -1019,7 +1399,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.KeyboardButton.keyboardButtonBuy(text: _1!) + return Api.KeyboardButton.keyboardButtonBuy(Cons_keyboardButtonBuy(text: _1!)) } else { return nil @@ -1036,7 +1416,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonCallback(flags: _1!, text: _2!, data: _3!) + return Api.KeyboardButton.keyboardButtonCallback(Cons_keyboardButtonCallback(flags: _1!, text: _2!, data: _3!)) } else { return nil @@ -1050,7 +1430,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.keyboardButtonCopy(text: _1!, copyText: _2!) + return Api.KeyboardButton.keyboardButtonCopy(Cons_keyboardButtonCopy(text: _1!, copyText: _2!)) } else { return nil @@ -1061,7 +1441,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.KeyboardButton.keyboardButtonGame(text: _1!) + return Api.KeyboardButton.keyboardButtonGame(Cons_keyboardButtonGame(text: _1!)) } else { return nil @@ -1072,7 +1452,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.KeyboardButton.keyboardButtonRequestGeoLocation(text: _1!) + return Api.KeyboardButton.keyboardButtonRequestGeoLocation(Cons_keyboardButtonRequestGeoLocation(text: _1!)) } else { return nil @@ -1094,7 +1474,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonRequestPeer(text: _1!, buttonId: _2!, peerType: _3!, maxQuantity: _4!) + return Api.KeyboardButton.keyboardButtonRequestPeer(Cons_keyboardButtonRequestPeer(text: _1!, buttonId: _2!, peerType: _3!, maxQuantity: _4!)) } else { return nil @@ -1105,7 +1485,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.KeyboardButton.keyboardButtonRequestPhone(text: _1!) + return Api.KeyboardButton.keyboardButtonRequestPhone(Cons_keyboardButtonRequestPhone(text: _1!)) } else { return nil @@ -1115,16 +1495,18 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: String? _3 = parseString(reader) let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonRequestPoll(flags: _1!, quiz: _2, text: _3!) + return Api.KeyboardButton.keyboardButtonRequestPoll(Cons_keyboardButtonRequestPoll(flags: _1!, quiz: _2, text: _3!)) } else { return nil @@ -1138,7 +1520,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.keyboardButtonSimpleWebView(text: _1!, url: _2!) + return Api.KeyboardButton.keyboardButtonSimpleWebView(Cons_keyboardButtonSimpleWebView(text: _1!, url: _2!)) } else { return nil @@ -1152,15 +1534,17 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: [Api.InlineQueryPeerType]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonSwitchInline(flags: _1!, text: _2!, query: _3!, peerTypes: _4) + return Api.KeyboardButton.keyboardButtonSwitchInline(Cons_keyboardButtonSwitchInline(flags: _1!, text: _2!, query: _3!, peerTypes: _4)) } else { return nil @@ -1174,7 +1558,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.keyboardButtonUrl(text: _1!, url: _2!) + return Api.KeyboardButton.keyboardButtonUrl(Cons_keyboardButtonUrl(text: _1!, url: _2!)) } else { return nil @@ -1186,7 +1570,9 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? _4 = parseString(reader) var _5: Int32? @@ -1197,7 +1583,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.KeyboardButton.keyboardButtonUrlAuth(flags: _1!, text: _2!, fwdText: _3, url: _4!, buttonId: _5!) + return Api.KeyboardButton.keyboardButtonUrlAuth(Cons_keyboardButtonUrlAuth(flags: _1!, text: _2!, fwdText: _3, url: _4!, buttonId: _5!)) } else { return nil @@ -1211,7 +1597,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.keyboardButtonUserProfile(text: _1!, userId: _2!) + return Api.KeyboardButton.keyboardButtonUserProfile(Cons_keyboardButtonUserProfile(text: _1!, userId: _2!)) } else { return nil @@ -1225,12 +1611,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.KeyboardButton.keyboardButtonWebView(text: _1!, url: _2!) + return Api.KeyboardButton.keyboardButtonWebView(Cons_keyboardButtonWebView(text: _1!, url: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api15.swift b/submodules/TelegramApi/Sources/Api15.swift index 90856a13d3..33c42c5870 100644 --- a/submodules/TelegramApi/Sources/Api15.swift +++ b/submodules/TelegramApi/Sources/Api15.swift @@ -1,29 +1,35 @@ public extension Api { enum KeyboardButtonRow: TypeConstructorDescription { - case keyboardButtonRow(buttons: [Api.KeyboardButton]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .keyboardButtonRow(let buttons): - if boxed { - buffer.appendInt32(2002815875) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(buttons.count)) - for item in buttons { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .keyboardButtonRow(let buttons): - return ("keyboardButtonRow", [("buttons", buttons as Any)]) - } - } - + public class Cons_keyboardButtonRow { + public var buttons: [Api.KeyboardButton] + public init(buttons: [Api.KeyboardButton]) { + self.buttons = buttons + } + } + case keyboardButtonRow(Cons_keyboardButtonRow) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .keyboardButtonRow(let _data): + if boxed { + buffer.appendInt32(2002815875) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.buttons.count)) + for item in _data.buttons { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .keyboardButtonRow(let _data): + return ("keyboardButtonRow", [("buttons", _data.buttons as Any)]) + } + } + public static func parse_keyboardButtonRow(_ reader: BufferReader) -> KeyboardButtonRow? { var _1: [Api.KeyboardButton]? if let _ = reader.readInt32() { @@ -31,38 +37,45 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.KeyboardButtonRow.keyboardButtonRow(buttons: _1!) + return Api.KeyboardButtonRow.keyboardButtonRow(Cons_keyboardButtonRow(buttons: _1!)) } else { return nil } } - } } public extension Api { enum LabeledPrice: TypeConstructorDescription { - case labeledPrice(label: String, amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .labeledPrice(let label, let amount): - if boxed { - buffer.appendInt32(-886477832) - } - serializeString(label, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .labeledPrice(let label, let amount): - return ("labeledPrice", [("label", label as Any), ("amount", amount as Any)]) - } - } - + public class Cons_labeledPrice { + public var label: String + public var amount: Int64 + public init(label: String, amount: Int64) { + self.label = label + self.amount = amount + } + } + case labeledPrice(Cons_labeledPrice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .labeledPrice(let _data): + if boxed { + buffer.appendInt32(-886477832) + } + serializeString(_data.label, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .labeledPrice(let _data): + return ("labeledPrice", [("label", _data.label as Any), ("amount", _data.amount as Any)]) + } + } + public static func parse_labeledPrice(_ reader: BufferReader) -> LabeledPrice? { var _1: String? _1 = parseString(reader) @@ -71,44 +84,55 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.LabeledPrice.labeledPrice(label: _1!, amount: _2!) + return Api.LabeledPrice.labeledPrice(Cons_labeledPrice(label: _1!, amount: _2!)) } else { return nil } } - } } public extension Api { enum LangPackDifference: TypeConstructorDescription { - case langPackDifference(langCode: String, fromVersion: Int32, version: Int32, strings: [Api.LangPackString]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .langPackDifference(let langCode, let fromVersion, let version, let strings): - if boxed { - buffer.appendInt32(-209337866) - } - serializeString(langCode, buffer: buffer, boxed: false) - serializeInt32(fromVersion, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(strings.count)) - for item in strings { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .langPackDifference(let langCode, let fromVersion, let version, let strings): - return ("langPackDifference", [("langCode", langCode as Any), ("fromVersion", fromVersion as Any), ("version", version as Any), ("strings", strings as Any)]) - } - } - + public class Cons_langPackDifference { + public var langCode: String + public var fromVersion: Int32 + public var version: Int32 + public var strings: [Api.LangPackString] + public init(langCode: String, fromVersion: Int32, version: Int32, strings: [Api.LangPackString]) { + self.langCode = langCode + self.fromVersion = fromVersion + self.version = version + self.strings = strings + } + } + case langPackDifference(Cons_langPackDifference) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .langPackDifference(let _data): + if boxed { + buffer.appendInt32(-209337866) + } + serializeString(_data.langCode, buffer: buffer, boxed: false) + serializeInt32(_data.fromVersion, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.strings.count)) + for item in _data.strings { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .langPackDifference(let _data): + return ("langPackDifference", [("langCode", _data.langCode as Any), ("fromVersion", _data.fromVersion as Any), ("version", _data.version as Any), ("strings", _data.strings as Any)]) + } + } + public static func parse_langPackDifference(_ reader: BufferReader) -> LangPackDifference? { var _1: String? _1 = parseString(reader) @@ -125,45 +149,68 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.LangPackDifference.langPackDifference(langCode: _1!, fromVersion: _2!, version: _3!, strings: _4!) + return Api.LangPackDifference.langPackDifference(Cons_langPackDifference(langCode: _1!, fromVersion: _2!, version: _3!, strings: _4!)) } else { return nil } } - } } public extension Api { enum LangPackLanguage: TypeConstructorDescription { - case langPackLanguage(flags: Int32, name: String, nativeName: String, langCode: String, baseLangCode: String?, pluralCode: String, stringsCount: Int32, translatedCount: Int32, translationsUrl: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .langPackLanguage(let flags, let name, let nativeName, let langCode, let baseLangCode, let pluralCode, let stringsCount, let translatedCount, let translationsUrl): - if boxed { - buffer.appendInt32(-288727837) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - serializeString(nativeName, buffer: buffer, boxed: false) - serializeString(langCode, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(baseLangCode!, buffer: buffer, boxed: false)} - serializeString(pluralCode, buffer: buffer, boxed: false) - serializeInt32(stringsCount, buffer: buffer, boxed: false) - serializeInt32(translatedCount, buffer: buffer, boxed: false) - serializeString(translationsUrl, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .langPackLanguage(let flags, let name, let nativeName, let langCode, let baseLangCode, let pluralCode, let stringsCount, let translatedCount, let translationsUrl): - return ("langPackLanguage", [("flags", flags as Any), ("name", name as Any), ("nativeName", nativeName as Any), ("langCode", langCode as Any), ("baseLangCode", baseLangCode as Any), ("pluralCode", pluralCode as Any), ("stringsCount", stringsCount as Any), ("translatedCount", translatedCount as Any), ("translationsUrl", translationsUrl as Any)]) - } - } - + public class Cons_langPackLanguage { + public var flags: Int32 + public var name: String + public var nativeName: String + public var langCode: String + public var baseLangCode: String? + public var pluralCode: String + public var stringsCount: Int32 + public var translatedCount: Int32 + public var translationsUrl: String + public init(flags: Int32, name: String, nativeName: String, langCode: String, baseLangCode: String?, pluralCode: String, stringsCount: Int32, translatedCount: Int32, translationsUrl: String) { + self.flags = flags + self.name = name + self.nativeName = nativeName + self.langCode = langCode + self.baseLangCode = baseLangCode + self.pluralCode = pluralCode + self.stringsCount = stringsCount + self.translatedCount = translatedCount + self.translationsUrl = translationsUrl + } + } + case langPackLanguage(Cons_langPackLanguage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .langPackLanguage(let _data): + if boxed { + buffer.appendInt32(-288727837) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + serializeString(_data.nativeName, buffer: buffer, boxed: false) + serializeString(_data.langCode, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.baseLangCode!, buffer: buffer, boxed: false) + } + serializeString(_data.pluralCode, buffer: buffer, boxed: false) + serializeInt32(_data.stringsCount, buffer: buffer, boxed: false) + serializeInt32(_data.translatedCount, buffer: buffer, boxed: false) + serializeString(_data.translationsUrl, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .langPackLanguage(let _data): + return ("langPackLanguage", [("flags", _data.flags as Any), ("name", _data.name as Any), ("nativeName", _data.nativeName as Any), ("langCode", _data.langCode as Any), ("baseLangCode", _data.baseLangCode as Any), ("pluralCode", _data.pluralCode as Any), ("stringsCount", _data.stringsCount as Any), ("translatedCount", _data.translatedCount as Any), ("translationsUrl", _data.translationsUrl as Any)]) + } + } + public static func parse_langPackLanguage(_ reader: BufferReader) -> LangPackLanguage? { var _1: Int32? _1 = reader.readInt32() @@ -174,7 +221,9 @@ public extension Api { var _4: String? _4 = parseString(reader) var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: String? _6 = parseString(reader) var _7: Int32? @@ -193,63 +242,106 @@ public extension Api { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.LangPackLanguage.langPackLanguage(flags: _1!, name: _2!, nativeName: _3!, langCode: _4!, baseLangCode: _5, pluralCode: _6!, stringsCount: _7!, translatedCount: _8!, translationsUrl: _9!) + return Api.LangPackLanguage.langPackLanguage(Cons_langPackLanguage(flags: _1!, name: _2!, nativeName: _3!, langCode: _4!, baseLangCode: _5, pluralCode: _6!, stringsCount: _7!, translatedCount: _8!, translationsUrl: _9!)) } else { return nil } } - } } public extension Api { enum LangPackString: TypeConstructorDescription { - case langPackString(key: String, value: String) - case langPackStringDeleted(key: String) - case langPackStringPluralized(flags: Int32, key: String, zeroValue: String?, oneValue: String?, twoValue: String?, fewValue: String?, manyValue: String?, otherValue: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .langPackString(let key, let value): - if boxed { - buffer.appendInt32(-892239370) - } - serializeString(key, buffer: buffer, boxed: false) - serializeString(value, buffer: buffer, boxed: false) - break - case .langPackStringDeleted(let key): - if boxed { - buffer.appendInt32(695856818) - } - serializeString(key, buffer: buffer, boxed: false) - break - case .langPackStringPluralized(let flags, let key, let zeroValue, let oneValue, let twoValue, let fewValue, let manyValue, let otherValue): - if boxed { - buffer.appendInt32(1816636575) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(key, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(zeroValue!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(oneValue!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(twoValue!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(fewValue!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(manyValue!, buffer: buffer, boxed: false)} - serializeString(otherValue, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .langPackString(let key, let value): - return ("langPackString", [("key", key as Any), ("value", value as Any)]) - case .langPackStringDeleted(let key): - return ("langPackStringDeleted", [("key", key as Any)]) - case .langPackStringPluralized(let flags, let key, let zeroValue, let oneValue, let twoValue, let fewValue, let manyValue, let otherValue): - return ("langPackStringPluralized", [("flags", flags as Any), ("key", key as Any), ("zeroValue", zeroValue as Any), ("oneValue", oneValue as Any), ("twoValue", twoValue as Any), ("fewValue", fewValue as Any), ("manyValue", manyValue as Any), ("otherValue", otherValue as Any)]) - } - } - + public class Cons_langPackString { + public var key: String + public var value: String + public init(key: String, value: String) { + self.key = key + self.value = value + } + } + public class Cons_langPackStringDeleted { + public var key: String + public init(key: String) { + self.key = key + } + } + public class Cons_langPackStringPluralized { + public var flags: Int32 + public var key: String + public var zeroValue: String? + public var oneValue: String? + public var twoValue: String? + public var fewValue: String? + public var manyValue: String? + public var otherValue: String + public init(flags: Int32, key: String, zeroValue: String?, oneValue: String?, twoValue: String?, fewValue: String?, manyValue: String?, otherValue: String) { + self.flags = flags + self.key = key + self.zeroValue = zeroValue + self.oneValue = oneValue + self.twoValue = twoValue + self.fewValue = fewValue + self.manyValue = manyValue + self.otherValue = otherValue + } + } + case langPackString(Cons_langPackString) + case langPackStringDeleted(Cons_langPackStringDeleted) + case langPackStringPluralized(Cons_langPackStringPluralized) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .langPackString(let _data): + if boxed { + buffer.appendInt32(-892239370) + } + serializeString(_data.key, buffer: buffer, boxed: false) + serializeString(_data.value, buffer: buffer, boxed: false) + break + case .langPackStringDeleted(let _data): + if boxed { + buffer.appendInt32(695856818) + } + serializeString(_data.key, buffer: buffer, boxed: false) + break + case .langPackStringPluralized(let _data): + if boxed { + buffer.appendInt32(1816636575) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.key, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.zeroValue!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.oneValue!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.twoValue!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.fewValue!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.manyValue!, buffer: buffer, boxed: false) + } + serializeString(_data.otherValue, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .langPackString(let _data): + return ("langPackString", [("key", _data.key as Any), ("value", _data.value as Any)]) + case .langPackStringDeleted(let _data): + return ("langPackStringDeleted", [("key", _data.key as Any)]) + case .langPackStringPluralized(let _data): + return ("langPackStringPluralized", [("flags", _data.flags as Any), ("key", _data.key as Any), ("zeroValue", _data.zeroValue as Any), ("oneValue", _data.oneValue as Any), ("twoValue", _data.twoValue as Any), ("fewValue", _data.fewValue as Any), ("manyValue", _data.manyValue as Any), ("otherValue", _data.otherValue as Any)]) + } + } + public static func parse_langPackString(_ reader: BufferReader) -> LangPackString? { var _1: String? _1 = parseString(reader) @@ -258,7 +350,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.LangPackString.langPackString(key: _1!, value: _2!) + return Api.LangPackString.langPackString(Cons_langPackString(key: _1!, value: _2!)) } else { return nil @@ -269,7 +361,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.LangPackString.langPackStringDeleted(key: _1!) + return Api.LangPackString.langPackStringDeleted(Cons_langPackStringDeleted(key: _1!)) } else { return nil @@ -281,15 +373,25 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 4) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = parseString(reader) + } var _8: String? _8 = parseString(reader) let _c1 = _1 != nil @@ -301,40 +403,51 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.LangPackString.langPackStringPluralized(flags: _1!, key: _2!, zeroValue: _3, oneValue: _4, twoValue: _5, fewValue: _6, manyValue: _7, otherValue: _8!) + return Api.LangPackString.langPackStringPluralized(Cons_langPackStringPluralized(flags: _1!, key: _2!, zeroValue: _3, oneValue: _4, twoValue: _5, fewValue: _6, manyValue: _7, otherValue: _8!)) } else { return nil } } - } } public extension Api { enum MaskCoords: TypeConstructorDescription { - case maskCoords(n: Int32, x: Double, y: Double, zoom: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .maskCoords(let n, let x, let y, let zoom): - if boxed { - buffer.appendInt32(-1361650766) - } - serializeInt32(n, buffer: buffer, boxed: false) - serializeDouble(x, buffer: buffer, boxed: false) - serializeDouble(y, buffer: buffer, boxed: false) - serializeDouble(zoom, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .maskCoords(let n, let x, let y, let zoom): - return ("maskCoords", [("n", n as Any), ("x", x as Any), ("y", y as Any), ("zoom", zoom as Any)]) - } - } - + public class Cons_maskCoords { + public var n: Int32 + public var x: Double + public var y: Double + public var zoom: Double + public init(n: Int32, x: Double, y: Double, zoom: Double) { + self.n = n + self.x = x + self.y = y + self.zoom = zoom + } + } + case maskCoords(Cons_maskCoords) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .maskCoords(let _data): + if boxed { + buffer.appendInt32(-1361650766) + } + serializeInt32(_data.n, buffer: buffer, boxed: false) + serializeDouble(_data.x, buffer: buffer, boxed: false) + serializeDouble(_data.y, buffer: buffer, boxed: false) + serializeDouble(_data.zoom, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .maskCoords(let _data): + return ("maskCoords", [("n", _data.n as Any), ("x", _data.x as Any), ("y", _data.y as Any), ("zoom", _data.zoom as Any)]) + } + } + public static func parse_maskCoords(_ reader: BufferReader) -> MaskCoords? { var _1: Int32? _1 = reader.readInt32() @@ -349,131 +462,230 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MaskCoords.maskCoords(n: _1!, x: _2!, y: _3!, zoom: _4!) + return Api.MaskCoords.maskCoords(Cons_maskCoords(n: _1!, x: _2!, y: _3!, zoom: _4!)) } else { return nil } } - } } public extension Api { indirect enum MediaArea: TypeConstructorDescription { - case inputMediaAreaChannelPost(coordinates: Api.MediaAreaCoordinates, channel: Api.InputChannel, msgId: Int32) - case inputMediaAreaVenue(coordinates: Api.MediaAreaCoordinates, queryId: Int64, resultId: String) - case mediaAreaChannelPost(coordinates: Api.MediaAreaCoordinates, channelId: Int64, msgId: Int32) - case mediaAreaGeoPoint(flags: Int32, coordinates: Api.MediaAreaCoordinates, geo: Api.GeoPoint, address: Api.GeoPointAddress?) - case mediaAreaStarGift(coordinates: Api.MediaAreaCoordinates, slug: String) - case mediaAreaSuggestedReaction(flags: Int32, coordinates: Api.MediaAreaCoordinates, reaction: Api.Reaction) - case mediaAreaUrl(coordinates: Api.MediaAreaCoordinates, url: String) - case mediaAreaVenue(coordinates: Api.MediaAreaCoordinates, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) - case mediaAreaWeather(coordinates: Api.MediaAreaCoordinates, emoji: String, temperatureC: Double, color: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputMediaAreaChannelPost(let coordinates, let channel, let msgId): - if boxed { - buffer.appendInt32(577893055) - } - coordinates.serialize(buffer, true) - channel.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - break - case .inputMediaAreaVenue(let coordinates, let queryId, let resultId): - if boxed { - buffer.appendInt32(-1300094593) - } - coordinates.serialize(buffer, true) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeString(resultId, buffer: buffer, boxed: false) - break - case .mediaAreaChannelPost(let coordinates, let channelId, let msgId): - if boxed { - buffer.appendInt32(1996756655) - } - coordinates.serialize(buffer, true) - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(msgId, buffer: buffer, boxed: false) - break - case .mediaAreaGeoPoint(let flags, let coordinates, let geo, let address): - if boxed { - buffer.appendInt32(-891992787) - } - serializeInt32(flags, buffer: buffer, boxed: false) - coordinates.serialize(buffer, true) - geo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {address!.serialize(buffer, true)} - break - case .mediaAreaStarGift(let coordinates, let slug): - if boxed { - buffer.appendInt32(1468491885) - } - coordinates.serialize(buffer, true) - serializeString(slug, buffer: buffer, boxed: false) - break - case .mediaAreaSuggestedReaction(let flags, let coordinates, let reaction): - if boxed { - buffer.appendInt32(340088945) - } - serializeInt32(flags, buffer: buffer, boxed: false) - coordinates.serialize(buffer, true) - reaction.serialize(buffer, true) - break - case .mediaAreaUrl(let coordinates, let url): - if boxed { - buffer.appendInt32(926421125) - } - coordinates.serialize(buffer, true) - serializeString(url, buffer: buffer, boxed: false) - break - case .mediaAreaVenue(let coordinates, let geo, let title, let address, let provider, let venueId, let venueType): - if boxed { - buffer.appendInt32(-1098720356) - } - coordinates.serialize(buffer, true) - geo.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(address, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - serializeString(venueId, buffer: buffer, boxed: false) - serializeString(venueType, buffer: buffer, boxed: false) - break - case .mediaAreaWeather(let coordinates, let emoji, let temperatureC, let color): - if boxed { - buffer.appendInt32(1235637404) - } - coordinates.serialize(buffer, true) - serializeString(emoji, buffer: buffer, boxed: false) - serializeDouble(temperatureC, buffer: buffer, boxed: false) - serializeInt32(color, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputMediaAreaChannelPost(let coordinates, let channel, let msgId): - return ("inputMediaAreaChannelPost", [("coordinates", coordinates as Any), ("channel", channel as Any), ("msgId", msgId as Any)]) - case .inputMediaAreaVenue(let coordinates, let queryId, let resultId): - return ("inputMediaAreaVenue", [("coordinates", coordinates as Any), ("queryId", queryId as Any), ("resultId", resultId as Any)]) - case .mediaAreaChannelPost(let coordinates, let channelId, let msgId): - return ("mediaAreaChannelPost", [("coordinates", coordinates as Any), ("channelId", channelId as Any), ("msgId", msgId as Any)]) - case .mediaAreaGeoPoint(let flags, let coordinates, let geo, let address): - return ("mediaAreaGeoPoint", [("flags", flags as Any), ("coordinates", coordinates as Any), ("geo", geo as Any), ("address", address as Any)]) - case .mediaAreaStarGift(let coordinates, let slug): - return ("mediaAreaStarGift", [("coordinates", coordinates as Any), ("slug", slug as Any)]) - case .mediaAreaSuggestedReaction(let flags, let coordinates, let reaction): - return ("mediaAreaSuggestedReaction", [("flags", flags as Any), ("coordinates", coordinates as Any), ("reaction", reaction as Any)]) - case .mediaAreaUrl(let coordinates, let url): - return ("mediaAreaUrl", [("coordinates", coordinates as Any), ("url", url as Any)]) - case .mediaAreaVenue(let coordinates, let geo, let title, let address, let provider, let venueId, let venueType): - return ("mediaAreaVenue", [("coordinates", coordinates as Any), ("geo", geo as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any)]) - case .mediaAreaWeather(let coordinates, let emoji, let temperatureC, let color): - return ("mediaAreaWeather", [("coordinates", coordinates as Any), ("emoji", emoji as Any), ("temperatureC", temperatureC as Any), ("color", color as Any)]) - } - } - + public class Cons_inputMediaAreaChannelPost { + public var coordinates: Api.MediaAreaCoordinates + public var channel: Api.InputChannel + public var msgId: Int32 + public init(coordinates: Api.MediaAreaCoordinates, channel: Api.InputChannel, msgId: Int32) { + self.coordinates = coordinates + self.channel = channel + self.msgId = msgId + } + } + public class Cons_inputMediaAreaVenue { + public var coordinates: Api.MediaAreaCoordinates + public var queryId: Int64 + public var resultId: String + public init(coordinates: Api.MediaAreaCoordinates, queryId: Int64, resultId: String) { + self.coordinates = coordinates + self.queryId = queryId + self.resultId = resultId + } + } + public class Cons_mediaAreaChannelPost { + public var coordinates: Api.MediaAreaCoordinates + public var channelId: Int64 + public var msgId: Int32 + public init(coordinates: Api.MediaAreaCoordinates, channelId: Int64, msgId: Int32) { + self.coordinates = coordinates + self.channelId = channelId + self.msgId = msgId + } + } + public class Cons_mediaAreaGeoPoint { + public var flags: Int32 + public var coordinates: Api.MediaAreaCoordinates + public var geo: Api.GeoPoint + public var address: Api.GeoPointAddress? + public init(flags: Int32, coordinates: Api.MediaAreaCoordinates, geo: Api.GeoPoint, address: Api.GeoPointAddress?) { + self.flags = flags + self.coordinates = coordinates + self.geo = geo + self.address = address + } + } + public class Cons_mediaAreaStarGift { + public var coordinates: Api.MediaAreaCoordinates + public var slug: String + public init(coordinates: Api.MediaAreaCoordinates, slug: String) { + self.coordinates = coordinates + self.slug = slug + } + } + public class Cons_mediaAreaSuggestedReaction { + public var flags: Int32 + public var coordinates: Api.MediaAreaCoordinates + public var reaction: Api.Reaction + public init(flags: Int32, coordinates: Api.MediaAreaCoordinates, reaction: Api.Reaction) { + self.flags = flags + self.coordinates = coordinates + self.reaction = reaction + } + } + public class Cons_mediaAreaUrl { + public var coordinates: Api.MediaAreaCoordinates + public var url: String + public init(coordinates: Api.MediaAreaCoordinates, url: String) { + self.coordinates = coordinates + self.url = url + } + } + public class Cons_mediaAreaVenue { + public var coordinates: Api.MediaAreaCoordinates + public var geo: Api.GeoPoint + public var title: String + public var address: String + public var provider: String + public var venueId: String + public var venueType: String + public init(coordinates: Api.MediaAreaCoordinates, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) { + self.coordinates = coordinates + self.geo = geo + self.title = title + self.address = address + self.provider = provider + self.venueId = venueId + self.venueType = venueType + } + } + public class Cons_mediaAreaWeather { + public var coordinates: Api.MediaAreaCoordinates + public var emoji: String + public var temperatureC: Double + public var color: Int32 + public init(coordinates: Api.MediaAreaCoordinates, emoji: String, temperatureC: Double, color: Int32) { + self.coordinates = coordinates + self.emoji = emoji + self.temperatureC = temperatureC + self.color = color + } + } + case inputMediaAreaChannelPost(Cons_inputMediaAreaChannelPost) + case inputMediaAreaVenue(Cons_inputMediaAreaVenue) + case mediaAreaChannelPost(Cons_mediaAreaChannelPost) + case mediaAreaGeoPoint(Cons_mediaAreaGeoPoint) + case mediaAreaStarGift(Cons_mediaAreaStarGift) + case mediaAreaSuggestedReaction(Cons_mediaAreaSuggestedReaction) + case mediaAreaUrl(Cons_mediaAreaUrl) + case mediaAreaVenue(Cons_mediaAreaVenue) + case mediaAreaWeather(Cons_mediaAreaWeather) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMediaAreaChannelPost(let _data): + if boxed { + buffer.appendInt32(577893055) + } + _data.coordinates.serialize(buffer, true) + _data.channel.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + case .inputMediaAreaVenue(let _data): + if boxed { + buffer.appendInt32(-1300094593) + } + _data.coordinates.serialize(buffer, true) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeString(_data.resultId, buffer: buffer, boxed: false) + break + case .mediaAreaChannelPost(let _data): + if boxed { + buffer.appendInt32(1996756655) + } + _data.coordinates.serialize(buffer, true) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + case .mediaAreaGeoPoint(let _data): + if boxed { + buffer.appendInt32(-891992787) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.coordinates.serialize(buffer, true) + _data.geo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.address!.serialize(buffer, true) + } + break + case .mediaAreaStarGift(let _data): + if boxed { + buffer.appendInt32(1468491885) + } + _data.coordinates.serialize(buffer, true) + serializeString(_data.slug, buffer: buffer, boxed: false) + break + case .mediaAreaSuggestedReaction(let _data): + if boxed { + buffer.appendInt32(340088945) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.coordinates.serialize(buffer, true) + _data.reaction.serialize(buffer, true) + break + case .mediaAreaUrl(let _data): + if boxed { + buffer.appendInt32(926421125) + } + _data.coordinates.serialize(buffer, true) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .mediaAreaVenue(let _data): + if boxed { + buffer.appendInt32(-1098720356) + } + _data.coordinates.serialize(buffer, true) + _data.geo.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.address, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + serializeString(_data.venueId, buffer: buffer, boxed: false) + serializeString(_data.venueType, buffer: buffer, boxed: false) + break + case .mediaAreaWeather(let _data): + if boxed { + buffer.appendInt32(1235637404) + } + _data.coordinates.serialize(buffer, true) + serializeString(_data.emoji, buffer: buffer, boxed: false) + serializeDouble(_data.temperatureC, buffer: buffer, boxed: false) + serializeInt32(_data.color, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMediaAreaChannelPost(let _data): + return ("inputMediaAreaChannelPost", [("coordinates", _data.coordinates as Any), ("channel", _data.channel as Any), ("msgId", _data.msgId as Any)]) + case .inputMediaAreaVenue(let _data): + return ("inputMediaAreaVenue", [("coordinates", _data.coordinates as Any), ("queryId", _data.queryId as Any), ("resultId", _data.resultId as Any)]) + case .mediaAreaChannelPost(let _data): + return ("mediaAreaChannelPost", [("coordinates", _data.coordinates as Any), ("channelId", _data.channelId as Any), ("msgId", _data.msgId as Any)]) + case .mediaAreaGeoPoint(let _data): + return ("mediaAreaGeoPoint", [("flags", _data.flags as Any), ("coordinates", _data.coordinates as Any), ("geo", _data.geo as Any), ("address", _data.address as Any)]) + case .mediaAreaStarGift(let _data): + return ("mediaAreaStarGift", [("coordinates", _data.coordinates as Any), ("slug", _data.slug as Any)]) + case .mediaAreaSuggestedReaction(let _data): + return ("mediaAreaSuggestedReaction", [("flags", _data.flags as Any), ("coordinates", _data.coordinates as Any), ("reaction", _data.reaction as Any)]) + case .mediaAreaUrl(let _data): + return ("mediaAreaUrl", [("coordinates", _data.coordinates as Any), ("url", _data.url as Any)]) + case .mediaAreaVenue(let _data): + return ("mediaAreaVenue", [("coordinates", _data.coordinates as Any), ("geo", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + case .mediaAreaWeather(let _data): + return ("mediaAreaWeather", [("coordinates", _data.coordinates as Any), ("emoji", _data.emoji as Any), ("temperatureC", _data.temperatureC as Any), ("color", _data.color as Any)]) + } + } + public static func parse_inputMediaAreaChannelPost(_ reader: BufferReader) -> MediaArea? { var _1: Api.MediaAreaCoordinates? if let signature = reader.readInt32() { @@ -489,7 +701,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MediaArea.inputMediaAreaChannelPost(coordinates: _1!, channel: _2!, msgId: _3!) + return Api.MediaArea.inputMediaAreaChannelPost(Cons_inputMediaAreaChannelPost(coordinates: _1!, channel: _2!, msgId: _3!)) } else { return nil @@ -508,7 +720,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MediaArea.inputMediaAreaVenue(coordinates: _1!, queryId: _2!, resultId: _3!) + return Api.MediaArea.inputMediaAreaVenue(Cons_inputMediaAreaVenue(coordinates: _1!, queryId: _2!, resultId: _3!)) } else { return nil @@ -527,7 +739,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MediaArea.mediaAreaChannelPost(coordinates: _1!, channelId: _2!, msgId: _3!) + return Api.MediaArea.mediaAreaChannelPost(Cons_mediaAreaChannelPost(coordinates: _1!, channelId: _2!, msgId: _3!)) } else { return nil @@ -545,15 +757,17 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.GeoPoint } var _4: Api.GeoPointAddress? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.GeoPointAddress - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.GeoPointAddress + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MediaArea.mediaAreaGeoPoint(flags: _1!, coordinates: _2!, geo: _3!, address: _4) + return Api.MediaArea.mediaAreaGeoPoint(Cons_mediaAreaGeoPoint(flags: _1!, coordinates: _2!, geo: _3!, address: _4)) } else { return nil @@ -569,7 +783,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MediaArea.mediaAreaStarGift(coordinates: _1!, slug: _2!) + return Api.MediaArea.mediaAreaStarGift(Cons_mediaAreaStarGift(coordinates: _1!, slug: _2!)) } else { return nil @@ -590,7 +804,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MediaArea.mediaAreaSuggestedReaction(flags: _1!, coordinates: _2!, reaction: _3!) + return Api.MediaArea.mediaAreaSuggestedReaction(Cons_mediaAreaSuggestedReaction(flags: _1!, coordinates: _2!, reaction: _3!)) } else { return nil @@ -606,7 +820,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MediaArea.mediaAreaUrl(coordinates: _1!, url: _2!) + return Api.MediaArea.mediaAreaUrl(Cons_mediaAreaUrl(coordinates: _1!, url: _2!)) } else { return nil @@ -639,7 +853,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MediaArea.mediaAreaVenue(coordinates: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!) + return Api.MediaArea.mediaAreaVenue(Cons_mediaAreaVenue(coordinates: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!)) } else { return nil @@ -661,43 +875,62 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MediaArea.mediaAreaWeather(coordinates: _1!, emoji: _2!, temperatureC: _3!, color: _4!) + return Api.MediaArea.mediaAreaWeather(Cons_mediaAreaWeather(coordinates: _1!, emoji: _2!, temperatureC: _3!, color: _4!)) } else { return nil } } - } } public extension Api { enum MediaAreaCoordinates: TypeConstructorDescription { - case mediaAreaCoordinates(flags: Int32, x: Double, y: Double, w: Double, h: Double, rotation: Double, radius: Double?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .mediaAreaCoordinates(let flags, let x, let y, let w, let h, let rotation, let radius): - if boxed { - buffer.appendInt32(-808853502) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeDouble(x, buffer: buffer, boxed: false) - serializeDouble(y, buffer: buffer, boxed: false) - serializeDouble(w, buffer: buffer, boxed: false) - serializeDouble(h, buffer: buffer, boxed: false) - serializeDouble(rotation, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeDouble(radius!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .mediaAreaCoordinates(let flags, let x, let y, let w, let h, let rotation, let radius): - return ("mediaAreaCoordinates", [("flags", flags as Any), ("x", x as Any), ("y", y as Any), ("w", w as Any), ("h", h as Any), ("rotation", rotation as Any), ("radius", radius as Any)]) - } - } - + public class Cons_mediaAreaCoordinates { + public var flags: Int32 + public var x: Double + public var y: Double + public var w: Double + public var h: Double + public var rotation: Double + public var radius: Double? + public init(flags: Int32, x: Double, y: Double, w: Double, h: Double, rotation: Double, radius: Double?) { + self.flags = flags + self.x = x + self.y = y + self.w = w + self.h = h + self.rotation = rotation + self.radius = radius + } + } + case mediaAreaCoordinates(Cons_mediaAreaCoordinates) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .mediaAreaCoordinates(let _data): + if boxed { + buffer.appendInt32(-808853502) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeDouble(_data.x, buffer: buffer, boxed: false) + serializeDouble(_data.y, buffer: buffer, boxed: false) + serializeDouble(_data.w, buffer: buffer, boxed: false) + serializeDouble(_data.h, buffer: buffer, boxed: false) + serializeDouble(_data.rotation, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeDouble(_data.radius!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .mediaAreaCoordinates(let _data): + return ("mediaAreaCoordinates", [("flags", _data.flags as Any), ("x", _data.x as Any), ("y", _data.y as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("rotation", _data.rotation as Any), ("radius", _data.radius as Any)]) + } + } + public static func parse_mediaAreaCoordinates(_ reader: BufferReader) -> MediaAreaCoordinates? { var _1: Int32? _1 = reader.readInt32() @@ -712,7 +945,9 @@ public extension Api { var _6: Double? _6 = reader.readDouble() var _7: Double? - if Int(_1!) & Int(1 << 0) != 0 {_7 = reader.readDouble() } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = reader.readDouble() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -721,106 +956,275 @@ public extension Api { let _c6 = _6 != nil let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MediaAreaCoordinates.mediaAreaCoordinates(flags: _1!, x: _2!, y: _3!, w: _4!, h: _5!, rotation: _6!, radius: _7) + return Api.MediaAreaCoordinates.mediaAreaCoordinates(Cons_mediaAreaCoordinates(flags: _1!, x: _2!, y: _3!, w: _4!, h: _5!, rotation: _6!, radius: _7)) } else { return nil } } - } } public extension Api { indirect enum Message: TypeConstructorDescription { - case message(flags: Int32, flags2: Int32, id: Int32, fromId: Api.Peer?, fromBoostsApplied: Int32?, peerId: Api.Peer, savedPeerId: Api.Peer?, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, viaBusinessBotId: Int64?, replyTo: Api.MessageReplyHeader?, date: Int32, message: String, media: Api.MessageMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, views: Int32?, forwards: Int32?, replies: Api.MessageReplies?, editDate: Int32?, postAuthor: String?, groupedId: Int64?, reactions: Api.MessageReactions?, restrictionReason: [Api.RestrictionReason]?, ttlPeriod: Int32?, quickReplyShortcutId: Int32?, effect: Int64?, factcheck: Api.FactCheck?, reportDeliveryUntilDate: Int32?, paidMessageStars: Int64?, suggestedPost: Api.SuggestedPost?, scheduleRepeatPeriod: Int32?, summaryFromLanguage: String?) - case messageEmpty(flags: Int32, id: Int32, peerId: Api.Peer?) - case messageService(flags: Int32, id: Int32, fromId: Api.Peer?, peerId: Api.Peer, savedPeerId: Api.Peer?, replyTo: Api.MessageReplyHeader?, date: Int32, action: Api.MessageAction, reactions: Api.MessageReactions?, ttlPeriod: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .message(let flags, let flags2, let id, let fromId, let fromBoostsApplied, let peerId, let savedPeerId, let fwdFrom, let viaBotId, let viaBusinessBotId, let replyTo, let date, let message, let media, let replyMarkup, let entities, let views, let forwards, let replies, let editDate, let postAuthor, let groupedId, let reactions, let restrictionReason, let ttlPeriod, let quickReplyShortcutId, let effect, let factcheck, let reportDeliveryUntilDate, let paidMessageStars, let suggestedPost, let scheduleRepeatPeriod, let summaryFromLanguage): - if boxed { - buffer.appendInt32(-1665888023) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(flags2, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 8) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 29) != 0 {serializeInt32(fromBoostsApplied!, buffer: buffer, boxed: false)} - peerId.serialize(buffer, true) - if Int(flags) & Int(1 << 28) != 0 {savedPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {fwdFrom!.serialize(buffer, true)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt64(viaBotId!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 0) != 0 {serializeInt64(viaBusinessBotId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {replyTo!.serialize(buffer, true)} - serializeInt32(date, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 9) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {replyMarkup!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_message { + public var flags: Int32 + public var flags2: Int32 + public var id: Int32 + public var fromId: Api.Peer? + public var fromBoostsApplied: Int32? + public var peerId: Api.Peer + public var savedPeerId: Api.Peer? + public var fwdFrom: Api.MessageFwdHeader? + public var viaBotId: Int64? + public var viaBusinessBotId: Int64? + public var replyTo: Api.MessageReplyHeader? + public var date: Int32 + public var message: String + public var media: Api.MessageMedia? + public var replyMarkup: Api.ReplyMarkup? + public var entities: [Api.MessageEntity]? + public var views: Int32? + public var forwards: Int32? + public var replies: Api.MessageReplies? + public var editDate: Int32? + public var postAuthor: String? + public var groupedId: Int64? + public var reactions: Api.MessageReactions? + public var restrictionReason: [Api.RestrictionReason]? + public var ttlPeriod: Int32? + public var quickReplyShortcutId: Int32? + public var effect: Int64? + public var factcheck: Api.FactCheck? + public var reportDeliveryUntilDate: Int32? + public var paidMessageStars: Int64? + public var suggestedPost: Api.SuggestedPost? + public var scheduleRepeatPeriod: Int32? + public var summaryFromLanguage: String? + public init(flags: Int32, flags2: Int32, id: Int32, fromId: Api.Peer?, fromBoostsApplied: Int32?, peerId: Api.Peer, savedPeerId: Api.Peer?, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, viaBusinessBotId: Int64?, replyTo: Api.MessageReplyHeader?, date: Int32, message: String, media: Api.MessageMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, views: Int32?, forwards: Int32?, replies: Api.MessageReplies?, editDate: Int32?, postAuthor: String?, groupedId: Int64?, reactions: Api.MessageReactions?, restrictionReason: [Api.RestrictionReason]?, ttlPeriod: Int32?, quickReplyShortcutId: Int32?, effect: Int64?, factcheck: Api.FactCheck?, reportDeliveryUntilDate: Int32?, paidMessageStars: Int64?, suggestedPost: Api.SuggestedPost?, scheduleRepeatPeriod: Int32?, summaryFromLanguage: String?) { + self.flags = flags + self.flags2 = flags2 + self.id = id + self.fromId = fromId + self.fromBoostsApplied = fromBoostsApplied + self.peerId = peerId + self.savedPeerId = savedPeerId + self.fwdFrom = fwdFrom + self.viaBotId = viaBotId + self.viaBusinessBotId = viaBusinessBotId + self.replyTo = replyTo + self.date = date + self.message = message + self.media = media + self.replyMarkup = replyMarkup + self.entities = entities + self.views = views + self.forwards = forwards + self.replies = replies + self.editDate = editDate + self.postAuthor = postAuthor + self.groupedId = groupedId + self.reactions = reactions + self.restrictionReason = restrictionReason + self.ttlPeriod = ttlPeriod + self.quickReplyShortcutId = quickReplyShortcutId + self.effect = effect + self.factcheck = factcheck + self.reportDeliveryUntilDate = reportDeliveryUntilDate + self.paidMessageStars = paidMessageStars + self.suggestedPost = suggestedPost + self.scheduleRepeatPeriod = scheduleRepeatPeriod + self.summaryFromLanguage = summaryFromLanguage + } + } + public class Cons_messageEmpty { + public var flags: Int32 + public var id: Int32 + public var peerId: Api.Peer? + public init(flags: Int32, id: Int32, peerId: Api.Peer?) { + self.flags = flags + self.id = id + self.peerId = peerId + } + } + public class Cons_messageService { + public var flags: Int32 + public var id: Int32 + public var fromId: Api.Peer? + public var peerId: Api.Peer + public var savedPeerId: Api.Peer? + public var replyTo: Api.MessageReplyHeader? + public var date: Int32 + public var action: Api.MessageAction + public var reactions: Api.MessageReactions? + public var ttlPeriod: Int32? + public init(flags: Int32, id: Int32, fromId: Api.Peer?, peerId: Api.Peer, savedPeerId: Api.Peer?, replyTo: Api.MessageReplyHeader?, date: Int32, action: Api.MessageAction, reactions: Api.MessageReactions?, ttlPeriod: Int32?) { + self.flags = flags + self.id = id + self.fromId = fromId + self.peerId = peerId + self.savedPeerId = savedPeerId + self.replyTo = replyTo + self.date = date + self.action = action + self.reactions = reactions + self.ttlPeriod = ttlPeriod + } + } + case message(Cons_message) + case messageEmpty(Cons_messageEmpty) + case messageService(Cons_messageService) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .message(let _data): + if boxed { + buffer.appendInt32(-1665888023) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.flags2, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 29) != 0 { + serializeInt32(_data.fromBoostsApplied!, buffer: buffer, boxed: false) + } + _data.peerId.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 28) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.fwdFrom!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.viaBotId!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 0) != 0 { + serializeInt64(_data.viaBusinessBotId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.replyTo!.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.media!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(views!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(forwards!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 23) != 0 {replies!.serialize(buffer, true)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(editDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 16) != 0 {serializeString(postAuthor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt64(groupedId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 20) != 0 {reactions!.serialize(buffer, true)} - if Int(flags) & Int(1 << 22) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(restrictionReason!.count)) - for item in restrictionReason! { + } + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.views!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.forwards!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 23) != 0 { + _data.replies!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.editDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.postAuthor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + serializeInt64(_data.groupedId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 20) != 0 { + _data.reactions!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 22) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.restrictionReason!.count)) + for item in _data.restrictionReason! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 25) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 30) != 0 {serializeInt32(quickReplyShortcutId!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 2) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 3) != 0 {factcheck!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 5) != 0 {serializeInt32(reportDeliveryUntilDate!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 6) != 0 {serializeInt64(paidMessageStars!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 7) != 0 {suggestedPost!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 10) != 0 {serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 11) != 0 {serializeString(summaryFromLanguage!, buffer: buffer, boxed: false)} - break - case .messageEmpty(let flags, let id, let peerId): - if boxed { - buffer.appendInt32(-1868117372) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {peerId!.serialize(buffer, true)} - break - case .messageService(let flags, let id, let fromId, let peerId, let savedPeerId, let replyTo, let date, let action, let reactions, let ttlPeriod): - if boxed { - buffer.appendInt32(2055212554) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 8) != 0 {fromId!.serialize(buffer, true)} - peerId.serialize(buffer, true) - if Int(flags) & Int(1 << 28) != 0 {savedPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {replyTo!.serialize(buffer, true)} - serializeInt32(date, buffer: buffer, boxed: false) - action.serialize(buffer, true) - if Int(flags) & Int(1 << 20) != 0 {reactions!.serialize(buffer, true)} - if Int(flags) & Int(1 << 25) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .message(let flags, let flags2, let id, let fromId, let fromBoostsApplied, let peerId, let savedPeerId, let fwdFrom, let viaBotId, let viaBusinessBotId, let replyTo, let date, let message, let media, let replyMarkup, let entities, let views, let forwards, let replies, let editDate, let postAuthor, let groupedId, let reactions, let restrictionReason, let ttlPeriod, let quickReplyShortcutId, let effect, let factcheck, let reportDeliveryUntilDate, let paidMessageStars, let suggestedPost, let scheduleRepeatPeriod, let summaryFromLanguage): - return ("message", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("fromId", fromId as Any), ("fromBoostsApplied", fromBoostsApplied as Any), ("peerId", peerId as Any), ("savedPeerId", savedPeerId as Any), ("fwdFrom", fwdFrom as Any), ("viaBotId", viaBotId as Any), ("viaBusinessBotId", viaBusinessBotId as Any), ("replyTo", replyTo as Any), ("date", date as Any), ("message", message as Any), ("media", media as Any), ("replyMarkup", replyMarkup as Any), ("entities", entities as Any), ("views", views as Any), ("forwards", forwards as Any), ("replies", replies as Any), ("editDate", editDate as Any), ("postAuthor", postAuthor as Any), ("groupedId", groupedId as Any), ("reactions", reactions as Any), ("restrictionReason", restrictionReason as Any), ("ttlPeriod", ttlPeriod as Any), ("quickReplyShortcutId", quickReplyShortcutId as Any), ("effect", effect as Any), ("factcheck", factcheck as Any), ("reportDeliveryUntilDate", reportDeliveryUntilDate as Any), ("paidMessageStars", paidMessageStars as Any), ("suggestedPost", suggestedPost as Any), ("scheduleRepeatPeriod", scheduleRepeatPeriod as Any), ("summaryFromLanguage", summaryFromLanguage as Any)]) - case .messageEmpty(let flags, let id, let peerId): - return ("messageEmpty", [("flags", flags as Any), ("id", id as Any), ("peerId", peerId as Any)]) - case .messageService(let flags, let id, let fromId, let peerId, let savedPeerId, let replyTo, let date, let action, let reactions, let ttlPeriod): - return ("messageService", [("flags", flags as Any), ("id", id as Any), ("fromId", fromId as Any), ("peerId", peerId as Any), ("savedPeerId", savedPeerId as Any), ("replyTo", replyTo as Any), ("date", date as Any), ("action", action as Any), ("reactions", reactions as Any), ("ttlPeriod", ttlPeriod as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 30) != 0 { + serializeInt32(_data.quickReplyShortcutId!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 2) != 0 { + serializeInt64(_data.effect!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 3) != 0 { + _data.factcheck!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 5) != 0 { + serializeInt32(_data.reportDeliveryUntilDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 6) != 0 { + serializeInt64(_data.paidMessageStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 7) != 0 { + _data.suggestedPost!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 10) != 0 { + serializeInt32(_data.scheduleRepeatPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 11) != 0 { + serializeString(_data.summaryFromLanguage!, buffer: buffer, boxed: false) + } + break + case .messageEmpty(let _data): + if boxed { + buffer.appendInt32(-1868117372) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.peerId!.serialize(buffer, true) + } + break + case .messageService(let _data): + if boxed { + buffer.appendInt32(2055212554) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.fromId!.serialize(buffer, true) + } + _data.peerId.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 28) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.replyTo!.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.action.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 20) != 0 { + _data.reactions!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .message(let _data): + return ("message", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("fromBoostsApplied", _data.fromBoostsApplied as Any), ("peerId", _data.peerId as Any), ("savedPeerId", _data.savedPeerId as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("viaBusinessBotId", _data.viaBusinessBotId as Any), ("replyTo", _data.replyTo as Any), ("date", _data.date as Any), ("message", _data.message as Any), ("media", _data.media as Any), ("replyMarkup", _data.replyMarkup as Any), ("entities", _data.entities as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("replies", _data.replies as Any), ("editDate", _data.editDate as Any), ("postAuthor", _data.postAuthor as Any), ("groupedId", _data.groupedId as Any), ("reactions", _data.reactions as Any), ("restrictionReason", _data.restrictionReason as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("quickReplyShortcutId", _data.quickReplyShortcutId as Any), ("effect", _data.effect as Any), ("factcheck", _data.factcheck as Any), ("reportDeliveryUntilDate", _data.reportDeliveryUntilDate as Any), ("paidMessageStars", _data.paidMessageStars as Any), ("suggestedPost", _data.suggestedPost as Any), ("scheduleRepeatPeriod", _data.scheduleRepeatPeriod as Any), ("summaryFromLanguage", _data.summaryFromLanguage as Any)]) + case .messageEmpty(let _data): + return ("messageEmpty", [("flags", _data.flags as Any), ("id", _data.id as Any), ("peerId", _data.peerId as Any)]) + case .messageService(let _data): + return ("messageService", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("peerId", _data.peerId as Any), ("savedPeerId", _data.savedPeerId as Any), ("replyTo", _data.replyTo as Any), ("date", _data.date as Any), ("action", _data.action as Any), ("reactions", _data.reactions as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + } + } + public static func parse_message(_ reader: BufferReader) -> Message? { var _1: Int32? _1 = reader.readInt32() @@ -829,91 +1233,145 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.Peer? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _5: Int32? - if Int(_1!) & Int(1 << 29) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 29) != 0 { + _5 = reader.readInt32() + } var _6: Api.Peer? if let signature = reader.readInt32() { _6 = Api.parse(reader, signature: signature) as? Api.Peer } var _7: Api.Peer? - if Int(_1!) & Int(1 << 28) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 28) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _8: Api.MessageFwdHeader? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + } + } var _9: Int64? - if Int(_1!) & Int(1 << 11) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 11) != 0 { + _9 = reader.readInt64() + } var _10: Int64? - if Int(_2!) & Int(1 << 0) != 0 {_10 = reader.readInt64() } + if Int(_2!) & Int(1 << 0) != 0 { + _10 = reader.readInt64() + } var _11: Api.MessageReplyHeader? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader + } + } var _12: Int32? _12 = reader.readInt32() var _13: String? _13 = parseString(reader) var _14: Api.MessageMedia? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _14 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _14 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } var _15: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } var _16: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 7) != 0 {if let _ = reader.readInt32() { - _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _17: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_17 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _17 = reader.readInt32() + } var _18: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_18 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _18 = reader.readInt32() + } var _19: Api.MessageReplies? - if Int(_1!) & Int(1 << 23) != 0 {if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.MessageReplies - } } + if Int(_1!) & Int(1 << 23) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.MessageReplies + } + } var _20: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_20 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _20 = reader.readInt32() + } var _21: String? - if Int(_1!) & Int(1 << 16) != 0 {_21 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _21 = parseString(reader) + } var _22: Int64? - if Int(_1!) & Int(1 << 17) != 0 {_22 = reader.readInt64() } + if Int(_1!) & Int(1 << 17) != 0 { + _22 = reader.readInt64() + } var _23: Api.MessageReactions? - if Int(_1!) & Int(1 << 20) != 0 {if let signature = reader.readInt32() { - _23 = Api.parse(reader, signature: signature) as? Api.MessageReactions - } } + if Int(_1!) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _23 = Api.parse(reader, signature: signature) as? Api.MessageReactions + } + } var _24: [Api.RestrictionReason]? - if Int(_1!) & Int(1 << 22) != 0 {if let _ = reader.readInt32() { - _24 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) - } } + if Int(_1!) & Int(1 << 22) != 0 { + if let _ = reader.readInt32() { + _24 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) + } + } var _25: Int32? - if Int(_1!) & Int(1 << 25) != 0 {_25 = reader.readInt32() } + if Int(_1!) & Int(1 << 25) != 0 { + _25 = reader.readInt32() + } var _26: Int32? - if Int(_1!) & Int(1 << 30) != 0 {_26 = reader.readInt32() } + if Int(_1!) & Int(1 << 30) != 0 { + _26 = reader.readInt32() + } var _27: Int64? - if Int(_2!) & Int(1 << 2) != 0 {_27 = reader.readInt64() } + if Int(_2!) & Int(1 << 2) != 0 { + _27 = reader.readInt64() + } var _28: Api.FactCheck? - if Int(_2!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _28 = Api.parse(reader, signature: signature) as? Api.FactCheck - } } + if Int(_2!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _28 = Api.parse(reader, signature: signature) as? Api.FactCheck + } + } var _29: Int32? - if Int(_2!) & Int(1 << 5) != 0 {_29 = reader.readInt32() } + if Int(_2!) & Int(1 << 5) != 0 { + _29 = reader.readInt32() + } var _30: Int64? - if Int(_2!) & Int(1 << 6) != 0 {_30 = reader.readInt64() } + if Int(_2!) & Int(1 << 6) != 0 { + _30 = reader.readInt64() + } var _31: Api.SuggestedPost? - if Int(_2!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _31 = Api.parse(reader, signature: signature) as? Api.SuggestedPost - } } + if Int(_2!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _31 = Api.parse(reader, signature: signature) as? Api.SuggestedPost + } + } var _32: Int32? - if Int(_2!) & Int(1 << 10) != 0 {_32 = reader.readInt32() } + if Int(_2!) & Int(1 << 10) != 0 { + _32 = reader.readInt32() + } var _33: String? - if Int(_2!) & Int(1 << 11) != 0 {_33 = parseString(reader) } + if Int(_2!) & Int(1 << 11) != 0 { + _33 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -948,7 +1406,7 @@ public extension Api { let _c32 = (Int(_2!) & Int(1 << 10) == 0) || _32 != nil let _c33 = (Int(_2!) & Int(1 << 11) == 0) || _33 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 { - return Api.Message.message(flags: _1!, flags2: _2!, id: _3!, fromId: _4, fromBoostsApplied: _5, peerId: _6!, savedPeerId: _7, fwdFrom: _8, viaBotId: _9, viaBusinessBotId: _10, replyTo: _11, date: _12!, message: _13!, media: _14, replyMarkup: _15, entities: _16, views: _17, forwards: _18, replies: _19, editDate: _20, postAuthor: _21, groupedId: _22, reactions: _23, restrictionReason: _24, ttlPeriod: _25, quickReplyShortcutId: _26, effect: _27, factcheck: _28, reportDeliveryUntilDate: _29, paidMessageStars: _30, suggestedPost: _31, scheduleRepeatPeriod: _32, summaryFromLanguage: _33) + return Api.Message.message(Cons_message(flags: _1!, flags2: _2!, id: _3!, fromId: _4, fromBoostsApplied: _5, peerId: _6!, savedPeerId: _7, fwdFrom: _8, viaBotId: _9, viaBusinessBotId: _10, replyTo: _11, date: _12!, message: _13!, media: _14, replyMarkup: _15, entities: _16, views: _17, forwards: _18, replies: _19, editDate: _20, postAuthor: _21, groupedId: _22, reactions: _23, restrictionReason: _24, ttlPeriod: _25, quickReplyShortcutId: _26, effect: _27, factcheck: _28, reportDeliveryUntilDate: _29, paidMessageStars: _30, suggestedPost: _31, scheduleRepeatPeriod: _32, summaryFromLanguage: _33)) } else { return nil @@ -960,14 +1418,16 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Message.messageEmpty(flags: _1!, id: _2!, peerId: _3) + return Api.Message.messageEmpty(Cons_messageEmpty(flags: _1!, id: _2!, peerId: _3)) } else { return nil @@ -979,21 +1439,27 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: Api.Peer? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _4: Api.Peer? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.Peer } var _5: Api.Peer? - if Int(_1!) & Int(1 << 28) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 28) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _6: Api.MessageReplyHeader? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader + } + } var _7: Int32? _7 = reader.readInt32() var _8: Api.MessageAction? @@ -1001,11 +1467,15 @@ public extension Api { _8 = Api.parse(reader, signature: signature) as? Api.MessageAction } var _9: Api.MessageReactions? - if Int(_1!) & Int(1 << 20) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageReactions - } } + if Int(_1!) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.MessageReactions + } + } var _10: Int32? - if Int(_1!) & Int(1 << 25) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 25) != 0 { + _10 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 8) == 0) || _3 != nil @@ -1017,731 +1487,1381 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 20) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 25) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.Message.messageService(flags: _1!, id: _2!, fromId: _3, peerId: _4!, savedPeerId: _5, replyTo: _6, date: _7!, action: _8!, reactions: _9, ttlPeriod: _10) + return Api.Message.messageService(Cons_messageService(flags: _1!, id: _2!, fromId: _3, peerId: _4!, savedPeerId: _5, replyTo: _6, date: _7!, action: _8!, reactions: _9, ttlPeriod: _10)) } else { return nil } } - } } public extension Api { enum MessageAction: TypeConstructorDescription { - case messageActionBoostApply(boosts: Int32) - case messageActionBotAllowed(flags: Int32, domain: String?, app: Api.BotApp?) - case messageActionChannelCreate(title: String) - case messageActionChannelMigrateFrom(title: String, chatId: Int64) - case messageActionChatAddUser(users: [Int64]) - case messageActionChatCreate(title: String, users: [Int64]) + public class Cons_messageActionBoostApply { + public var boosts: Int32 + public init(boosts: Int32) { + self.boosts = boosts + } + } + public class Cons_messageActionBotAllowed { + public var flags: Int32 + public var domain: String? + public var app: Api.BotApp? + public init(flags: Int32, domain: String?, app: Api.BotApp?) { + self.flags = flags + self.domain = domain + self.app = app + } + } + public class Cons_messageActionChannelCreate { + public var title: String + public init(title: String) { + self.title = title + } + } + public class Cons_messageActionChannelMigrateFrom { + public var title: String + public var chatId: Int64 + public init(title: String, chatId: Int64) { + self.title = title + self.chatId = chatId + } + } + public class Cons_messageActionChatAddUser { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + } + public class Cons_messageActionChatCreate { + public var title: String + public var users: [Int64] + public init(title: String, users: [Int64]) { + self.title = title + self.users = users + } + } + public class Cons_messageActionChatDeleteUser { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + } + public class Cons_messageActionChatEditPhoto { + public var photo: Api.Photo + public init(photo: Api.Photo) { + self.photo = photo + } + } + public class Cons_messageActionChatEditTitle { + public var title: String + public init(title: String) { + self.title = title + } + } + public class Cons_messageActionChatJoinedByLink { + public var inviterId: Int64 + public init(inviterId: Int64) { + self.inviterId = inviterId + } + } + public class Cons_messageActionChatMigrateTo { + public var channelId: Int64 + public init(channelId: Int64) { + self.channelId = channelId + } + } + public class Cons_messageActionConferenceCall { + public var flags: Int32 + public var callId: Int64 + public var duration: Int32? + public var otherParticipants: [Api.Peer]? + public init(flags: Int32, callId: Int64, duration: Int32?, otherParticipants: [Api.Peer]?) { + self.flags = flags + self.callId = callId + self.duration = duration + self.otherParticipants = otherParticipants + } + } + public class Cons_messageActionCustomAction { + public var message: String + public init(message: String) { + self.message = message + } + } + public class Cons_messageActionGameScore { + public var gameId: Int64 + public var score: Int32 + public init(gameId: Int64, score: Int32) { + self.gameId = gameId + self.score = score + } + } + public class Cons_messageActionGeoProximityReached { + public var fromId: Api.Peer + public var toId: Api.Peer + public var distance: Int32 + public init(fromId: Api.Peer, toId: Api.Peer, distance: Int32) { + self.fromId = fromId + self.toId = toId + self.distance = distance + } + } + public class Cons_messageActionGiftCode { + public var flags: Int32 + public var boostPeer: Api.Peer? + public var days: Int32 + public var slug: String + public var currency: String? + public var amount: Int64? + public var cryptoCurrency: String? + public var cryptoAmount: Int64? + public var message: Api.TextWithEntities? + public init(flags: Int32, boostPeer: Api.Peer?, days: Int32, slug: String, currency: String?, amount: Int64?, cryptoCurrency: String?, cryptoAmount: Int64?, message: Api.TextWithEntities?) { + self.flags = flags + self.boostPeer = boostPeer + self.days = days + self.slug = slug + self.currency = currency + self.amount = amount + self.cryptoCurrency = cryptoCurrency + self.cryptoAmount = cryptoAmount + self.message = message + } + } + public class Cons_messageActionGiftPremium { + public var flags: Int32 + public var currency: String + public var amount: Int64 + public var days: Int32 + public var cryptoCurrency: String? + public var cryptoAmount: Int64? + public var message: Api.TextWithEntities? + public init(flags: Int32, currency: String, amount: Int64, days: Int32, cryptoCurrency: String?, cryptoAmount: Int64?, message: Api.TextWithEntities?) { + self.flags = flags + self.currency = currency + self.amount = amount + self.days = days + self.cryptoCurrency = cryptoCurrency + self.cryptoAmount = cryptoAmount + self.message = message + } + } + public class Cons_messageActionGiftStars { + public var flags: Int32 + public var currency: String + public var amount: Int64 + public var stars: Int64 + public var cryptoCurrency: String? + public var cryptoAmount: Int64? + public var transactionId: String? + public init(flags: Int32, currency: String, amount: Int64, stars: Int64, cryptoCurrency: String?, cryptoAmount: Int64?, transactionId: String?) { + self.flags = flags + self.currency = currency + self.amount = amount + self.stars = stars + self.cryptoCurrency = cryptoCurrency + self.cryptoAmount = cryptoAmount + self.transactionId = transactionId + } + } + public class Cons_messageActionGiftTon { + public var flags: Int32 + public var currency: String + public var amount: Int64 + public var cryptoCurrency: String + public var cryptoAmount: Int64 + public var transactionId: String? + public init(flags: Int32, currency: String, amount: Int64, cryptoCurrency: String, cryptoAmount: Int64, transactionId: String?) { + self.flags = flags + self.currency = currency + self.amount = amount + self.cryptoCurrency = cryptoCurrency + self.cryptoAmount = cryptoAmount + self.transactionId = transactionId + } + } + public class Cons_messageActionGiveawayLaunch { + public var flags: Int32 + public var stars: Int64? + public init(flags: Int32, stars: Int64?) { + self.flags = flags + self.stars = stars + } + } + public class Cons_messageActionGiveawayResults { + public var flags: Int32 + public var winnersCount: Int32 + public var unclaimedCount: Int32 + public init(flags: Int32, winnersCount: Int32, unclaimedCount: Int32) { + self.flags = flags + self.winnersCount = winnersCount + self.unclaimedCount = unclaimedCount + } + } + public class Cons_messageActionGroupCall { + public var flags: Int32 + public var call: Api.InputGroupCall + public var duration: Int32? + public init(flags: Int32, call: Api.InputGroupCall, duration: Int32?) { + self.flags = flags + self.call = call + self.duration = duration + } + } + public class Cons_messageActionGroupCallScheduled { + public var call: Api.InputGroupCall + public var scheduleDate: Int32 + public init(call: Api.InputGroupCall, scheduleDate: Int32) { + self.call = call + self.scheduleDate = scheduleDate + } + } + public class Cons_messageActionInviteToGroupCall { + public var call: Api.InputGroupCall + public var users: [Int64] + public init(call: Api.InputGroupCall, users: [Int64]) { + self.call = call + self.users = users + } + } + public class Cons_messageActionPaidMessagesPrice { + public var flags: Int32 + public var stars: Int64 + public init(flags: Int32, stars: Int64) { + self.flags = flags + self.stars = stars + } + } + public class Cons_messageActionPaidMessagesRefunded { + public var count: Int32 + public var stars: Int64 + public init(count: Int32, stars: Int64) { + self.count = count + self.stars = stars + } + } + public class Cons_messageActionPaymentRefunded { + public var flags: Int32 + public var peer: Api.Peer + public var currency: String + public var totalAmount: Int64 + public var payload: Buffer? + public var charge: Api.PaymentCharge + public init(flags: Int32, peer: Api.Peer, currency: String, totalAmount: Int64, payload: Buffer?, charge: Api.PaymentCharge) { + self.flags = flags + self.peer = peer + self.currency = currency + self.totalAmount = totalAmount + self.payload = payload + self.charge = charge + } + } + public class Cons_messageActionPaymentSent { + public var flags: Int32 + public var currency: String + public var totalAmount: Int64 + public var invoiceSlug: String? + public var subscriptionUntilDate: Int32? + public init(flags: Int32, currency: String, totalAmount: Int64, invoiceSlug: String?, subscriptionUntilDate: Int32?) { + self.flags = flags + self.currency = currency + self.totalAmount = totalAmount + self.invoiceSlug = invoiceSlug + self.subscriptionUntilDate = subscriptionUntilDate + } + } + public class Cons_messageActionPaymentSentMe { + public var flags: Int32 + public var currency: String + public var totalAmount: Int64 + public var payload: Buffer + public var info: Api.PaymentRequestedInfo? + public var shippingOptionId: String? + public var charge: Api.PaymentCharge + public var subscriptionUntilDate: Int32? + public init(flags: Int32, currency: String, totalAmount: Int64, payload: Buffer, info: Api.PaymentRequestedInfo?, shippingOptionId: String?, charge: Api.PaymentCharge, subscriptionUntilDate: Int32?) { + self.flags = flags + self.currency = currency + self.totalAmount = totalAmount + self.payload = payload + self.info = info + self.shippingOptionId = shippingOptionId + self.charge = charge + self.subscriptionUntilDate = subscriptionUntilDate + } + } + public class Cons_messageActionPhoneCall { + public var flags: Int32 + public var callId: Int64 + public var reason: Api.PhoneCallDiscardReason? + public var duration: Int32? + public init(flags: Int32, callId: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?) { + self.flags = flags + self.callId = callId + self.reason = reason + self.duration = duration + } + } + public class Cons_messageActionPrizeStars { + public var flags: Int32 + public var stars: Int64 + public var transactionId: String + public var boostPeer: Api.Peer + public var giveawayMsgId: Int32 + public init(flags: Int32, stars: Int64, transactionId: String, boostPeer: Api.Peer, giveawayMsgId: Int32) { + self.flags = flags + self.stars = stars + self.transactionId = transactionId + self.boostPeer = boostPeer + self.giveawayMsgId = giveawayMsgId + } + } + public class Cons_messageActionRequestedPeer { + public var buttonId: Int32 + public var peers: [Api.Peer] + public init(buttonId: Int32, peers: [Api.Peer]) { + self.buttonId = buttonId + self.peers = peers + } + } + public class Cons_messageActionRequestedPeerSentMe { + public var buttonId: Int32 + public var peers: [Api.RequestedPeer] + public init(buttonId: Int32, peers: [Api.RequestedPeer]) { + self.buttonId = buttonId + self.peers = peers + } + } + public class Cons_messageActionSecureValuesSent { + public var types: [Api.SecureValueType] + public init(types: [Api.SecureValueType]) { + self.types = types + } + } + public class Cons_messageActionSecureValuesSentMe { + public var values: [Api.SecureValue] + public var credentials: Api.SecureCredentialsEncrypted + public init(values: [Api.SecureValue], credentials: Api.SecureCredentialsEncrypted) { + self.values = values + self.credentials = credentials + } + } + public class Cons_messageActionSetChatTheme { + public var theme: Api.ChatTheme + public init(theme: Api.ChatTheme) { + self.theme = theme + } + } + public class Cons_messageActionSetChatWallPaper { + public var flags: Int32 + public var wallpaper: Api.WallPaper + public init(flags: Int32, wallpaper: Api.WallPaper) { + self.flags = flags + self.wallpaper = wallpaper + } + } + public class Cons_messageActionSetMessagesTTL { + public var flags: Int32 + public var period: Int32 + public var autoSettingFrom: Int64? + public init(flags: Int32, period: Int32, autoSettingFrom: Int64?) { + self.flags = flags + self.period = period + self.autoSettingFrom = autoSettingFrom + } + } + public class Cons_messageActionStarGift { + public var flags: Int32 + public var gift: Api.StarGift + public var message: Api.TextWithEntities? + public var convertStars: Int64? + public var upgradeMsgId: Int32? + public var upgradeStars: Int64? + public var fromId: Api.Peer? + public var peer: Api.Peer? + public var savedId: Int64? + public var prepaidUpgradeHash: String? + public var giftMsgId: Int32? + public var toId: Api.Peer? + public var giftNum: Int32? + public init(flags: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, convertStars: Int64?, upgradeMsgId: Int32?, upgradeStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, prepaidUpgradeHash: String?, giftMsgId: Int32?, toId: Api.Peer?, giftNum: Int32?) { + self.flags = flags + self.gift = gift + self.message = message + self.convertStars = convertStars + self.upgradeMsgId = upgradeMsgId + self.upgradeStars = upgradeStars + self.fromId = fromId + self.peer = peer + self.savedId = savedId + self.prepaidUpgradeHash = prepaidUpgradeHash + self.giftMsgId = giftMsgId + self.toId = toId + self.giftNum = giftNum + } + } + public class Cons_messageActionStarGiftPurchaseOffer { + public var flags: Int32 + public var gift: Api.StarGift + public var price: Api.StarsAmount + public var expiresAt: Int32 + public init(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount, expiresAt: Int32) { + self.flags = flags + self.gift = gift + self.price = price + self.expiresAt = expiresAt + } + } + public class Cons_messageActionStarGiftPurchaseOfferDeclined { + public var flags: Int32 + public var gift: Api.StarGift + public var price: Api.StarsAmount + public init(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount) { + self.flags = flags + self.gift = gift + self.price = price + } + } + public class Cons_messageActionStarGiftUnique { + public var flags: Int32 + public var gift: Api.StarGift + public var canExportAt: Int32? + public var transferStars: Int64? + public var fromId: Api.Peer? + public var peer: Api.Peer? + public var savedId: Int64? + public var resaleAmount: Api.StarsAmount? + public var canTransferAt: Int32? + public var canResellAt: Int32? + public var dropOriginalDetailsStars: Int64? + public var canCraftAt: Int32? + public init(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleAmount: Api.StarsAmount?, canTransferAt: Int32?, canResellAt: Int32?, dropOriginalDetailsStars: Int64?, canCraftAt: Int32?) { + self.flags = flags + self.gift = gift + self.canExportAt = canExportAt + self.transferStars = transferStars + self.fromId = fromId + self.peer = peer + self.savedId = savedId + self.resaleAmount = resaleAmount + self.canTransferAt = canTransferAt + self.canResellAt = canResellAt + self.dropOriginalDetailsStars = dropOriginalDetailsStars + self.canCraftAt = canCraftAt + } + } + public class Cons_messageActionSuggestBirthday { + public var birthday: Api.Birthday + public init(birthday: Api.Birthday) { + self.birthday = birthday + } + } + public class Cons_messageActionSuggestProfilePhoto { + public var photo: Api.Photo + public init(photo: Api.Photo) { + self.photo = photo + } + } + public class Cons_messageActionSuggestedPostApproval { + public var flags: Int32 + public var rejectComment: String? + public var scheduleDate: Int32? + public var price: Api.StarsAmount? + public init(flags: Int32, rejectComment: String?, scheduleDate: Int32?, price: Api.StarsAmount?) { + self.flags = flags + self.rejectComment = rejectComment + self.scheduleDate = scheduleDate + self.price = price + } + } + public class Cons_messageActionSuggestedPostRefund { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_messageActionSuggestedPostSuccess { + public var price: Api.StarsAmount + public init(price: Api.StarsAmount) { + self.price = price + } + } + public class Cons_messageActionTodoAppendTasks { + public var list: [Api.TodoItem] + public init(list: [Api.TodoItem]) { + self.list = list + } + } + public class Cons_messageActionTodoCompletions { + public var completed: [Int32] + public var incompleted: [Int32] + public init(completed: [Int32], incompleted: [Int32]) { + self.completed = completed + self.incompleted = incompleted + } + } + public class Cons_messageActionTopicCreate { + public var flags: Int32 + public var title: String + public var iconColor: Int32 + public var iconEmojiId: Int64? + public init(flags: Int32, title: String, iconColor: Int32, iconEmojiId: Int64?) { + self.flags = flags + self.title = title + self.iconColor = iconColor + self.iconEmojiId = iconEmojiId + } + } + public class Cons_messageActionTopicEdit { + public var flags: Int32 + public var title: String? + public var iconEmojiId: Int64? + public var closed: Api.Bool? + public var hidden: Api.Bool? + public init(flags: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?) { + self.flags = flags + self.title = title + self.iconEmojiId = iconEmojiId + self.closed = closed + self.hidden = hidden + } + } + public class Cons_messageActionWebViewDataSent { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_messageActionWebViewDataSentMe { + public var text: String + public var data: String + public init(text: String, data: String) { + self.text = text + self.data = data + } + } + case messageActionBoostApply(Cons_messageActionBoostApply) + case messageActionBotAllowed(Cons_messageActionBotAllowed) + case messageActionChannelCreate(Cons_messageActionChannelCreate) + case messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom) + case messageActionChatAddUser(Cons_messageActionChatAddUser) + case messageActionChatCreate(Cons_messageActionChatCreate) case messageActionChatDeletePhoto - case messageActionChatDeleteUser(userId: Int64) - case messageActionChatEditPhoto(photo: Api.Photo) - case messageActionChatEditTitle(title: String) - case messageActionChatJoinedByLink(inviterId: Int64) + case messageActionChatDeleteUser(Cons_messageActionChatDeleteUser) + case messageActionChatEditPhoto(Cons_messageActionChatEditPhoto) + case messageActionChatEditTitle(Cons_messageActionChatEditTitle) + case messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink) case messageActionChatJoinedByRequest - case messageActionChatMigrateTo(channelId: Int64) - case messageActionConferenceCall(flags: Int32, callId: Int64, duration: Int32?, otherParticipants: [Api.Peer]?) + case messageActionChatMigrateTo(Cons_messageActionChatMigrateTo) + case messageActionConferenceCall(Cons_messageActionConferenceCall) case messageActionContactSignUp - case messageActionCustomAction(message: String) + case messageActionCustomAction(Cons_messageActionCustomAction) case messageActionEmpty - case messageActionGameScore(gameId: Int64, score: Int32) - case messageActionGeoProximityReached(fromId: Api.Peer, toId: Api.Peer, distance: Int32) - case messageActionGiftCode(flags: Int32, boostPeer: Api.Peer?, days: Int32, slug: String, currency: String?, amount: Int64?, cryptoCurrency: String?, cryptoAmount: Int64?, message: Api.TextWithEntities?) - case messageActionGiftPremium(flags: Int32, currency: String, amount: Int64, days: Int32, cryptoCurrency: String?, cryptoAmount: Int64?, message: Api.TextWithEntities?) - case messageActionGiftStars(flags: Int32, currency: String, amount: Int64, stars: Int64, cryptoCurrency: String?, cryptoAmount: Int64?, transactionId: String?) - case messageActionGiftTon(flags: Int32, currency: String, amount: Int64, cryptoCurrency: String, cryptoAmount: Int64, transactionId: String?) - case messageActionGiveawayLaunch(flags: Int32, stars: Int64?) - case messageActionGiveawayResults(flags: Int32, winnersCount: Int32, unclaimedCount: Int32) - case messageActionGroupCall(flags: Int32, call: Api.InputGroupCall, duration: Int32?) - case messageActionGroupCallScheduled(call: Api.InputGroupCall, scheduleDate: Int32) + case messageActionGameScore(Cons_messageActionGameScore) + case messageActionGeoProximityReached(Cons_messageActionGeoProximityReached) + case messageActionGiftCode(Cons_messageActionGiftCode) + case messageActionGiftPremium(Cons_messageActionGiftPremium) + case messageActionGiftStars(Cons_messageActionGiftStars) + case messageActionGiftTon(Cons_messageActionGiftTon) + case messageActionGiveawayLaunch(Cons_messageActionGiveawayLaunch) + case messageActionGiveawayResults(Cons_messageActionGiveawayResults) + case messageActionGroupCall(Cons_messageActionGroupCall) + case messageActionGroupCallScheduled(Cons_messageActionGroupCallScheduled) case messageActionHistoryClear - case messageActionInviteToGroupCall(call: Api.InputGroupCall, users: [Int64]) - case messageActionPaidMessagesPrice(flags: Int32, stars: Int64) - case messageActionPaidMessagesRefunded(count: Int32, stars: Int64) - case messageActionPaymentRefunded(flags: Int32, peer: Api.Peer, currency: String, totalAmount: Int64, payload: Buffer?, charge: Api.PaymentCharge) - case messageActionPaymentSent(flags: Int32, currency: String, totalAmount: Int64, invoiceSlug: String?, subscriptionUntilDate: Int32?) - case messageActionPaymentSentMe(flags: Int32, currency: String, totalAmount: Int64, payload: Buffer, info: Api.PaymentRequestedInfo?, shippingOptionId: String?, charge: Api.PaymentCharge, subscriptionUntilDate: Int32?) - case messageActionPhoneCall(flags: Int32, callId: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?) + case messageActionInviteToGroupCall(Cons_messageActionInviteToGroupCall) + case messageActionPaidMessagesPrice(Cons_messageActionPaidMessagesPrice) + case messageActionPaidMessagesRefunded(Cons_messageActionPaidMessagesRefunded) + case messageActionPaymentRefunded(Cons_messageActionPaymentRefunded) + case messageActionPaymentSent(Cons_messageActionPaymentSent) + case messageActionPaymentSentMe(Cons_messageActionPaymentSentMe) + case messageActionPhoneCall(Cons_messageActionPhoneCall) case messageActionPinMessage - case messageActionPrizeStars(flags: Int32, stars: Int64, transactionId: String, boostPeer: Api.Peer, giveawayMsgId: Int32) - case messageActionRequestedPeer(buttonId: Int32, peers: [Api.Peer]) - case messageActionRequestedPeerSentMe(buttonId: Int32, peers: [Api.RequestedPeer]) + case messageActionPrizeStars(Cons_messageActionPrizeStars) + case messageActionRequestedPeer(Cons_messageActionRequestedPeer) + case messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe) case messageActionScreenshotTaken - case messageActionSecureValuesSent(types: [Api.SecureValueType]) - case messageActionSecureValuesSentMe(values: [Api.SecureValue], credentials: Api.SecureCredentialsEncrypted) - case messageActionSetChatTheme(theme: Api.ChatTheme) - case messageActionSetChatWallPaper(flags: Int32, wallpaper: Api.WallPaper) - case messageActionSetMessagesTTL(flags: Int32, period: Int32, autoSettingFrom: Int64?) - case messageActionStarGift(flags: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, convertStars: Int64?, upgradeMsgId: Int32?, upgradeStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, prepaidUpgradeHash: String?, giftMsgId: Int32?, toId: Api.Peer?, giftNum: Int32?) - case messageActionStarGiftPurchaseOffer(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount, expiresAt: Int32) - case messageActionStarGiftPurchaseOfferDeclined(flags: Int32, gift: Api.StarGift, price: Api.StarsAmount) - case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleAmount: Api.StarsAmount?, canTransferAt: Int32?, canResellAt: Int32?, dropOriginalDetailsStars: Int64?, canCraftAt: Int32?) - case messageActionSuggestBirthday(birthday: Api.Birthday) - case messageActionSuggestProfilePhoto(photo: Api.Photo) - case messageActionSuggestedPostApproval(flags: Int32, rejectComment: String?, scheduleDate: Int32?, price: Api.StarsAmount?) - case messageActionSuggestedPostRefund(flags: Int32) - case messageActionSuggestedPostSuccess(price: Api.StarsAmount) - case messageActionTodoAppendTasks(list: [Api.TodoItem]) - case messageActionTodoCompletions(completed: [Int32], incompleted: [Int32]) - case messageActionTopicCreate(flags: Int32, title: String, iconColor: Int32, iconEmojiId: Int64?) - case messageActionTopicEdit(flags: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?) - case messageActionWebViewDataSent(text: String) - case messageActionWebViewDataSentMe(text: String, data: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageActionBoostApply(let boosts): - if boxed { - buffer.appendInt32(-872240531) - } - serializeInt32(boosts, buffer: buffer, boxed: false) - break - case .messageActionBotAllowed(let flags, let domain, let app): - if boxed { - buffer.appendInt32(-988359047) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(domain!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {app!.serialize(buffer, true)} - break - case .messageActionChannelCreate(let title): - if boxed { - buffer.appendInt32(-1781355374) - } - serializeString(title, buffer: buffer, boxed: false) - break - case .messageActionChannelMigrateFrom(let title, let chatId): - if boxed { - buffer.appendInt32(-365344535) - } - serializeString(title, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - break - case .messageActionChatAddUser(let users): - if boxed { - buffer.appendInt32(365886720) - } + case messageActionSecureValuesSent(Cons_messageActionSecureValuesSent) + case messageActionSecureValuesSentMe(Cons_messageActionSecureValuesSentMe) + case messageActionSetChatTheme(Cons_messageActionSetChatTheme) + case messageActionSetChatWallPaper(Cons_messageActionSetChatWallPaper) + case messageActionSetMessagesTTL(Cons_messageActionSetMessagesTTL) + case messageActionStarGift(Cons_messageActionStarGift) + case messageActionStarGiftPurchaseOffer(Cons_messageActionStarGiftPurchaseOffer) + case messageActionStarGiftPurchaseOfferDeclined(Cons_messageActionStarGiftPurchaseOfferDeclined) + case messageActionStarGiftUnique(Cons_messageActionStarGiftUnique) + case messageActionSuggestBirthday(Cons_messageActionSuggestBirthday) + case messageActionSuggestProfilePhoto(Cons_messageActionSuggestProfilePhoto) + case messageActionSuggestedPostApproval(Cons_messageActionSuggestedPostApproval) + case messageActionSuggestedPostRefund(Cons_messageActionSuggestedPostRefund) + case messageActionSuggestedPostSuccess(Cons_messageActionSuggestedPostSuccess) + case messageActionTodoAppendTasks(Cons_messageActionTodoAppendTasks) + case messageActionTodoCompletions(Cons_messageActionTodoCompletions) + case messageActionTopicCreate(Cons_messageActionTopicCreate) + case messageActionTopicEdit(Cons_messageActionTopicEdit) + case messageActionWebViewDataSent(Cons_messageActionWebViewDataSent) + case messageActionWebViewDataSentMe(Cons_messageActionWebViewDataSentMe) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageActionBoostApply(let _data): + if boxed { + buffer.appendInt32(-872240531) + } + serializeInt32(_data.boosts, buffer: buffer, boxed: false) + break + case .messageActionBotAllowed(let _data): + if boxed { + buffer.appendInt32(-988359047) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.domain!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.app!.serialize(buffer, true) + } + break + case .messageActionChannelCreate(let _data): + if boxed { + buffer.appendInt32(-1781355374) + } + serializeString(_data.title, buffer: buffer, boxed: false) + break + case .messageActionChannelMigrateFrom(let _data): + if boxed { + buffer.appendInt32(-365344535) + } + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + break + case .messageActionChatAddUser(let _data): + if boxed { + buffer.appendInt32(365886720) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .messageActionChatCreate(let _data): + if boxed { + buffer.appendInt32(-1119368275) + } + serializeString(_data.title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .messageActionChatDeletePhoto: + if boxed { + buffer.appendInt32(-1780220945) + } + break + case .messageActionChatDeleteUser(let _data): + if boxed { + buffer.appendInt32(-1539362612) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .messageActionChatEditPhoto(let _data): + if boxed { + buffer.appendInt32(2144015272) + } + _data.photo.serialize(buffer, true) + break + case .messageActionChatEditTitle(let _data): + if boxed { + buffer.appendInt32(-1247687078) + } + serializeString(_data.title, buffer: buffer, boxed: false) + break + case .messageActionChatJoinedByLink(let _data): + if boxed { + buffer.appendInt32(51520707) + } + serializeInt64(_data.inviterId, buffer: buffer, boxed: false) + break + case .messageActionChatJoinedByRequest: + if boxed { + buffer.appendInt32(-339958837) + } + break + case .messageActionChatMigrateTo(let _data): + if boxed { + buffer.appendInt32(-519864430) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + break + case .messageActionConferenceCall(let _data): + if boxed { + buffer.appendInt32(805187450) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.callId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.duration!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .messageActionChatCreate(let title, let users): - if boxed { - buffer.appendInt32(-1119368275) - } - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .messageActionChatDeletePhoto: - if boxed { - buffer.appendInt32(-1780220945) - } - - break - case .messageActionChatDeleteUser(let userId): - if boxed { - buffer.appendInt32(-1539362612) - } - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .messageActionChatEditPhoto(let photo): - if boxed { - buffer.appendInt32(2144015272) - } - photo.serialize(buffer, true) - break - case .messageActionChatEditTitle(let title): - if boxed { - buffer.appendInt32(-1247687078) - } - serializeString(title, buffer: buffer, boxed: false) - break - case .messageActionChatJoinedByLink(let inviterId): - if boxed { - buffer.appendInt32(51520707) - } - serializeInt64(inviterId, buffer: buffer, boxed: false) - break - case .messageActionChatJoinedByRequest: - if boxed { - buffer.appendInt32(-339958837) - } - - break - case .messageActionChatMigrateTo(let channelId): - if boxed { - buffer.appendInt32(-519864430) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - break - case .messageActionConferenceCall(let flags, let callId, let duration, let otherParticipants): - if boxed { - buffer.appendInt32(805187450) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(callId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherParticipants!.count)) - for item in otherParticipants! { - item.serialize(buffer, true) - }} - break - case .messageActionContactSignUp: - if boxed { - buffer.appendInt32(-202219658) - } - - break - case .messageActionCustomAction(let message): - if boxed { - buffer.appendInt32(-85549226) - } - serializeString(message, buffer: buffer, boxed: false) - break - case .messageActionEmpty: - if boxed { - buffer.appendInt32(-1230047312) - } - - break - case .messageActionGameScore(let gameId, let score): - if boxed { - buffer.appendInt32(-1834538890) - } - serializeInt64(gameId, buffer: buffer, boxed: false) - serializeInt32(score, buffer: buffer, boxed: false) - break - case .messageActionGeoProximityReached(let fromId, let toId, let distance): - if boxed { - buffer.appendInt32(-1730095465) - } - fromId.serialize(buffer, true) - toId.serialize(buffer, true) - serializeInt32(distance, buffer: buffer, boxed: false) - break - case .messageActionGiftCode(let flags, let boostPeer, let days, let slug, let currency, let amount, let cryptoCurrency, let cryptoAmount, let message): - if boxed { - buffer.appendInt32(834962247) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {boostPeer!.serialize(buffer, true)} - serializeInt32(days, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(currency!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(amount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(cryptoCurrency!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(cryptoAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {message!.serialize(buffer, true)} - break - case .messageActionGiftPremium(let flags, let currency, let amount, let days, let cryptoCurrency, let cryptoAmount, let message): - if boxed { - buffer.appendInt32(1223234306) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeInt32(days, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(cryptoCurrency!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(cryptoAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - break - case .messageActionGiftStars(let flags, let currency, let amount, let stars, let cryptoCurrency, let cryptoAmount, let transactionId): - if boxed { - buffer.appendInt32(1171632161) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(cryptoCurrency!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(cryptoAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(transactionId!, buffer: buffer, boxed: false)} - break - case .messageActionGiftTon(let flags, let currency, let amount, let cryptoCurrency, let cryptoAmount, let transactionId): - if boxed { - buffer.appendInt32(-1465661799) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeString(cryptoCurrency, buffer: buffer, boxed: false) - serializeInt64(cryptoAmount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(transactionId!, buffer: buffer, boxed: false)} - break - case .messageActionGiveawayLaunch(let flags, let stars): - if boxed { - buffer.appendInt32(-1475391004) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(stars!, buffer: buffer, boxed: false)} - break - case .messageActionGiveawayResults(let flags, let winnersCount, let unclaimedCount): - if boxed { - buffer.appendInt32(-2015170219) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(winnersCount, buffer: buffer, boxed: false) - serializeInt32(unclaimedCount, buffer: buffer, boxed: false) - break - case .messageActionGroupCall(let flags, let call, let duration): - if boxed { - buffer.appendInt32(2047704898) - } - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - break - case .messageActionGroupCallScheduled(let call, let scheduleDate): - if boxed { - buffer.appendInt32(-1281329567) - } - call.serialize(buffer, true) - serializeInt32(scheduleDate, buffer: buffer, boxed: false) - break - case .messageActionHistoryClear: - if boxed { - buffer.appendInt32(-1615153660) - } - - break - case .messageActionInviteToGroupCall(let call, let users): - if boxed { - buffer.appendInt32(1345295095) - } - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .messageActionPaidMessagesPrice(let flags, let stars): - if boxed { - buffer.appendInt32(-2068281992) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - break - case .messageActionPaidMessagesRefunded(let count, let stars): - if boxed { - buffer.appendInt32(-1407246387) - } - serializeInt32(count, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - break - case .messageActionPaymentRefunded(let flags, let peer, let currency, let totalAmount, let payload, let charge): - if boxed { - buffer.appendInt32(1102307842) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(payload!, buffer: buffer, boxed: false)} - charge.serialize(buffer, true) - break - case .messageActionPaymentSent(let flags, let currency, let totalAmount, let invoiceSlug, let subscriptionUntilDate): - if boxed { - buffer.appendInt32(-970673810) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(invoiceSlug!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)} - break - case .messageActionPaymentSentMe(let flags, let currency, let totalAmount, let payload, let info, let shippingOptionId, let charge, let subscriptionUntilDate): - if boxed { - buffer.appendInt32(-6288180) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - serializeBytes(payload, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {info!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(shippingOptionId!, buffer: buffer, boxed: false)} - charge.serialize(buffer, true) - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)} - break - case .messageActionPhoneCall(let flags, let callId, let reason, let duration): - if boxed { - buffer.appendInt32(-2132731265) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(callId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {reason!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - break - case .messageActionPinMessage: - if boxed { - buffer.appendInt32(-1799538451) - } - - break - case .messageActionPrizeStars(let flags, let stars, let transactionId, let boostPeer, let giveawayMsgId): - if boxed { - buffer.appendInt32(-1341372510) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - serializeString(transactionId, buffer: buffer, boxed: false) - boostPeer.serialize(buffer, true) - serializeInt32(giveawayMsgId, buffer: buffer, boxed: false) - break - case .messageActionRequestedPeer(let buttonId, let peers): - if boxed { - buffer.appendInt32(827428507) - } - serializeInt32(buttonId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { + buffer.appendInt32(Int32(_data.otherParticipants!.count)) + for item in _data.otherParticipants! { item.serialize(buffer, true) } - break - case .messageActionRequestedPeerSentMe(let buttonId, let peers): - if boxed { - buffer.appendInt32(-1816979384) - } - serializeInt32(buttonId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - break - case .messageActionScreenshotTaken: - if boxed { - buffer.appendInt32(1200788123) - } - - break - case .messageActionSecureValuesSent(let types): - if boxed { - buffer.appendInt32(-648257196) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(types.count)) - for item in types { - item.serialize(buffer, true) - } - break - case .messageActionSecureValuesSentMe(let values, let credentials): - if boxed { - buffer.appendInt32(455635795) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(values.count)) - for item in values { - item.serialize(buffer, true) - } - credentials.serialize(buffer, true) - break - case .messageActionSetChatTheme(let theme): - if boxed { - buffer.appendInt32(-1189364422) - } - theme.serialize(buffer, true) - break - case .messageActionSetChatWallPaper(let flags, let wallpaper): - if boxed { - buffer.appendInt32(1348510708) - } - serializeInt32(flags, buffer: buffer, boxed: false) - wallpaper.serialize(buffer, true) - break - case .messageActionSetMessagesTTL(let flags, let period, let autoSettingFrom): - if boxed { - buffer.appendInt32(1007897979) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(period, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(autoSettingFrom!, buffer: buffer, boxed: false)} - break - case .messageActionStarGift(let flags, let gift, let message, let convertStars, let upgradeMsgId, let upgradeStars, let fromId, let peer, let savedId, let prepaidUpgradeHash, let giftMsgId, let toId, let giftNum): - if boxed { - buffer.appendInt32(-366202413) - } - serializeInt32(flags, buffer: buffer, boxed: false) - gift.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(convertStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(upgradeMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(upgradeStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 12) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {serializeString(prepaidUpgradeHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(giftMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {toId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 19) != 0 {serializeInt32(giftNum!, buffer: buffer, boxed: false)} - break - case .messageActionStarGiftPurchaseOffer(let flags, let gift, let price, let expiresAt): - if boxed { - buffer.appendInt32(2000845012) - } - serializeInt32(flags, buffer: buffer, boxed: false) - gift.serialize(buffer, true) - price.serialize(buffer, true) - serializeInt32(expiresAt, buffer: buffer, boxed: false) - break - case .messageActionStarGiftPurchaseOfferDeclined(let flags, let gift, let price): - if boxed { - buffer.appendInt32(1940760427) - } - serializeInt32(flags, buffer: buffer, boxed: false) - gift.serialize(buffer, true) - price.serialize(buffer, true) - break - case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleAmount, let canTransferAt, let canResellAt, let dropOriginalDetailsStars, let canCraftAt): - if boxed { - buffer.appendInt32(-423422686) - } - serializeInt32(flags, buffer: buffer, boxed: false) - gift.serialize(buffer, true) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(canExportAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(transferStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {resaleAmount!.serialize(buffer, true)} - if Int(flags) & Int(1 << 9) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt64(dropOriginalDetailsStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(canCraftAt!, buffer: buffer, boxed: false)} - break - case .messageActionSuggestBirthday(let birthday): - if boxed { - buffer.appendInt32(747579941) - } - birthday.serialize(buffer, true) - break - case .messageActionSuggestProfilePhoto(let photo): - if boxed { - buffer.appendInt32(1474192222) - } - photo.serialize(buffer, true) - break - case .messageActionSuggestedPostApproval(let flags, let rejectComment, let scheduleDate, let price): - if boxed { - buffer.appendInt32(-293988970) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(rejectComment!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {price!.serialize(buffer, true)} - break - case .messageActionSuggestedPostRefund(let flags): - if boxed { - buffer.appendInt32(1777932024) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .messageActionSuggestedPostSuccess(let price): - if boxed { - buffer.appendInt32(-1780625559) - } - price.serialize(buffer, true) - break - case .messageActionTodoAppendTasks(let list): - if boxed { - buffer.appendInt32(-940721021) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(list.count)) - for item in list { - item.serialize(buffer, true) - } - break - case .messageActionTodoCompletions(let completed, let incompleted): - if boxed { - buffer.appendInt32(-864265079) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(completed.count)) - for item in completed { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(incompleted.count)) - for item in incompleted { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .messageActionTopicCreate(let flags, let title, let iconColor, let iconEmojiId): - if boxed { - buffer.appendInt32(228168278) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeInt32(iconColor, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(iconEmojiId!, buffer: buffer, boxed: false)} - break - case .messageActionTopicEdit(let flags, let title, let iconEmojiId, let closed, let hidden): - if boxed { - buffer.appendInt32(-1064024032) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(iconEmojiId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {closed!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {hidden!.serialize(buffer, true)} - break - case .messageActionWebViewDataSent(let text): - if boxed { - buffer.appendInt32(-1262252875) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .messageActionWebViewDataSentMe(let text, let data): - if boxed { - buffer.appendInt32(1205698681) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(data, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageActionBoostApply(let boosts): - return ("messageActionBoostApply", [("boosts", boosts as Any)]) - case .messageActionBotAllowed(let flags, let domain, let app): - return ("messageActionBotAllowed", [("flags", flags as Any), ("domain", domain as Any), ("app", app as Any)]) - case .messageActionChannelCreate(let title): - return ("messageActionChannelCreate", [("title", title as Any)]) - case .messageActionChannelMigrateFrom(let title, let chatId): - return ("messageActionChannelMigrateFrom", [("title", title as Any), ("chatId", chatId as Any)]) - case .messageActionChatAddUser(let users): - return ("messageActionChatAddUser", [("users", users as Any)]) - case .messageActionChatCreate(let title, let users): - return ("messageActionChatCreate", [("title", title as Any), ("users", users as Any)]) - case .messageActionChatDeletePhoto: + } + break + case .messageActionContactSignUp: + if boxed { + buffer.appendInt32(-202219658) + } + break + case .messageActionCustomAction(let _data): + if boxed { + buffer.appendInt32(-85549226) + } + serializeString(_data.message, buffer: buffer, boxed: false) + break + case .messageActionEmpty: + if boxed { + buffer.appendInt32(-1230047312) + } + break + case .messageActionGameScore(let _data): + if boxed { + buffer.appendInt32(-1834538890) + } + serializeInt64(_data.gameId, buffer: buffer, boxed: false) + serializeInt32(_data.score, buffer: buffer, boxed: false) + break + case .messageActionGeoProximityReached(let _data): + if boxed { + buffer.appendInt32(-1730095465) + } + _data.fromId.serialize(buffer, true) + _data.toId.serialize(buffer, true) + serializeInt32(_data.distance, buffer: buffer, boxed: false) + break + case .messageActionGiftCode(let _data): + if boxed { + buffer.appendInt32(834962247) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.boostPeer!.serialize(buffer, true) + } + serializeInt32(_data.days, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.currency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.amount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.cryptoCurrency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt64(_data.cryptoAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .messageActionGiftPremium(let _data): + if boxed { + buffer.appendInt32(1223234306) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeInt32(_data.days, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.cryptoCurrency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.cryptoAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .messageActionGiftStars(let _data): + if boxed { + buffer.appendInt32(1171632161) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.cryptoCurrency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.cryptoAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.transactionId!, buffer: buffer, boxed: false) + } + break + case .messageActionGiftTon(let _data): + if boxed { + buffer.appendInt32(-1465661799) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeString(_data.cryptoCurrency, buffer: buffer, boxed: false) + serializeInt64(_data.cryptoAmount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.transactionId!, buffer: buffer, boxed: false) + } + break + case .messageActionGiveawayLaunch(let _data): + if boxed { + buffer.appendInt32(-1475391004) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.stars!, buffer: buffer, boxed: false) + } + break + case .messageActionGiveawayResults(let _data): + if boxed { + buffer.appendInt32(-2015170219) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.winnersCount, buffer: buffer, boxed: false) + serializeInt32(_data.unclaimedCount, buffer: buffer, boxed: false) + break + case .messageActionGroupCall(let _data): + if boxed { + buffer.appendInt32(2047704898) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.call.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.duration!, buffer: buffer, boxed: false) + } + break + case .messageActionGroupCallScheduled(let _data): + if boxed { + buffer.appendInt32(-1281329567) + } + _data.call.serialize(buffer, true) + serializeInt32(_data.scheduleDate, buffer: buffer, boxed: false) + break + case .messageActionHistoryClear: + if boxed { + buffer.appendInt32(-1615153660) + } + break + case .messageActionInviteToGroupCall(let _data): + if boxed { + buffer.appendInt32(1345295095) + } + _data.call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .messageActionPaidMessagesPrice(let _data): + if boxed { + buffer.appendInt32(-2068281992) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + break + case .messageActionPaidMessagesRefunded(let _data): + if boxed { + buffer.appendInt32(-1407246387) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + break + case .messageActionPaymentRefunded(let _data): + if boxed { + buffer.appendInt32(1102307842) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.payload!, buffer: buffer, boxed: false) + } + _data.charge.serialize(buffer, true) + break + case .messageActionPaymentSent(let _data): + if boxed { + buffer.appendInt32(-970673810) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.invoiceSlug!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.subscriptionUntilDate!, buffer: buffer, boxed: false) + } + break + case .messageActionPaymentSentMe(let _data): + if boxed { + buffer.appendInt32(-6288180) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + serializeBytes(_data.payload, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.info!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.shippingOptionId!, buffer: buffer, boxed: false) + } + _data.charge.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.subscriptionUntilDate!, buffer: buffer, boxed: false) + } + break + case .messageActionPhoneCall(let _data): + if boxed { + buffer.appendInt32(-2132731265) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.callId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.reason!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.duration!, buffer: buffer, boxed: false) + } + break + case .messageActionPinMessage: + if boxed { + buffer.appendInt32(-1799538451) + } + break + case .messageActionPrizeStars(let _data): + if boxed { + buffer.appendInt32(-1341372510) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + serializeString(_data.transactionId, buffer: buffer, boxed: false) + _data.boostPeer.serialize(buffer, true) + serializeInt32(_data.giveawayMsgId, buffer: buffer, boxed: false) + break + case .messageActionRequestedPeer(let _data): + if boxed { + buffer.appendInt32(827428507) + } + serializeInt32(_data.buttonId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + break + case .messageActionRequestedPeerSentMe(let _data): + if boxed { + buffer.appendInt32(-1816979384) + } + serializeInt32(_data.buttonId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + break + case .messageActionScreenshotTaken: + if boxed { + buffer.appendInt32(1200788123) + } + break + case .messageActionSecureValuesSent(let _data): + if boxed { + buffer.appendInt32(-648257196) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.types.count)) + for item in _data.types { + item.serialize(buffer, true) + } + break + case .messageActionSecureValuesSentMe(let _data): + if boxed { + buffer.appendInt32(455635795) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.values.count)) + for item in _data.values { + item.serialize(buffer, true) + } + _data.credentials.serialize(buffer, true) + break + case .messageActionSetChatTheme(let _data): + if boxed { + buffer.appendInt32(-1189364422) + } + _data.theme.serialize(buffer, true) + break + case .messageActionSetChatWallPaper(let _data): + if boxed { + buffer.appendInt32(1348510708) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.wallpaper.serialize(buffer, true) + break + case .messageActionSetMessagesTTL(let _data): + if boxed { + buffer.appendInt32(1007897979) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.period, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.autoSettingFrom!, buffer: buffer, boxed: false) + } + break + case .messageActionStarGift(let _data): + if boxed { + buffer.appendInt32(-366202413) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.gift.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.convertStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.upgradeMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.upgradeStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + _data.peer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt64(_data.savedId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeString(_data.prepaidUpgradeHash!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.giftMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.toId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 19) != 0 { + serializeInt32(_data.giftNum!, buffer: buffer, boxed: false) + } + break + case .messageActionStarGiftPurchaseOffer(let _data): + if boxed { + buffer.appendInt32(2000845012) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.gift.serialize(buffer, true) + _data.price.serialize(buffer, true) + serializeInt32(_data.expiresAt, buffer: buffer, boxed: false) + break + case .messageActionStarGiftPurchaseOfferDeclined(let _data): + if boxed { + buffer.appendInt32(1940760427) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.gift.serialize(buffer, true) + _data.price.serialize(buffer, true) + break + case .messageActionStarGiftUnique(let _data): + if boxed { + buffer.appendInt32(-423422686) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.gift.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.canExportAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.transferStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + _data.peer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt64(_data.savedId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.resaleAmount!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeInt32(_data.canTransferAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.canResellAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt64(_data.dropOriginalDetailsStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.canCraftAt!, buffer: buffer, boxed: false) + } + break + case .messageActionSuggestBirthday(let _data): + if boxed { + buffer.appendInt32(747579941) + } + _data.birthday.serialize(buffer, true) + break + case .messageActionSuggestProfilePhoto(let _data): + if boxed { + buffer.appendInt32(1474192222) + } + _data.photo.serialize(buffer, true) + break + case .messageActionSuggestedPostApproval(let _data): + if boxed { + buffer.appendInt32(-293988970) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.rejectComment!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.scheduleDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.price!.serialize(buffer, true) + } + break + case .messageActionSuggestedPostRefund(let _data): + if boxed { + buffer.appendInt32(1777932024) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .messageActionSuggestedPostSuccess(let _data): + if boxed { + buffer.appendInt32(-1780625559) + } + _data.price.serialize(buffer, true) + break + case .messageActionTodoAppendTasks(let _data): + if boxed { + buffer.appendInt32(-940721021) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.list.count)) + for item in _data.list { + item.serialize(buffer, true) + } + break + case .messageActionTodoCompletions(let _data): + if boxed { + buffer.appendInt32(-864265079) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.completed.count)) + for item in _data.completed { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.incompleted.count)) + for item in _data.incompleted { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .messageActionTopicCreate(let _data): + if boxed { + buffer.appendInt32(228168278) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt32(_data.iconColor, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.iconEmojiId!, buffer: buffer, boxed: false) + } + break + case .messageActionTopicEdit(let _data): + if boxed { + buffer.appendInt32(-1064024032) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.iconEmojiId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.closed!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.hidden!.serialize(buffer, true) + } + break + case .messageActionWebViewDataSent(let _data): + if boxed { + buffer.appendInt32(-1262252875) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .messageActionWebViewDataSentMe(let _data): + if boxed { + buffer.appendInt32(1205698681) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.data, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageActionBoostApply(let _data): + return ("messageActionBoostApply", [("boosts", _data.boosts as Any)]) + case .messageActionBotAllowed(let _data): + return ("messageActionBotAllowed", [("flags", _data.flags as Any), ("domain", _data.domain as Any), ("app", _data.app as Any)]) + case .messageActionChannelCreate(let _data): + return ("messageActionChannelCreate", [("title", _data.title as Any)]) + case .messageActionChannelMigrateFrom(let _data): + return ("messageActionChannelMigrateFrom", [("title", _data.title as Any), ("chatId", _data.chatId as Any)]) + case .messageActionChatAddUser(let _data): + return ("messageActionChatAddUser", [("users", _data.users as Any)]) + case .messageActionChatCreate(let _data): + return ("messageActionChatCreate", [("title", _data.title as Any), ("users", _data.users as Any)]) + case .messageActionChatDeletePhoto: return ("messageActionChatDeletePhoto", []) - case .messageActionChatDeleteUser(let userId): - return ("messageActionChatDeleteUser", [("userId", userId as Any)]) - case .messageActionChatEditPhoto(let photo): - return ("messageActionChatEditPhoto", [("photo", photo as Any)]) - case .messageActionChatEditTitle(let title): - return ("messageActionChatEditTitle", [("title", title as Any)]) - case .messageActionChatJoinedByLink(let inviterId): - return ("messageActionChatJoinedByLink", [("inviterId", inviterId as Any)]) - case .messageActionChatJoinedByRequest: + case .messageActionChatDeleteUser(let _data): + return ("messageActionChatDeleteUser", [("userId", _data.userId as Any)]) + case .messageActionChatEditPhoto(let _data): + return ("messageActionChatEditPhoto", [("photo", _data.photo as Any)]) + case .messageActionChatEditTitle(let _data): + return ("messageActionChatEditTitle", [("title", _data.title as Any)]) + case .messageActionChatJoinedByLink(let _data): + return ("messageActionChatJoinedByLink", [("inviterId", _data.inviterId as Any)]) + case .messageActionChatJoinedByRequest: return ("messageActionChatJoinedByRequest", []) - case .messageActionChatMigrateTo(let channelId): - return ("messageActionChatMigrateTo", [("channelId", channelId as Any)]) - case .messageActionConferenceCall(let flags, let callId, let duration, let otherParticipants): - return ("messageActionConferenceCall", [("flags", flags as Any), ("callId", callId as Any), ("duration", duration as Any), ("otherParticipants", otherParticipants as Any)]) - case .messageActionContactSignUp: + case .messageActionChatMigrateTo(let _data): + return ("messageActionChatMigrateTo", [("channelId", _data.channelId as Any)]) + case .messageActionConferenceCall(let _data): + return ("messageActionConferenceCall", [("flags", _data.flags as Any), ("callId", _data.callId as Any), ("duration", _data.duration as Any), ("otherParticipants", _data.otherParticipants as Any)]) + case .messageActionContactSignUp: return ("messageActionContactSignUp", []) - case .messageActionCustomAction(let message): - return ("messageActionCustomAction", [("message", message as Any)]) - case .messageActionEmpty: + case .messageActionCustomAction(let _data): + return ("messageActionCustomAction", [("message", _data.message as Any)]) + case .messageActionEmpty: return ("messageActionEmpty", []) - case .messageActionGameScore(let gameId, let score): - return ("messageActionGameScore", [("gameId", gameId as Any), ("score", score as Any)]) - case .messageActionGeoProximityReached(let fromId, let toId, let distance): - return ("messageActionGeoProximityReached", [("fromId", fromId as Any), ("toId", toId as Any), ("distance", distance as Any)]) - case .messageActionGiftCode(let flags, let boostPeer, let days, let slug, let currency, let amount, let cryptoCurrency, let cryptoAmount, let message): - return ("messageActionGiftCode", [("flags", flags as Any), ("boostPeer", boostPeer as Any), ("days", days as Any), ("slug", slug as Any), ("currency", currency as Any), ("amount", amount as Any), ("cryptoCurrency", cryptoCurrency as Any), ("cryptoAmount", cryptoAmount as Any), ("message", message as Any)]) - case .messageActionGiftPremium(let flags, let currency, let amount, let days, let cryptoCurrency, let cryptoAmount, let message): - return ("messageActionGiftPremium", [("flags", flags as Any), ("currency", currency as Any), ("amount", amount as Any), ("days", days as Any), ("cryptoCurrency", cryptoCurrency as Any), ("cryptoAmount", cryptoAmount as Any), ("message", message as Any)]) - case .messageActionGiftStars(let flags, let currency, let amount, let stars, let cryptoCurrency, let cryptoAmount, let transactionId): - return ("messageActionGiftStars", [("flags", flags as Any), ("currency", currency as Any), ("amount", amount as Any), ("stars", stars as Any), ("cryptoCurrency", cryptoCurrency as Any), ("cryptoAmount", cryptoAmount as Any), ("transactionId", transactionId as Any)]) - case .messageActionGiftTon(let flags, let currency, let amount, let cryptoCurrency, let cryptoAmount, let transactionId): - return ("messageActionGiftTon", [("flags", flags as Any), ("currency", currency as Any), ("amount", amount as Any), ("cryptoCurrency", cryptoCurrency as Any), ("cryptoAmount", cryptoAmount as Any), ("transactionId", transactionId as Any)]) - case .messageActionGiveawayLaunch(let flags, let stars): - return ("messageActionGiveawayLaunch", [("flags", flags as Any), ("stars", stars as Any)]) - case .messageActionGiveawayResults(let flags, let winnersCount, let unclaimedCount): - return ("messageActionGiveawayResults", [("flags", flags as Any), ("winnersCount", winnersCount as Any), ("unclaimedCount", unclaimedCount as Any)]) - case .messageActionGroupCall(let flags, let call, let duration): - return ("messageActionGroupCall", [("flags", flags as Any), ("call", call as Any), ("duration", duration as Any)]) - case .messageActionGroupCallScheduled(let call, let scheduleDate): - return ("messageActionGroupCallScheduled", [("call", call as Any), ("scheduleDate", scheduleDate as Any)]) - case .messageActionHistoryClear: + case .messageActionGameScore(let _data): + return ("messageActionGameScore", [("gameId", _data.gameId as Any), ("score", _data.score as Any)]) + case .messageActionGeoProximityReached(let _data): + return ("messageActionGeoProximityReached", [("fromId", _data.fromId as Any), ("toId", _data.toId as Any), ("distance", _data.distance as Any)]) + case .messageActionGiftCode(let _data): + return ("messageActionGiftCode", [("flags", _data.flags as Any), ("boostPeer", _data.boostPeer as Any), ("days", _data.days as Any), ("slug", _data.slug as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("message", _data.message as Any)]) + case .messageActionGiftPremium(let _data): + return ("messageActionGiftPremium", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("days", _data.days as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("message", _data.message as Any)]) + case .messageActionGiftStars(let _data): + return ("messageActionGiftStars", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("stars", _data.stars as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("transactionId", _data.transactionId as Any)]) + case .messageActionGiftTon(let _data): + return ("messageActionGiftTon", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("transactionId", _data.transactionId as Any)]) + case .messageActionGiveawayLaunch(let _data): + return ("messageActionGiveawayLaunch", [("flags", _data.flags as Any), ("stars", _data.stars as Any)]) + case .messageActionGiveawayResults(let _data): + return ("messageActionGiveawayResults", [("flags", _data.flags as Any), ("winnersCount", _data.winnersCount as Any), ("unclaimedCount", _data.unclaimedCount as Any)]) + case .messageActionGroupCall(let _data): + return ("messageActionGroupCall", [("flags", _data.flags as Any), ("call", _data.call as Any), ("duration", _data.duration as Any)]) + case .messageActionGroupCallScheduled(let _data): + return ("messageActionGroupCallScheduled", [("call", _data.call as Any), ("scheduleDate", _data.scheduleDate as Any)]) + case .messageActionHistoryClear: return ("messageActionHistoryClear", []) - case .messageActionInviteToGroupCall(let call, let users): - return ("messageActionInviteToGroupCall", [("call", call as Any), ("users", users as Any)]) - case .messageActionPaidMessagesPrice(let flags, let stars): - return ("messageActionPaidMessagesPrice", [("flags", flags as Any), ("stars", stars as Any)]) - case .messageActionPaidMessagesRefunded(let count, let stars): - return ("messageActionPaidMessagesRefunded", [("count", count as Any), ("stars", stars as Any)]) - case .messageActionPaymentRefunded(let flags, let peer, let currency, let totalAmount, let payload, let charge): - return ("messageActionPaymentRefunded", [("flags", flags as Any), ("peer", peer as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("payload", payload as Any), ("charge", charge as Any)]) - case .messageActionPaymentSent(let flags, let currency, let totalAmount, let invoiceSlug, let subscriptionUntilDate): - return ("messageActionPaymentSent", [("flags", flags as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("invoiceSlug", invoiceSlug as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any)]) - case .messageActionPaymentSentMe(let flags, let currency, let totalAmount, let payload, let info, let shippingOptionId, let charge, let subscriptionUntilDate): - return ("messageActionPaymentSentMe", [("flags", flags as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("payload", payload as Any), ("info", info as Any), ("shippingOptionId", shippingOptionId as Any), ("charge", charge as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any)]) - case .messageActionPhoneCall(let flags, let callId, let reason, let duration): - return ("messageActionPhoneCall", [("flags", flags as Any), ("callId", callId as Any), ("reason", reason as Any), ("duration", duration as Any)]) - case .messageActionPinMessage: + case .messageActionInviteToGroupCall(let _data): + return ("messageActionInviteToGroupCall", [("call", _data.call as Any), ("users", _data.users as Any)]) + case .messageActionPaidMessagesPrice(let _data): + return ("messageActionPaidMessagesPrice", [("flags", _data.flags as Any), ("stars", _data.stars as Any)]) + case .messageActionPaidMessagesRefunded(let _data): + return ("messageActionPaidMessagesRefunded", [("count", _data.count as Any), ("stars", _data.stars as Any)]) + case .messageActionPaymentRefunded(let _data): + return ("messageActionPaymentRefunded", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("payload", _data.payload as Any), ("charge", _data.charge as Any)]) + case .messageActionPaymentSent(let _data): + return ("messageActionPaymentSent", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("invoiceSlug", _data.invoiceSlug as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + case .messageActionPaymentSentMe(let _data): + return ("messageActionPaymentSentMe", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("payload", _data.payload as Any), ("info", _data.info as Any), ("shippingOptionId", _data.shippingOptionId as Any), ("charge", _data.charge as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + case .messageActionPhoneCall(let _data): + return ("messageActionPhoneCall", [("flags", _data.flags as Any), ("callId", _data.callId as Any), ("reason", _data.reason as Any), ("duration", _data.duration as Any)]) + case .messageActionPinMessage: return ("messageActionPinMessage", []) - case .messageActionPrizeStars(let flags, let stars, let transactionId, let boostPeer, let giveawayMsgId): - return ("messageActionPrizeStars", [("flags", flags as Any), ("stars", stars as Any), ("transactionId", transactionId as Any), ("boostPeer", boostPeer as Any), ("giveawayMsgId", giveawayMsgId as Any)]) - case .messageActionRequestedPeer(let buttonId, let peers): - return ("messageActionRequestedPeer", [("buttonId", buttonId as Any), ("peers", peers as Any)]) - case .messageActionRequestedPeerSentMe(let buttonId, let peers): - return ("messageActionRequestedPeerSentMe", [("buttonId", buttonId as Any), ("peers", peers as Any)]) - case .messageActionScreenshotTaken: + case .messageActionPrizeStars(let _data): + return ("messageActionPrizeStars", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("transactionId", _data.transactionId as Any), ("boostPeer", _data.boostPeer as Any), ("giveawayMsgId", _data.giveawayMsgId as Any)]) + case .messageActionRequestedPeer(let _data): + return ("messageActionRequestedPeer", [("buttonId", _data.buttonId as Any), ("peers", _data.peers as Any)]) + case .messageActionRequestedPeerSentMe(let _data): + return ("messageActionRequestedPeerSentMe", [("buttonId", _data.buttonId as Any), ("peers", _data.peers as Any)]) + case .messageActionScreenshotTaken: return ("messageActionScreenshotTaken", []) - case .messageActionSecureValuesSent(let types): - return ("messageActionSecureValuesSent", [("types", types as Any)]) - case .messageActionSecureValuesSentMe(let values, let credentials): - return ("messageActionSecureValuesSentMe", [("values", values as Any), ("credentials", credentials as Any)]) - case .messageActionSetChatTheme(let theme): - return ("messageActionSetChatTheme", [("theme", theme as Any)]) - case .messageActionSetChatWallPaper(let flags, let wallpaper): - return ("messageActionSetChatWallPaper", [("flags", flags as Any), ("wallpaper", wallpaper as Any)]) - case .messageActionSetMessagesTTL(let flags, let period, let autoSettingFrom): - return ("messageActionSetMessagesTTL", [("flags", flags as Any), ("period", period as Any), ("autoSettingFrom", autoSettingFrom as Any)]) - case .messageActionStarGift(let flags, let gift, let message, let convertStars, let upgradeMsgId, let upgradeStars, let fromId, let peer, let savedId, let prepaidUpgradeHash, let giftMsgId, let toId, let giftNum): - return ("messageActionStarGift", [("flags", flags as Any), ("gift", gift as Any), ("message", message as Any), ("convertStars", convertStars as Any), ("upgradeMsgId", upgradeMsgId as Any), ("upgradeStars", upgradeStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("prepaidUpgradeHash", prepaidUpgradeHash as Any), ("giftMsgId", giftMsgId as Any), ("toId", toId as Any), ("giftNum", giftNum as Any)]) - case .messageActionStarGiftPurchaseOffer(let flags, let gift, let price, let expiresAt): - return ("messageActionStarGiftPurchaseOffer", [("flags", flags as Any), ("gift", gift as Any), ("price", price as Any), ("expiresAt", expiresAt as Any)]) - case .messageActionStarGiftPurchaseOfferDeclined(let flags, let gift, let price): - return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", flags as Any), ("gift", gift as Any), ("price", price as Any)]) - case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleAmount, let canTransferAt, let canResellAt, let dropOriginalDetailsStars, let canCraftAt): - return ("messageActionStarGiftUnique", [("flags", flags as Any), ("gift", gift as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("resaleAmount", resaleAmount as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any), ("dropOriginalDetailsStars", dropOriginalDetailsStars as Any), ("canCraftAt", canCraftAt as Any)]) - case .messageActionSuggestBirthday(let birthday): - return ("messageActionSuggestBirthday", [("birthday", birthday as Any)]) - case .messageActionSuggestProfilePhoto(let photo): - return ("messageActionSuggestProfilePhoto", [("photo", photo as Any)]) - case .messageActionSuggestedPostApproval(let flags, let rejectComment, let scheduleDate, let price): - return ("messageActionSuggestedPostApproval", [("flags", flags as Any), ("rejectComment", rejectComment as Any), ("scheduleDate", scheduleDate as Any), ("price", price as Any)]) - case .messageActionSuggestedPostRefund(let flags): - return ("messageActionSuggestedPostRefund", [("flags", flags as Any)]) - case .messageActionSuggestedPostSuccess(let price): - return ("messageActionSuggestedPostSuccess", [("price", price as Any)]) - case .messageActionTodoAppendTasks(let list): - return ("messageActionTodoAppendTasks", [("list", list as Any)]) - case .messageActionTodoCompletions(let completed, let incompleted): - return ("messageActionTodoCompletions", [("completed", completed as Any), ("incompleted", incompleted as Any)]) - case .messageActionTopicCreate(let flags, let title, let iconColor, let iconEmojiId): - return ("messageActionTopicCreate", [("flags", flags as Any), ("title", title as Any), ("iconColor", iconColor as Any), ("iconEmojiId", iconEmojiId as Any)]) - case .messageActionTopicEdit(let flags, let title, let iconEmojiId, let closed, let hidden): - return ("messageActionTopicEdit", [("flags", flags as Any), ("title", title as Any), ("iconEmojiId", iconEmojiId as Any), ("closed", closed as Any), ("hidden", hidden as Any)]) - case .messageActionWebViewDataSent(let text): - return ("messageActionWebViewDataSent", [("text", text as Any)]) - case .messageActionWebViewDataSentMe(let text, let data): - return ("messageActionWebViewDataSentMe", [("text", text as Any), ("data", data as Any)]) - } - } - + case .messageActionSecureValuesSent(let _data): + return ("messageActionSecureValuesSent", [("types", _data.types as Any)]) + case .messageActionSecureValuesSentMe(let _data): + return ("messageActionSecureValuesSentMe", [("values", _data.values as Any), ("credentials", _data.credentials as Any)]) + case .messageActionSetChatTheme(let _data): + return ("messageActionSetChatTheme", [("theme", _data.theme as Any)]) + case .messageActionSetChatWallPaper(let _data): + return ("messageActionSetChatWallPaper", [("flags", _data.flags as Any), ("wallpaper", _data.wallpaper as Any)]) + case .messageActionSetMessagesTTL(let _data): + return ("messageActionSetMessagesTTL", [("flags", _data.flags as Any), ("period", _data.period as Any), ("autoSettingFrom", _data.autoSettingFrom as Any)]) + case .messageActionStarGift(let _data): + return ("messageActionStarGift", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("message", _data.message as Any), ("convertStars", _data.convertStars as Any), ("upgradeMsgId", _data.upgradeMsgId as Any), ("upgradeStars", _data.upgradeStars as Any), ("fromId", _data.fromId as Any), ("peer", _data.peer as Any), ("savedId", _data.savedId as Any), ("prepaidUpgradeHash", _data.prepaidUpgradeHash as Any), ("giftMsgId", _data.giftMsgId as Any), ("toId", _data.toId as Any), ("giftNum", _data.giftNum as Any)]) + case .messageActionStarGiftPurchaseOffer(let _data): + return ("messageActionStarGiftPurchaseOffer", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("price", _data.price as Any), ("expiresAt", _data.expiresAt as Any)]) + case .messageActionStarGiftPurchaseOfferDeclined(let _data): + return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("price", _data.price as Any)]) + case .messageActionStarGiftUnique(let _data): + return ("messageActionStarGiftUnique", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("canExportAt", _data.canExportAt as Any), ("transferStars", _data.transferStars as Any), ("fromId", _data.fromId as Any), ("peer", _data.peer as Any), ("savedId", _data.savedId as Any), ("resaleAmount", _data.resaleAmount as Any), ("canTransferAt", _data.canTransferAt as Any), ("canResellAt", _data.canResellAt as Any), ("dropOriginalDetailsStars", _data.dropOriginalDetailsStars as Any), ("canCraftAt", _data.canCraftAt as Any)]) + case .messageActionSuggestBirthday(let _data): + return ("messageActionSuggestBirthday", [("birthday", _data.birthday as Any)]) + case .messageActionSuggestProfilePhoto(let _data): + return ("messageActionSuggestProfilePhoto", [("photo", _data.photo as Any)]) + case .messageActionSuggestedPostApproval(let _data): + return ("messageActionSuggestedPostApproval", [("flags", _data.flags as Any), ("rejectComment", _data.rejectComment as Any), ("scheduleDate", _data.scheduleDate as Any), ("price", _data.price as Any)]) + case .messageActionSuggestedPostRefund(let _data): + return ("messageActionSuggestedPostRefund", [("flags", _data.flags as Any)]) + case .messageActionSuggestedPostSuccess(let _data): + return ("messageActionSuggestedPostSuccess", [("price", _data.price as Any)]) + case .messageActionTodoAppendTasks(let _data): + return ("messageActionTodoAppendTasks", [("list", _data.list as Any)]) + case .messageActionTodoCompletions(let _data): + return ("messageActionTodoCompletions", [("completed", _data.completed as Any), ("incompleted", _data.incompleted as Any)]) + case .messageActionTopicCreate(let _data): + return ("messageActionTopicCreate", [("flags", _data.flags as Any), ("title", _data.title as Any), ("iconColor", _data.iconColor as Any), ("iconEmojiId", _data.iconEmojiId as Any)]) + case .messageActionTopicEdit(let _data): + return ("messageActionTopicEdit", [("flags", _data.flags as Any), ("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("closed", _data.closed as Any), ("hidden", _data.hidden as Any)]) + case .messageActionWebViewDataSent(let _data): + return ("messageActionWebViewDataSent", [("text", _data.text as Any)]) + case .messageActionWebViewDataSentMe(let _data): + return ("messageActionWebViewDataSentMe", [("text", _data.text as Any), ("data", _data.data as Any)]) + } + } + public static func parse_messageActionBoostApply(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionBoostApply(boosts: _1!) + return Api.MessageAction.messageActionBoostApply(Cons_messageActionBoostApply(boosts: _1!)) } else { return nil @@ -1751,16 +2871,20 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: Api.BotApp? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.BotApp - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.BotApp + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionBotAllowed(flags: _1!, domain: _2, app: _3) + return Api.MessageAction.messageActionBotAllowed(Cons_messageActionBotAllowed(flags: _1!, domain: _2, app: _3)) } else { return nil @@ -1771,7 +2895,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChannelCreate(title: _1!) + return Api.MessageAction.messageActionChannelCreate(Cons_messageActionChannelCreate(title: _1!)) } else { return nil @@ -1785,7 +2909,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionChannelMigrateFrom(title: _1!, chatId: _2!) + return Api.MessageAction.messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom(title: _1!, chatId: _2!)) } else { return nil @@ -1798,7 +2922,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatAddUser(users: _1!) + return Api.MessageAction.messageActionChatAddUser(Cons_messageActionChatAddUser(users: _1!)) } else { return nil @@ -1814,7 +2938,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionChatCreate(title: _1!, users: _2!) + return Api.MessageAction.messageActionChatCreate(Cons_messageActionChatCreate(title: _1!, users: _2!)) } else { return nil @@ -1828,7 +2952,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatDeleteUser(userId: _1!) + return Api.MessageAction.messageActionChatDeleteUser(Cons_messageActionChatDeleteUser(userId: _1!)) } else { return nil @@ -1841,7 +2965,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatEditPhoto(photo: _1!) + return Api.MessageAction.messageActionChatEditPhoto(Cons_messageActionChatEditPhoto(photo: _1!)) } else { return nil @@ -1852,7 +2976,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatEditTitle(title: _1!) + return Api.MessageAction.messageActionChatEditTitle(Cons_messageActionChatEditTitle(title: _1!)) } else { return nil @@ -1863,7 +2987,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatJoinedByLink(inviterId: _1!) + return Api.MessageAction.messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink(inviterId: _1!)) } else { return nil @@ -1877,7 +3001,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionChatMigrateTo(channelId: _1!) + return Api.MessageAction.messageActionChatMigrateTo(Cons_messageActionChatMigrateTo(channelId: _1!)) } else { return nil @@ -1889,17 +3013,21 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } var _4: [Api.Peer]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionConferenceCall(flags: _1!, callId: _2!, duration: _3, otherParticipants: _4) + return Api.MessageAction.messageActionConferenceCall(Cons_messageActionConferenceCall(flags: _1!, callId: _2!, duration: _3, otherParticipants: _4)) } else { return nil @@ -1913,7 +3041,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionCustomAction(message: _1!) + return Api.MessageAction.messageActionCustomAction(Cons_messageActionCustomAction(message: _1!)) } else { return nil @@ -1930,7 +3058,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionGameScore(gameId: _1!, score: _2!) + return Api.MessageAction.messageActionGameScore(Cons_messageActionGameScore(gameId: _1!, score: _2!)) } else { return nil @@ -1951,7 +3079,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGeoProximityReached(fromId: _1!, toId: _2!, distance: _3!) + return Api.MessageAction.messageActionGeoProximityReached(Cons_messageActionGeoProximityReached(fromId: _1!, toId: _2!, distance: _3!)) } else { return nil @@ -1961,25 +3089,37 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Int32? _3 = reader.readInt32() var _4: String? _4 = parseString(reader) var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = reader.readInt64() + } var _7: String? - if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } var _8: Int64? - if Int(_1!) & Int(1 << 3) != 0 {_8 = reader.readInt64() } + if Int(_1!) & Int(1 << 3) != 0 { + _8 = reader.readInt64() + } var _9: Api.TextWithEntities? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = _3 != nil @@ -1990,7 +3130,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 3) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.MessageAction.messageActionGiftCode(flags: _1!, boostPeer: _2, days: _3!, slug: _4!, currency: _5, amount: _6, cryptoCurrency: _7, cryptoAmount: _8, message: _9) + return Api.MessageAction.messageActionGiftCode(Cons_messageActionGiftCode(flags: _1!, boostPeer: _2, days: _3!, slug: _4!, currency: _5, amount: _6, cryptoCurrency: _7, cryptoAmount: _8, message: _9)) } else { return nil @@ -2006,13 +3146,19 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: String? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } var _6: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt64() + } var _7: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2021,7 +3167,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MessageAction.messageActionGiftPremium(flags: _1!, currency: _2!, amount: _3!, days: _4!, cryptoCurrency: _5, cryptoAmount: _6, message: _7) + return Api.MessageAction.messageActionGiftPremium(Cons_messageActionGiftPremium(flags: _1!, currency: _2!, amount: _3!, days: _4!, cryptoCurrency: _5, cryptoAmount: _6, message: _7)) } else { return nil @@ -2037,11 +3183,17 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: String? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } var _6: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt64() + } var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2050,7 +3202,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MessageAction.messageActionGiftStars(flags: _1!, currency: _2!, amount: _3!, stars: _4!, cryptoCurrency: _5, cryptoAmount: _6, transactionId: _7) + return Api.MessageAction.messageActionGiftStars(Cons_messageActionGiftStars(flags: _1!, currency: _2!, amount: _3!, stars: _4!, cryptoCurrency: _5, cryptoAmount: _6, transactionId: _7)) } else { return nil @@ -2068,7 +3220,9 @@ public extension Api { var _5: Int64? _5 = reader.readInt64() var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2076,7 +3230,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageAction.messageActionGiftTon(flags: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, transactionId: _6) + return Api.MessageAction.messageActionGiftTon(Cons_messageActionGiftTon(flags: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, transactionId: _6)) } else { return nil @@ -2086,11 +3240,13 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionGiveawayLaunch(flags: _1!, stars: _2) + return Api.MessageAction.messageActionGiveawayLaunch(Cons_messageActionGiveawayLaunch(flags: _1!, stars: _2)) } else { return nil @@ -2107,7 +3263,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGiveawayResults(flags: _1!, winnersCount: _2!, unclaimedCount: _3!) + return Api.MessageAction.messageActionGiveawayResults(Cons_messageActionGiveawayResults(flags: _1!, winnersCount: _2!, unclaimedCount: _3!)) } else { return nil @@ -2121,12 +3277,14 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputGroupCall } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGroupCall(flags: _1!, call: _2!, duration: _3) + return Api.MessageAction.messageActionGroupCall(Cons_messageActionGroupCall(flags: _1!, call: _2!, duration: _3)) } else { return nil @@ -2142,7 +3300,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionGroupCallScheduled(call: _1!, scheduleDate: _2!) + return Api.MessageAction.messageActionGroupCallScheduled(Cons_messageActionGroupCallScheduled(call: _1!, scheduleDate: _2!)) } else { return nil @@ -2163,7 +3321,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionInviteToGroupCall(call: _1!, users: _2!) + return Api.MessageAction.messageActionInviteToGroupCall(Cons_messageActionInviteToGroupCall(call: _1!, users: _2!)) } else { return nil @@ -2177,7 +3335,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionPaidMessagesPrice(flags: _1!, stars: _2!) + return Api.MessageAction.messageActionPaidMessagesPrice(Cons_messageActionPaidMessagesPrice(flags: _1!, stars: _2!)) } else { return nil @@ -2191,7 +3349,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionPaidMessagesRefunded(count: _1!, stars: _2!) + return Api.MessageAction.messageActionPaidMessagesRefunded(Cons_messageActionPaidMessagesRefunded(count: _1!, stars: _2!)) } else { return nil @@ -2209,7 +3367,9 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseBytes(reader) + } var _6: Api.PaymentCharge? if let signature = reader.readInt32() { _6 = Api.parse(reader, signature: signature) as? Api.PaymentCharge @@ -2221,7 +3381,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageAction.messageActionPaymentRefunded(flags: _1!, peer: _2!, currency: _3!, totalAmount: _4!, payload: _5, charge: _6!) + return Api.MessageAction.messageActionPaymentRefunded(Cons_messageActionPaymentRefunded(flags: _1!, peer: _2!, currency: _3!, totalAmount: _4!, payload: _5, charge: _6!)) } else { return nil @@ -2235,16 +3395,20 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionPaymentSent(flags: _1!, currency: _2!, totalAmount: _3!, invoiceSlug: _4, subscriptionUntilDate: _5) + return Api.MessageAction.messageActionPaymentSent(Cons_messageActionPaymentSent(flags: _1!, currency: _2!, totalAmount: _3!, invoiceSlug: _4, subscriptionUntilDate: _5)) } else { return nil @@ -2260,17 +3424,23 @@ public extension Api { var _4: Buffer? _4 = parseBytes(reader) var _5: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } var _6: String? - if Int(_1!) & Int(1 << 1) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = parseString(reader) + } var _7: Api.PaymentCharge? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.PaymentCharge } var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2280,7 +3450,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.MessageAction.messageActionPaymentSentMe(flags: _1!, currency: _2!, totalAmount: _3!, payload: _4!, info: _5, shippingOptionId: _6, charge: _7!, subscriptionUntilDate: _8) + return Api.MessageAction.messageActionPaymentSentMe(Cons_messageActionPaymentSentMe(flags: _1!, currency: _2!, totalAmount: _3!, payload: _4!, info: _5, shippingOptionId: _6, charge: _7!, subscriptionUntilDate: _8)) } else { return nil @@ -2292,17 +3462,21 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Api.PhoneCallDiscardReason? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason + } + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionPhoneCall(flags: _1!, callId: _2!, reason: _3, duration: _4) + return Api.MessageAction.messageActionPhoneCall(Cons_messageActionPhoneCall(flags: _1!, callId: _2!, reason: _3, duration: _4)) } else { return nil @@ -2330,7 +3504,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionPrizeStars(flags: _1!, stars: _2!, transactionId: _3!, boostPeer: _4!, giveawayMsgId: _5!) + return Api.MessageAction.messageActionPrizeStars(Cons_messageActionPrizeStars(flags: _1!, stars: _2!, transactionId: _3!, boostPeer: _4!, giveawayMsgId: _5!)) } else { return nil @@ -2346,7 +3520,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionRequestedPeer(buttonId: _1!, peers: _2!) + return Api.MessageAction.messageActionRequestedPeer(Cons_messageActionRequestedPeer(buttonId: _1!, peers: _2!)) } else { return nil @@ -2362,7 +3536,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionRequestedPeerSentMe(buttonId: _1!, peers: _2!) + return Api.MessageAction.messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe(buttonId: _1!, peers: _2!)) } else { return nil @@ -2378,7 +3552,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSecureValuesSent(types: _1!) + return Api.MessageAction.messageActionSecureValuesSent(Cons_messageActionSecureValuesSent(types: _1!)) } else { return nil @@ -2396,7 +3570,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionSecureValuesSentMe(values: _1!, credentials: _2!) + return Api.MessageAction.messageActionSecureValuesSentMe(Cons_messageActionSecureValuesSentMe(values: _1!, credentials: _2!)) } else { return nil @@ -2409,7 +3583,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSetChatTheme(theme: _1!) + return Api.MessageAction.messageActionSetChatTheme(Cons_messageActionSetChatTheme(theme: _1!)) } else { return nil @@ -2425,7 +3599,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionSetChatWallPaper(flags: _1!, wallpaper: _2!) + return Api.MessageAction.messageActionSetChatWallPaper(Cons_messageActionSetChatWallPaper(flags: _1!, wallpaper: _2!)) } else { return nil @@ -2437,12 +3611,14 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionSetMessagesTTL(flags: _1!, period: _2!, autoSettingFrom: _3) + return Api.MessageAction.messageActionSetMessagesTTL(Cons_messageActionSetMessagesTTL(flags: _1!, period: _2!, autoSettingFrom: _3)) } else { return nil @@ -2456,35 +3632,57 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.StarGift } var _3: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } var _4: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } var _5: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _5 = reader.readInt32() + } var _6: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _6 = reader.readInt64() + } var _7: Api.Peer? - if Int(_1!) & Int(1 << 11) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 11) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _8: Api.Peer? - if Int(_1!) & Int(1 << 12) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _9: Int64? - if Int(_1!) & Int(1 << 12) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 12) != 0 { + _9 = reader.readInt64() + } var _10: String? - if Int(_1!) & Int(1 << 14) != 0 {_10 = parseString(reader) } + if Int(_1!) & Int(1 << 14) != 0 { + _10 = parseString(reader) + } var _11: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _11 = reader.readInt32() + } var _12: Api.Peer? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _13: Int32? - if Int(_1!) & Int(1 << 19) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 19) != 0 { + _13 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -2499,7 +3697,7 @@ public extension Api { let _c12 = (Int(_1!) & Int(1 << 18) == 0) || _12 != nil let _c13 = (Int(_1!) & Int(1 << 19) == 0) || _13 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.MessageAction.messageActionStarGift(flags: _1!, gift: _2!, message: _3, convertStars: _4, upgradeMsgId: _5, upgradeStars: _6, fromId: _7, peer: _8, savedId: _9, prepaidUpgradeHash: _10, giftMsgId: _11, toId: _12, giftNum: _13) + return Api.MessageAction.messageActionStarGift(Cons_messageActionStarGift(flags: _1!, gift: _2!, message: _3, convertStars: _4, upgradeMsgId: _5, upgradeStars: _6, fromId: _7, peer: _8, savedId: _9, prepaidUpgradeHash: _10, giftMsgId: _11, toId: _12, giftNum: _13)) } else { return nil @@ -2523,7 +3721,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionStarGiftPurchaseOffer(flags: _1!, gift: _2!, price: _3!, expiresAt: _4!) + return Api.MessageAction.messageActionStarGiftPurchaseOffer(Cons_messageActionStarGiftPurchaseOffer(flags: _1!, gift: _2!, price: _3!, expiresAt: _4!)) } else { return nil @@ -2544,7 +3742,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionStarGiftPurchaseOfferDeclined(flags: _1!, gift: _2!, price: _3!) + return Api.MessageAction.messageActionStarGiftPurchaseOfferDeclined(Cons_messageActionStarGiftPurchaseOfferDeclined(flags: _1!, gift: _2!, price: _3!)) } else { return nil @@ -2558,31 +3756,51 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.StarGift } var _3: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } var _4: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } var _5: Api.Peer? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _6: Api.Peer? - if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _7: Int64? - if Int(_1!) & Int(1 << 7) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 7) != 0 { + _7 = reader.readInt64() + } var _8: Api.StarsAmount? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } var _9: Int32? - if Int(_1!) & Int(1 << 9) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 9) != 0 { + _9 = reader.readInt32() + } var _10: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _10 = reader.readInt32() + } var _11: Int64? - if Int(_1!) & Int(1 << 12) != 0 {_11 = reader.readInt64() } + if Int(_1!) & Int(1 << 12) != 0 { + _11 = reader.readInt64() + } var _12: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _12 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil @@ -2596,7 +3814,7 @@ public extension Api { let _c11 = (Int(_1!) & Int(1 << 12) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 15) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.MessageAction.messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleAmount: _8, canTransferAt: _9, canResellAt: _10, dropOriginalDetailsStars: _11, canCraftAt: _12) + return Api.MessageAction.messageActionStarGiftUnique(Cons_messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleAmount: _8, canTransferAt: _9, canResellAt: _10, dropOriginalDetailsStars: _11, canCraftAt: _12)) } else { return nil @@ -2609,7 +3827,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSuggestBirthday(birthday: _1!) + return Api.MessageAction.messageActionSuggestBirthday(Cons_messageActionSuggestBirthday(birthday: _1!)) } else { return nil @@ -2622,7 +3840,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSuggestProfilePhoto(photo: _1!) + return Api.MessageAction.messageActionSuggestProfilePhoto(Cons_messageActionSuggestProfilePhoto(photo: _1!)) } else { return nil @@ -2632,19 +3850,25 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 2) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _2 = parseString(reader) + } var _3: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } var _4: Api.StarsAmount? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 4) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionSuggestedPostApproval(flags: _1!, rejectComment: _2, scheduleDate: _3, price: _4) + return Api.MessageAction.messageActionSuggestedPostApproval(Cons_messageActionSuggestedPostApproval(flags: _1!, rejectComment: _2, scheduleDate: _3, price: _4)) } else { return nil @@ -2655,7 +3879,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSuggestedPostRefund(flags: _1!) + return Api.MessageAction.messageActionSuggestedPostRefund(Cons_messageActionSuggestedPostRefund(flags: _1!)) } else { return nil @@ -2668,7 +3892,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionSuggestedPostSuccess(price: _1!) + return Api.MessageAction.messageActionSuggestedPostSuccess(Cons_messageActionSuggestedPostSuccess(price: _1!)) } else { return nil @@ -2681,7 +3905,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionTodoAppendTasks(list: _1!) + return Api.MessageAction.messageActionTodoAppendTasks(Cons_messageActionTodoAppendTasks(list: _1!)) } else { return nil @@ -2699,7 +3923,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionTodoCompletions(completed: _1!, incompleted: _2!) + return Api.MessageAction.messageActionTodoCompletions(Cons_messageActionTodoCompletions(completed: _1!, incompleted: _2!)) } else { return nil @@ -2713,13 +3937,15 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionTopicCreate(flags: _1!, title: _2!, iconColor: _3!, iconEmojiId: _4) + return Api.MessageAction.messageActionTopicCreate(Cons_messageActionTopicCreate(flags: _1!, title: _2!, iconColor: _3!, iconEmojiId: _4)) } else { return nil @@ -2729,24 +3955,32 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt64() + } var _4: Api.Bool? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _5: Api.Bool? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Bool + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionTopicEdit(flags: _1!, title: _2, iconEmojiId: _3, closed: _4, hidden: _5) + return Api.MessageAction.messageActionTopicEdit(Cons_messageActionTopicEdit(flags: _1!, title: _2, iconEmojiId: _3, closed: _4, hidden: _5)) } else { return nil @@ -2757,7 +3991,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.MessageAction.messageActionWebViewDataSent(text: _1!) + return Api.MessageAction.messageActionWebViewDataSent(Cons_messageActionWebViewDataSent(text: _1!)) } else { return nil @@ -2771,12 +4005,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageAction.messageActionWebViewDataSentMe(text: _1!, data: _2!) + return Api.MessageAction.messageActionWebViewDataSentMe(Cons_messageActionWebViewDataSentMe(text: _1!, data: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api16.swift b/submodules/TelegramApi/Sources/Api16.swift index ccdc5baba2..c06f17560a 100644 --- a/submodules/TelegramApi/Sources/Api16.swift +++ b/submodules/TelegramApi/Sources/Api16.swift @@ -1,232 +1,412 @@ public extension Api { indirect enum MessageEntity: TypeConstructorDescription { - case inputMessageEntityMentionName(offset: Int32, length: Int32, userId: Api.InputUser) - case messageEntityBankCard(offset: Int32, length: Int32) - case messageEntityBlockquote(flags: Int32, offset: Int32, length: Int32) - case messageEntityBold(offset: Int32, length: Int32) - case messageEntityBotCommand(offset: Int32, length: Int32) - case messageEntityCashtag(offset: Int32, length: Int32) - case messageEntityCode(offset: Int32, length: Int32) - case messageEntityCustomEmoji(offset: Int32, length: Int32, documentId: Int64) - case messageEntityEmail(offset: Int32, length: Int32) - case messageEntityHashtag(offset: Int32, length: Int32) - case messageEntityItalic(offset: Int32, length: Int32) - case messageEntityMention(offset: Int32, length: Int32) - case messageEntityMentionName(offset: Int32, length: Int32, userId: Int64) - case messageEntityPhone(offset: Int32, length: Int32) - case messageEntityPre(offset: Int32, length: Int32, language: String) - case messageEntitySpoiler(offset: Int32, length: Int32) - case messageEntityStrike(offset: Int32, length: Int32) - case messageEntityTextUrl(offset: Int32, length: Int32, url: String) - case messageEntityUnderline(offset: Int32, length: Int32) - case messageEntityUnknown(offset: Int32, length: Int32) - case messageEntityUrl(offset: Int32, length: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputMessageEntityMentionName(let offset, let length, let userId): - if boxed { - buffer.appendInt32(546203849) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - break - case .messageEntityBankCard(let offset, let length): - if boxed { - buffer.appendInt32(1981704948) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityBlockquote(let flags, let offset, let length): - if boxed { - buffer.appendInt32(-238245204) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityBold(let offset, let length): - if boxed { - buffer.appendInt32(-1117713463) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityBotCommand(let offset, let length): - if boxed { - buffer.appendInt32(1827637959) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityCashtag(let offset, let length): - if boxed { - buffer.appendInt32(1280209983) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityCode(let offset, let length): - if boxed { - buffer.appendInt32(681706865) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityCustomEmoji(let offset, let length, let documentId): - if boxed { - buffer.appendInt32(-925956616) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - serializeInt64(documentId, buffer: buffer, boxed: false) - break - case .messageEntityEmail(let offset, let length): - if boxed { - buffer.appendInt32(1692693954) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityHashtag(let offset, let length): - if boxed { - buffer.appendInt32(1868782349) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityItalic(let offset, let length): - if boxed { - buffer.appendInt32(-2106619040) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityMention(let offset, let length): - if boxed { - buffer.appendInt32(-100378723) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityMentionName(let offset, let length, let userId): - if boxed { - buffer.appendInt32(-595914432) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .messageEntityPhone(let offset, let length): - if boxed { - buffer.appendInt32(-1687559349) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityPre(let offset, let length, let language): - if boxed { - buffer.appendInt32(1938967520) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - serializeString(language, buffer: buffer, boxed: false) - break - case .messageEntitySpoiler(let offset, let length): - if boxed { - buffer.appendInt32(852137487) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityStrike(let offset, let length): - if boxed { - buffer.appendInt32(-1090087980) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityTextUrl(let offset, let length, let url): - if boxed { - buffer.appendInt32(1990644519) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - case .messageEntityUnderline(let offset, let length): - if boxed { - buffer.appendInt32(-1672577397) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityUnknown(let offset, let length): - if boxed { - buffer.appendInt32(-1148011883) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .messageEntityUrl(let offset, let length): - if boxed { - buffer.appendInt32(1859134776) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputMessageEntityMentionName(let offset, let length, let userId): - return ("inputMessageEntityMentionName", [("offset", offset as Any), ("length", length as Any), ("userId", userId as Any)]) - case .messageEntityBankCard(let offset, let length): - return ("messageEntityBankCard", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityBlockquote(let flags, let offset, let length): - return ("messageEntityBlockquote", [("flags", flags as Any), ("offset", offset as Any), ("length", length as Any)]) - case .messageEntityBold(let offset, let length): - return ("messageEntityBold", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityBotCommand(let offset, let length): - return ("messageEntityBotCommand", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityCashtag(let offset, let length): - return ("messageEntityCashtag", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityCode(let offset, let length): - return ("messageEntityCode", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityCustomEmoji(let offset, let length, let documentId): - return ("messageEntityCustomEmoji", [("offset", offset as Any), ("length", length as Any), ("documentId", documentId as Any)]) - case .messageEntityEmail(let offset, let length): - return ("messageEntityEmail", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityHashtag(let offset, let length): - return ("messageEntityHashtag", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityItalic(let offset, let length): - return ("messageEntityItalic", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityMention(let offset, let length): - return ("messageEntityMention", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityMentionName(let offset, let length, let userId): - return ("messageEntityMentionName", [("offset", offset as Any), ("length", length as Any), ("userId", userId as Any)]) - case .messageEntityPhone(let offset, let length): - return ("messageEntityPhone", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityPre(let offset, let length, let language): - return ("messageEntityPre", [("offset", offset as Any), ("length", length as Any), ("language", language as Any)]) - case .messageEntitySpoiler(let offset, let length): - return ("messageEntitySpoiler", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityStrike(let offset, let length): - return ("messageEntityStrike", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityTextUrl(let offset, let length, let url): - return ("messageEntityTextUrl", [("offset", offset as Any), ("length", length as Any), ("url", url as Any)]) - case .messageEntityUnderline(let offset, let length): - return ("messageEntityUnderline", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityUnknown(let offset, let length): - return ("messageEntityUnknown", [("offset", offset as Any), ("length", length as Any)]) - case .messageEntityUrl(let offset, let length): - return ("messageEntityUrl", [("offset", offset as Any), ("length", length as Any)]) - } - } - + public class Cons_inputMessageEntityMentionName { + public var offset: Int32 + public var length: Int32 + public var userId: Api.InputUser + public init(offset: Int32, length: Int32, userId: Api.InputUser) { + self.offset = offset + self.length = length + self.userId = userId + } + } + public class Cons_messageEntityBankCard { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityBlockquote { + public var flags: Int32 + public var offset: Int32 + public var length: Int32 + public init(flags: Int32, offset: Int32, length: Int32) { + self.flags = flags + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityBold { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityBotCommand { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityCashtag { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityCode { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityCustomEmoji { + public var offset: Int32 + public var length: Int32 + public var documentId: Int64 + public init(offset: Int32, length: Int32, documentId: Int64) { + self.offset = offset + self.length = length + self.documentId = documentId + } + } + public class Cons_messageEntityEmail { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityHashtag { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityItalic { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityMention { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityMentionName { + public var offset: Int32 + public var length: Int32 + public var userId: Int64 + public init(offset: Int32, length: Int32, userId: Int64) { + self.offset = offset + self.length = length + self.userId = userId + } + } + public class Cons_messageEntityPhone { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityPre { + public var offset: Int32 + public var length: Int32 + public var language: String + public init(offset: Int32, length: Int32, language: String) { + self.offset = offset + self.length = length + self.language = language + } + } + public class Cons_messageEntitySpoiler { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityStrike { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityTextUrl { + public var offset: Int32 + public var length: Int32 + public var url: String + public init(offset: Int32, length: Int32, url: String) { + self.offset = offset + self.length = length + self.url = url + } + } + public class Cons_messageEntityUnderline { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityUnknown { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + public class Cons_messageEntityUrl { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + } + case inputMessageEntityMentionName(Cons_inputMessageEntityMentionName) + case messageEntityBankCard(Cons_messageEntityBankCard) + case messageEntityBlockquote(Cons_messageEntityBlockquote) + case messageEntityBold(Cons_messageEntityBold) + case messageEntityBotCommand(Cons_messageEntityBotCommand) + case messageEntityCashtag(Cons_messageEntityCashtag) + case messageEntityCode(Cons_messageEntityCode) + case messageEntityCustomEmoji(Cons_messageEntityCustomEmoji) + case messageEntityEmail(Cons_messageEntityEmail) + case messageEntityHashtag(Cons_messageEntityHashtag) + case messageEntityItalic(Cons_messageEntityItalic) + case messageEntityMention(Cons_messageEntityMention) + case messageEntityMentionName(Cons_messageEntityMentionName) + case messageEntityPhone(Cons_messageEntityPhone) + case messageEntityPre(Cons_messageEntityPre) + case messageEntitySpoiler(Cons_messageEntitySpoiler) + case messageEntityStrike(Cons_messageEntityStrike) + case messageEntityTextUrl(Cons_messageEntityTextUrl) + case messageEntityUnderline(Cons_messageEntityUnderline) + case messageEntityUnknown(Cons_messageEntityUnknown) + case messageEntityUrl(Cons_messageEntityUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMessageEntityMentionName(let _data): + if boxed { + buffer.appendInt32(546203849) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + _data.userId.serialize(buffer, true) + break + case .messageEntityBankCard(let _data): + if boxed { + buffer.appendInt32(1981704948) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityBlockquote(let _data): + if boxed { + buffer.appendInt32(-238245204) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityBold(let _data): + if boxed { + buffer.appendInt32(-1117713463) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityBotCommand(let _data): + if boxed { + buffer.appendInt32(1827637959) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityCashtag(let _data): + if boxed { + buffer.appendInt32(1280209983) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityCode(let _data): + if boxed { + buffer.appendInt32(681706865) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityCustomEmoji(let _data): + if boxed { + buffer.appendInt32(-925956616) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + break + case .messageEntityEmail(let _data): + if boxed { + buffer.appendInt32(1692693954) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityHashtag(let _data): + if boxed { + buffer.appendInt32(1868782349) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityItalic(let _data): + if boxed { + buffer.appendInt32(-2106619040) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityMention(let _data): + if boxed { + buffer.appendInt32(-100378723) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityMentionName(let _data): + if boxed { + buffer.appendInt32(-595914432) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .messageEntityPhone(let _data): + if boxed { + buffer.appendInt32(-1687559349) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityPre(let _data): + if boxed { + buffer.appendInt32(1938967520) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + serializeString(_data.language, buffer: buffer, boxed: false) + break + case .messageEntitySpoiler(let _data): + if boxed { + buffer.appendInt32(852137487) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityStrike(let _data): + if boxed { + buffer.appendInt32(-1090087980) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityTextUrl(let _data): + if boxed { + buffer.appendInt32(1990644519) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .messageEntityUnderline(let _data): + if boxed { + buffer.appendInt32(-1672577397) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityUnknown(let _data): + if boxed { + buffer.appendInt32(-1148011883) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityUrl(let _data): + if boxed { + buffer.appendInt32(1859134776) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMessageEntityMentionName(let _data): + return ("inputMessageEntityMentionName", [("offset", _data.offset as Any), ("length", _data.length as Any), ("userId", _data.userId as Any)]) + case .messageEntityBankCard(let _data): + return ("messageEntityBankCard", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityBlockquote(let _data): + return ("messageEntityBlockquote", [("flags", _data.flags as Any), ("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityBold(let _data): + return ("messageEntityBold", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityBotCommand(let _data): + return ("messageEntityBotCommand", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityCashtag(let _data): + return ("messageEntityCashtag", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityCode(let _data): + return ("messageEntityCode", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityCustomEmoji(let _data): + return ("messageEntityCustomEmoji", [("offset", _data.offset as Any), ("length", _data.length as Any), ("documentId", _data.documentId as Any)]) + case .messageEntityEmail(let _data): + return ("messageEntityEmail", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityHashtag(let _data): + return ("messageEntityHashtag", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityItalic(let _data): + return ("messageEntityItalic", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityMention(let _data): + return ("messageEntityMention", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityMentionName(let _data): + return ("messageEntityMentionName", [("offset", _data.offset as Any), ("length", _data.length as Any), ("userId", _data.userId as Any)]) + case .messageEntityPhone(let _data): + return ("messageEntityPhone", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityPre(let _data): + return ("messageEntityPre", [("offset", _data.offset as Any), ("length", _data.length as Any), ("language", _data.language as Any)]) + case .messageEntitySpoiler(let _data): + return ("messageEntitySpoiler", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityStrike(let _data): + return ("messageEntityStrike", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityTextUrl(let _data): + return ("messageEntityTextUrl", [("offset", _data.offset as Any), ("length", _data.length as Any), ("url", _data.url as Any)]) + case .messageEntityUnderline(let _data): + return ("messageEntityUnderline", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityUnknown(let _data): + return ("messageEntityUnknown", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + case .messageEntityUrl(let _data): + return ("messageEntityUrl", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + } + } + public static func parse_inputMessageEntityMentionName(_ reader: BufferReader) -> MessageEntity? { var _1: Int32? _1 = reader.readInt32() @@ -240,7 +420,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.inputMessageEntityMentionName(offset: _1!, length: _2!, userId: _3!) + return Api.MessageEntity.inputMessageEntityMentionName(Cons_inputMessageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) } else { return nil @@ -254,7 +434,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityBankCard(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityBankCard(Cons_messageEntityBankCard(offset: _1!, length: _2!)) } else { return nil @@ -271,7 +451,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityBlockquote(flags: _1!, offset: _2!, length: _3!) + return Api.MessageEntity.messageEntityBlockquote(Cons_messageEntityBlockquote(flags: _1!, offset: _2!, length: _3!)) } else { return nil @@ -285,7 +465,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityBold(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityBold(Cons_messageEntityBold(offset: _1!, length: _2!)) } else { return nil @@ -299,7 +479,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityBotCommand(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityBotCommand(Cons_messageEntityBotCommand(offset: _1!, length: _2!)) } else { return nil @@ -313,7 +493,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityCashtag(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityCashtag(Cons_messageEntityCashtag(offset: _1!, length: _2!)) } else { return nil @@ -327,7 +507,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityCode(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityCode(Cons_messageEntityCode(offset: _1!, length: _2!)) } else { return nil @@ -344,7 +524,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityCustomEmoji(offset: _1!, length: _2!, documentId: _3!) + return Api.MessageEntity.messageEntityCustomEmoji(Cons_messageEntityCustomEmoji(offset: _1!, length: _2!, documentId: _3!)) } else { return nil @@ -358,7 +538,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityEmail(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityEmail(Cons_messageEntityEmail(offset: _1!, length: _2!)) } else { return nil @@ -372,7 +552,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityHashtag(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityHashtag(Cons_messageEntityHashtag(offset: _1!, length: _2!)) } else { return nil @@ -386,7 +566,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityItalic(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityItalic(Cons_messageEntityItalic(offset: _1!, length: _2!)) } else { return nil @@ -400,7 +580,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityMention(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityMention(Cons_messageEntityMention(offset: _1!, length: _2!)) } else { return nil @@ -417,7 +597,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityMentionName(offset: _1!, length: _2!, userId: _3!) + return Api.MessageEntity.messageEntityMentionName(Cons_messageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) } else { return nil @@ -431,7 +611,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityPhone(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityPhone(Cons_messageEntityPhone(offset: _1!, length: _2!)) } else { return nil @@ -448,7 +628,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityPre(offset: _1!, length: _2!, language: _3!) + return Api.MessageEntity.messageEntityPre(Cons_messageEntityPre(offset: _1!, length: _2!, language: _3!)) } else { return nil @@ -462,7 +642,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntitySpoiler(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntitySpoiler(Cons_messageEntitySpoiler(offset: _1!, length: _2!)) } else { return nil @@ -476,7 +656,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityStrike(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityStrike(Cons_messageEntityStrike(offset: _1!, length: _2!)) } else { return nil @@ -493,7 +673,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityTextUrl(offset: _1!, length: _2!, url: _3!) + return Api.MessageEntity.messageEntityTextUrl(Cons_messageEntityTextUrl(offset: _1!, length: _2!, url: _3!)) } else { return nil @@ -507,7 +687,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityUnderline(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityUnderline(Cons_messageEntityUnderline(offset: _1!, length: _2!)) } else { return nil @@ -521,7 +701,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityUnknown(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityUnknown(Cons_messageEntityUnknown(offset: _1!, length: _2!)) } else { return nil @@ -535,50 +715,77 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageEntity.messageEntityUrl(offset: _1!, length: _2!) + return Api.MessageEntity.messageEntityUrl(Cons_messageEntityUrl(offset: _1!, length: _2!)) } else { return nil } } - } } public extension Api { indirect enum MessageExtendedMedia: TypeConstructorDescription { - case messageExtendedMedia(media: Api.MessageMedia) - case messageExtendedMediaPreview(flags: Int32, w: Int32?, h: Int32?, thumb: Api.PhotoSize?, videoDuration: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageExtendedMedia(let media): - if boxed { - buffer.appendInt32(-297296796) - } - media.serialize(buffer, true) - break - case .messageExtendedMediaPreview(let flags, let w, let h, let thumb, let videoDuration): - if boxed { - buffer.appendInt32(-1386050360) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(w!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(h!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {thumb!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(videoDuration!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageExtendedMedia(let media): - return ("messageExtendedMedia", [("media", media as Any)]) - case .messageExtendedMediaPreview(let flags, let w, let h, let thumb, let videoDuration): - return ("messageExtendedMediaPreview", [("flags", flags as Any), ("w", w as Any), ("h", h as Any), ("thumb", thumb as Any), ("videoDuration", videoDuration as Any)]) - } - } - + public class Cons_messageExtendedMedia { + public var media: Api.MessageMedia + public init(media: Api.MessageMedia) { + self.media = media + } + } + public class Cons_messageExtendedMediaPreview { + public var flags: Int32 + public var w: Int32? + public var h: Int32? + public var thumb: Api.PhotoSize? + public var videoDuration: Int32? + public init(flags: Int32, w: Int32?, h: Int32?, thumb: Api.PhotoSize?, videoDuration: Int32?) { + self.flags = flags + self.w = w + self.h = h + self.thumb = thumb + self.videoDuration = videoDuration + } + } + case messageExtendedMedia(Cons_messageExtendedMedia) + case messageExtendedMediaPreview(Cons_messageExtendedMediaPreview) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageExtendedMedia(let _data): + if boxed { + buffer.appendInt32(-297296796) + } + _data.media.serialize(buffer, true) + break + case .messageExtendedMediaPreview(let _data): + if boxed { + buffer.appendInt32(-1386050360) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.w!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.h!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.thumb!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.videoDuration!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageExtendedMedia(let _data): + return ("messageExtendedMedia", [("media", _data.media as Any)]) + case .messageExtendedMediaPreview(let _data): + return ("messageExtendedMediaPreview", [("flags", _data.flags as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("thumb", _data.thumb as Any), ("videoDuration", _data.videoDuration as Any)]) + } + } + public static func parse_messageExtendedMedia(_ reader: BufferReader) -> MessageExtendedMedia? { var _1: Api.MessageMedia? if let signature = reader.readInt32() { @@ -586,7 +793,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageExtendedMedia.messageExtendedMedia(media: _1!) + return Api.MessageExtendedMedia.messageExtendedMedia(Cons_messageExtendedMedia(media: _1!)) } else { return nil @@ -596,94 +803,169 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.PhotoSize? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.PhotoSize - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.PhotoSize + } + } var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageExtendedMedia.messageExtendedMediaPreview(flags: _1!, w: _2, h: _3, thumb: _4, videoDuration: _5) + return Api.MessageExtendedMedia.messageExtendedMediaPreview(Cons_messageExtendedMediaPreview(flags: _1!, w: _2, h: _3, thumb: _4, videoDuration: _5)) } else { return nil } } - } } public extension Api { enum MessageFwdHeader: TypeConstructorDescription { - case messageFwdHeader(flags: Int32, fromId: Api.Peer?, fromName: String?, date: Int32, channelPost: Int32?, postAuthor: String?, savedFromPeer: Api.Peer?, savedFromMsgId: Int32?, savedFromId: Api.Peer?, savedFromName: String?, savedDate: Int32?, psaType: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageFwdHeader(let flags, let fromId, let fromName, let date, let channelPost, let postAuthor, let savedFromPeer, let savedFromMsgId, let savedFromId, let savedFromName, let savedDate, let psaType): - if boxed { - buffer.appendInt32(1313731771) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(fromName!, buffer: buffer, boxed: false)} - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(channelPost!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(postAuthor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {savedFromPeer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(savedFromMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {savedFromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 9) != 0 {serializeString(savedFromName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(savedDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeString(psaType!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageFwdHeader(let flags, let fromId, let fromName, let date, let channelPost, let postAuthor, let savedFromPeer, let savedFromMsgId, let savedFromId, let savedFromName, let savedDate, let psaType): - return ("messageFwdHeader", [("flags", flags as Any), ("fromId", fromId as Any), ("fromName", fromName as Any), ("date", date as Any), ("channelPost", channelPost as Any), ("postAuthor", postAuthor as Any), ("savedFromPeer", savedFromPeer as Any), ("savedFromMsgId", savedFromMsgId as Any), ("savedFromId", savedFromId as Any), ("savedFromName", savedFromName as Any), ("savedDate", savedDate as Any), ("psaType", psaType as Any)]) - } - } - + public class Cons_messageFwdHeader { + public var flags: Int32 + public var fromId: Api.Peer? + public var fromName: String? + public var date: Int32 + public var channelPost: Int32? + public var postAuthor: String? + public var savedFromPeer: Api.Peer? + public var savedFromMsgId: Int32? + public var savedFromId: Api.Peer? + public var savedFromName: String? + public var savedDate: Int32? + public var psaType: String? + public init(flags: Int32, fromId: Api.Peer?, fromName: String?, date: Int32, channelPost: Int32?, postAuthor: String?, savedFromPeer: Api.Peer?, savedFromMsgId: Int32?, savedFromId: Api.Peer?, savedFromName: String?, savedDate: Int32?, psaType: String?) { + self.flags = flags + self.fromId = fromId + self.fromName = fromName + self.date = date + self.channelPost = channelPost + self.postAuthor = postAuthor + self.savedFromPeer = savedFromPeer + self.savedFromMsgId = savedFromMsgId + self.savedFromId = savedFromId + self.savedFromName = savedFromName + self.savedDate = savedDate + self.psaType = psaType + } + } + case messageFwdHeader(Cons_messageFwdHeader) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageFwdHeader(let _data): + if boxed { + buffer.appendInt32(1313731771) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.fromName!, buffer: buffer, boxed: false) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.channelPost!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.postAuthor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.savedFromPeer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.savedFromMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.savedFromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeString(_data.savedFromName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.savedDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.psaType!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageFwdHeader(let _data): + return ("messageFwdHeader", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("fromName", _data.fromName as Any), ("date", _data.date as Any), ("channelPost", _data.channelPost as Any), ("postAuthor", _data.postAuthor as Any), ("savedFromPeer", _data.savedFromPeer as Any), ("savedFromMsgId", _data.savedFromMsgId as Any), ("savedFromId", _data.savedFromId as Any), ("savedFromName", _data.savedFromName as Any), ("savedDate", _data.savedDate as Any), ("psaType", _data.psaType as Any)]) + } + } + public static func parse_messageFwdHeader(_ reader: BufferReader) -> MessageFwdHeader? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: String? - if Int(_1!) & Int(1 << 5) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _3 = parseString(reader) + } var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } var _7: Api.Peer? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } var _9: Api.Peer? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _10: String? - if Int(_1!) & Int(1 << 9) != 0 {_10 = parseString(reader) } + if Int(_1!) & Int(1 << 9) != 0 { + _10 = parseString(reader) + } var _11: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _11 = reader.readInt32() + } var _12: String? - if Int(_1!) & Int(1 << 6) != 0 {_12 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _12 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 5) == 0) || _3 != nil @@ -697,280 +979,539 @@ public extension Api { let _c11 = (Int(_1!) & Int(1 << 10) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 6) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.MessageFwdHeader.messageFwdHeader(flags: _1!, fromId: _2, fromName: _3, date: _4!, channelPost: _5, postAuthor: _6, savedFromPeer: _7, savedFromMsgId: _8, savedFromId: _9, savedFromName: _10, savedDate: _11, psaType: _12) + return Api.MessageFwdHeader.messageFwdHeader(Cons_messageFwdHeader(flags: _1!, fromId: _2, fromName: _3, date: _4!, channelPost: _5, postAuthor: _6, savedFromPeer: _7, savedFromMsgId: _8, savedFromId: _9, savedFromName: _10, savedDate: _11, psaType: _12)) } else { return nil } } - } } public extension Api { indirect enum MessageMedia: TypeConstructorDescription { - case messageMediaContact(phoneNumber: String, firstName: String, lastName: String, vcard: String, userId: Int64) - case messageMediaDice(flags: Int32, value: Int32, emoticon: String, gameOutcome: Api.messages.EmojiGameOutcome?) - case messageMediaDocument(flags: Int32, document: Api.Document?, altDocuments: [Api.Document]?, videoCover: Api.Photo?, videoTimestamp: Int32?, ttlSeconds: Int32?) + public class Cons_messageMediaContact { + public var phoneNumber: String + public var firstName: String + public var lastName: String + public var vcard: String + public var userId: Int64 + public init(phoneNumber: String, firstName: String, lastName: String, vcard: String, userId: Int64) { + self.phoneNumber = phoneNumber + self.firstName = firstName + self.lastName = lastName + self.vcard = vcard + self.userId = userId + } + } + public class Cons_messageMediaDice { + public var flags: Int32 + public var value: Int32 + public var emoticon: String + public var gameOutcome: Api.messages.EmojiGameOutcome? + public init(flags: Int32, value: Int32, emoticon: String, gameOutcome: Api.messages.EmojiGameOutcome?) { + self.flags = flags + self.value = value + self.emoticon = emoticon + self.gameOutcome = gameOutcome + } + } + public class Cons_messageMediaDocument { + public var flags: Int32 + public var document: Api.Document? + public var altDocuments: [Api.Document]? + public var videoCover: Api.Photo? + public var videoTimestamp: Int32? + public var ttlSeconds: Int32? + public init(flags: Int32, document: Api.Document?, altDocuments: [Api.Document]?, videoCover: Api.Photo?, videoTimestamp: Int32?, ttlSeconds: Int32?) { + self.flags = flags + self.document = document + self.altDocuments = altDocuments + self.videoCover = videoCover + self.videoTimestamp = videoTimestamp + self.ttlSeconds = ttlSeconds + } + } + public class Cons_messageMediaGame { + public var game: Api.Game + public init(game: Api.Game) { + self.game = game + } + } + public class Cons_messageMediaGeo { + public var geo: Api.GeoPoint + public init(geo: Api.GeoPoint) { + self.geo = geo + } + } + public class Cons_messageMediaGeoLive { + public var flags: Int32 + public var geo: Api.GeoPoint + public var heading: Int32? + public var period: Int32 + public var proximityNotificationRadius: Int32? + public init(flags: Int32, geo: Api.GeoPoint, heading: Int32?, period: Int32, proximityNotificationRadius: Int32?) { + self.flags = flags + self.geo = geo + self.heading = heading + self.period = period + self.proximityNotificationRadius = proximityNotificationRadius + } + } + public class Cons_messageMediaGiveaway { + public var flags: Int32 + public var channels: [Int64] + public var countriesIso2: [String]? + public var prizeDescription: String? + public var quantity: Int32 + public var months: Int32? + public var stars: Int64? + public var untilDate: Int32 + public init(flags: Int32, channels: [Int64], countriesIso2: [String]?, prizeDescription: String?, quantity: Int32, months: Int32?, stars: Int64?, untilDate: Int32) { + self.flags = flags + self.channels = channels + self.countriesIso2 = countriesIso2 + self.prizeDescription = prizeDescription + self.quantity = quantity + self.months = months + self.stars = stars + self.untilDate = untilDate + } + } + public class Cons_messageMediaGiveawayResults { + public var flags: Int32 + public var channelId: Int64 + public var additionalPeersCount: Int32? + public var launchMsgId: Int32 + public var winnersCount: Int32 + public var unclaimedCount: Int32 + public var winners: [Int64] + public var months: Int32? + public var stars: Int64? + public var prizeDescription: String? + public var untilDate: Int32 + public init(flags: Int32, channelId: Int64, additionalPeersCount: Int32?, launchMsgId: Int32, winnersCount: Int32, unclaimedCount: Int32, winners: [Int64], months: Int32?, stars: Int64?, prizeDescription: String?, untilDate: Int32) { + self.flags = flags + self.channelId = channelId + self.additionalPeersCount = additionalPeersCount + self.launchMsgId = launchMsgId + self.winnersCount = winnersCount + self.unclaimedCount = unclaimedCount + self.winners = winners + self.months = months + self.stars = stars + self.prizeDescription = prizeDescription + self.untilDate = untilDate + } + } + public class Cons_messageMediaInvoice { + public var flags: Int32 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var receiptMsgId: Int32? + public var currency: String + public var totalAmount: Int64 + public var startParam: String + public var extendedMedia: Api.MessageExtendedMedia? + public init(flags: Int32, title: String, description: String, photo: Api.WebDocument?, receiptMsgId: Int32?, currency: String, totalAmount: Int64, startParam: String, extendedMedia: Api.MessageExtendedMedia?) { + self.flags = flags + self.title = title + self.description = description + self.photo = photo + self.receiptMsgId = receiptMsgId + self.currency = currency + self.totalAmount = totalAmount + self.startParam = startParam + self.extendedMedia = extendedMedia + } + } + public class Cons_messageMediaPaidMedia { + public var starsAmount: Int64 + public var extendedMedia: [Api.MessageExtendedMedia] + public init(starsAmount: Int64, extendedMedia: [Api.MessageExtendedMedia]) { + self.starsAmount = starsAmount + self.extendedMedia = extendedMedia + } + } + public class Cons_messageMediaPhoto { + public var flags: Int32 + public var photo: Api.Photo? + public var ttlSeconds: Int32? + public init(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?) { + self.flags = flags + self.photo = photo + self.ttlSeconds = ttlSeconds + } + } + public class Cons_messageMediaPoll { + public var poll: Api.Poll + public var results: Api.PollResults + public init(poll: Api.Poll, results: Api.PollResults) { + self.poll = poll + self.results = results + } + } + public class Cons_messageMediaStory { + public var flags: Int32 + public var peer: Api.Peer + public var id: Int32 + public var story: Api.StoryItem? + public init(flags: Int32, peer: Api.Peer, id: Int32, story: Api.StoryItem?) { + self.flags = flags + self.peer = peer + self.id = id + self.story = story + } + } + public class Cons_messageMediaToDo { + public var flags: Int32 + public var todo: Api.TodoList + public var completions: [Api.TodoCompletion]? + public init(flags: Int32, todo: Api.TodoList, completions: [Api.TodoCompletion]?) { + self.flags = flags + self.todo = todo + self.completions = completions + } + } + public class Cons_messageMediaVenue { + public var geo: Api.GeoPoint + public var title: String + public var address: String + public var provider: String + public var venueId: String + public var venueType: String + public init(geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) { + self.geo = geo + self.title = title + self.address = address + self.provider = provider + self.venueId = venueId + self.venueType = venueType + } + } + public class Cons_messageMediaVideoStream { + public var flags: Int32 + public var call: Api.InputGroupCall + public init(flags: Int32, call: Api.InputGroupCall) { + self.flags = flags + self.call = call + } + } + public class Cons_messageMediaWebPage { + public var flags: Int32 + public var webpage: Api.WebPage + public init(flags: Int32, webpage: Api.WebPage) { + self.flags = flags + self.webpage = webpage + } + } + case messageMediaContact(Cons_messageMediaContact) + case messageMediaDice(Cons_messageMediaDice) + case messageMediaDocument(Cons_messageMediaDocument) case messageMediaEmpty - case messageMediaGame(game: Api.Game) - case messageMediaGeo(geo: Api.GeoPoint) - case messageMediaGeoLive(flags: Int32, geo: Api.GeoPoint, heading: Int32?, period: Int32, proximityNotificationRadius: Int32?) - case messageMediaGiveaway(flags: Int32, channels: [Int64], countriesIso2: [String]?, prizeDescription: String?, quantity: Int32, months: Int32?, stars: Int64?, untilDate: Int32) - case messageMediaGiveawayResults(flags: Int32, channelId: Int64, additionalPeersCount: Int32?, launchMsgId: Int32, winnersCount: Int32, unclaimedCount: Int32, winners: [Int64], months: Int32?, stars: Int64?, prizeDescription: String?, untilDate: Int32) - case messageMediaInvoice(flags: Int32, title: String, description: String, photo: Api.WebDocument?, receiptMsgId: Int32?, currency: String, totalAmount: Int64, startParam: String, extendedMedia: Api.MessageExtendedMedia?) - case messageMediaPaidMedia(starsAmount: Int64, extendedMedia: [Api.MessageExtendedMedia]) - case messageMediaPhoto(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?) - case messageMediaPoll(poll: Api.Poll, results: Api.PollResults) - case messageMediaStory(flags: Int32, peer: Api.Peer, id: Int32, story: Api.StoryItem?) - case messageMediaToDo(flags: Int32, todo: Api.TodoList, completions: [Api.TodoCompletion]?) + case messageMediaGame(Cons_messageMediaGame) + case messageMediaGeo(Cons_messageMediaGeo) + case messageMediaGeoLive(Cons_messageMediaGeoLive) + case messageMediaGiveaway(Cons_messageMediaGiveaway) + case messageMediaGiveawayResults(Cons_messageMediaGiveawayResults) + case messageMediaInvoice(Cons_messageMediaInvoice) + case messageMediaPaidMedia(Cons_messageMediaPaidMedia) + case messageMediaPhoto(Cons_messageMediaPhoto) + case messageMediaPoll(Cons_messageMediaPoll) + case messageMediaStory(Cons_messageMediaStory) + case messageMediaToDo(Cons_messageMediaToDo) case messageMediaUnsupported - case messageMediaVenue(geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String) - case messageMediaVideoStream(flags: Int32, call: Api.InputGroupCall) - case messageMediaWebPage(flags: Int32, webpage: Api.WebPage) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageMediaContact(let phoneNumber, let firstName, let lastName, let vcard, let userId): - if boxed { - buffer.appendInt32(1882335561) - } - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeString(vcard, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .messageMediaDice(let flags, let value, let emoticon, let gameOutcome): - if boxed { - buffer.appendInt32(147581959) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(value, buffer: buffer, boxed: false) - serializeString(emoticon, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {gameOutcome!.serialize(buffer, true)} - break - case .messageMediaDocument(let flags, let document, let altDocuments, let videoCover, let videoTimestamp, let ttlSeconds): - if boxed { - buffer.appendInt32(1389939929) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(altDocuments!.count)) - for item in altDocuments! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 9) != 0 {videoCover!.serialize(buffer, true)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(videoTimestamp!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .messageMediaEmpty: - if boxed { - buffer.appendInt32(1038967584) - } - - break - case .messageMediaGame(let game): - if boxed { - buffer.appendInt32(-38694904) - } - game.serialize(buffer, true) - break - case .messageMediaGeo(let geo): - if boxed { - buffer.appendInt32(1457575028) - } - geo.serialize(buffer, true) - break - case .messageMediaGeoLive(let flags, let geo, let heading, let period, let proximityNotificationRadius): - if boxed { - buffer.appendInt32(-1186937242) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(heading!, buffer: buffer, boxed: false)} - serializeInt32(period, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(proximityNotificationRadius!, buffer: buffer, boxed: false)} - break - case .messageMediaGiveaway(let flags, let channels, let countriesIso2, let prizeDescription, let quantity, let months, let stars, let untilDate): - if boxed { - buffer.appendInt32(-1442366485) - } - serializeInt32(flags, buffer: buffer, boxed: false) + case messageMediaVenue(Cons_messageMediaVenue) + case messageMediaVideoStream(Cons_messageMediaVideoStream) + case messageMediaWebPage(Cons_messageMediaWebPage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageMediaContact(let _data): + if boxed { + buffer.appendInt32(1882335561) + } + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + serializeString(_data.vcard, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .messageMediaDice(let _data): + if boxed { + buffer.appendInt32(147581959) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.value, buffer: buffer, boxed: false) + serializeString(_data.emoticon, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.gameOutcome!.serialize(buffer, true) + } + break + case .messageMediaDocument(let _data): + if boxed { + buffer.appendInt32(1389939929) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(channels.count)) - for item in channels { - serializeInt64(item, buffer: buffer, boxed: false) + buffer.appendInt32(Int32(_data.altDocuments!.count)) + for item in _data.altDocuments! { + item.serialize(buffer, true) } - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(countriesIso2!.count)) - for item in countriesIso2! { + } + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.videoCover!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.videoTimestamp!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .messageMediaEmpty: + if boxed { + buffer.appendInt32(1038967584) + } + break + case .messageMediaGame(let _data): + if boxed { + buffer.appendInt32(-38694904) + } + _data.game.serialize(buffer, true) + break + case .messageMediaGeo(let _data): + if boxed { + buffer.appendInt32(1457575028) + } + _data.geo.serialize(buffer, true) + break + case .messageMediaGeoLive(let _data): + if boxed { + buffer.appendInt32(-1186937242) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.heading!, buffer: buffer, boxed: false) + } + serializeInt32(_data.period, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.proximityNotificationRadius!, buffer: buffer, boxed: false) + } + break + case .messageMediaGiveaway(let _data): + if boxed { + buffer.appendInt32(-1442366485) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.channels.count)) + for item in _data.channels { + serializeInt64(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countriesIso2!.count)) + for item in _data.countriesIso2! { serializeString(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 3) != 0 {serializeString(prizeDescription!, buffer: buffer, boxed: false)} - serializeInt32(quantity, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(months!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt64(stars!, buffer: buffer, boxed: false)} - serializeInt32(untilDate, buffer: buffer, boxed: false) - break - case .messageMediaGiveawayResults(let flags, let channelId, let additionalPeersCount, let launchMsgId, let winnersCount, let unclaimedCount, let winners, let months, let stars, let prizeDescription, let untilDate): - if boxed { - buffer.appendInt32(-827703647) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(additionalPeersCount!, buffer: buffer, boxed: false)} - serializeInt32(launchMsgId, buffer: buffer, boxed: false) - serializeInt32(winnersCount, buffer: buffer, boxed: false) - serializeInt32(unclaimedCount, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.prizeDescription!, buffer: buffer, boxed: false) + } + serializeInt32(_data.quantity, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.months!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt64(_data.stars!, buffer: buffer, boxed: false) + } + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + break + case .messageMediaGiveawayResults(let _data): + if boxed { + buffer.appendInt32(-827703647) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.additionalPeersCount!, buffer: buffer, boxed: false) + } + serializeInt32(_data.launchMsgId, buffer: buffer, boxed: false) + serializeInt32(_data.winnersCount, buffer: buffer, boxed: false) + serializeInt32(_data.unclaimedCount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.winners.count)) + for item in _data.winners { + serializeInt64(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.months!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt64(_data.stars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.prizeDescription!, buffer: buffer, boxed: false) + } + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + break + case .messageMediaInvoice(let _data): + if boxed { + buffer.appendInt32(-156940077) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.receiptMsgId!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + serializeString(_data.startParam, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.extendedMedia!.serialize(buffer, true) + } + break + case .messageMediaPaidMedia(let _data): + if boxed { + buffer.appendInt32(-1467669359) + } + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.extendedMedia.count)) + for item in _data.extendedMedia { + item.serialize(buffer, true) + } + break + case .messageMediaPhoto(let _data): + if boxed { + buffer.appendInt32(1766936791) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.ttlSeconds!, buffer: buffer, boxed: false) + } + break + case .messageMediaPoll(let _data): + if boxed { + buffer.appendInt32(1272375192) + } + _data.poll.serialize(buffer, true) + _data.results.serialize(buffer, true) + break + case .messageMediaStory(let _data): + if boxed { + buffer.appendInt32(1758159491) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.story!.serialize(buffer, true) + } + break + case .messageMediaToDo(let _data): + if boxed { + buffer.appendInt32(-1974226924) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.todo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(winners.count)) - for item in winners { - serializeInt64(item, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(months!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt64(stars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(prizeDescription!, buffer: buffer, boxed: false)} - serializeInt32(untilDate, buffer: buffer, boxed: false) - break - case .messageMediaInvoice(let flags, let title, let description, let photo, let receiptMsgId, let currency, let totalAmount, let startParam, let extendedMedia): - if boxed { - buffer.appendInt32(-156940077) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(receiptMsgId!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - serializeString(startParam, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {extendedMedia!.serialize(buffer, true)} - break - case .messageMediaPaidMedia(let starsAmount, let extendedMedia): - if boxed { - buffer.appendInt32(-1467669359) - } - serializeInt64(starsAmount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(extendedMedia.count)) - for item in extendedMedia { + buffer.appendInt32(Int32(_data.completions!.count)) + for item in _data.completions! { item.serialize(buffer, true) } - break - case .messageMediaPhoto(let flags, let photo, let ttlSeconds): - if boxed { - buffer.appendInt32(1766936791) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(ttlSeconds!, buffer: buffer, boxed: false)} - break - case .messageMediaPoll(let poll, let results): - if boxed { - buffer.appendInt32(1272375192) - } - poll.serialize(buffer, true) - results.serialize(buffer, true) - break - case .messageMediaStory(let flags, let peer, let id, let story): - if boxed { - buffer.appendInt32(1758159491) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {story!.serialize(buffer, true)} - break - case .messageMediaToDo(let flags, let todo, let completions): - if boxed { - buffer.appendInt32(-1974226924) - } - serializeInt32(flags, buffer: buffer, boxed: false) - todo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(completions!.count)) - for item in completions! { - item.serialize(buffer, true) - }} - break - case .messageMediaUnsupported: - if boxed { - buffer.appendInt32(-1618676578) - } - - break - case .messageMediaVenue(let geo, let title, let address, let provider, let venueId, let venueType): - if boxed { - buffer.appendInt32(784356159) - } - geo.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(address, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - serializeString(venueId, buffer: buffer, boxed: false) - serializeString(venueType, buffer: buffer, boxed: false) - break - case .messageMediaVideoStream(let flags, let call): - if boxed { - buffer.appendInt32(-899896439) - } - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - break - case .messageMediaWebPage(let flags, let webpage): - if boxed { - buffer.appendInt32(-571405253) - } - serializeInt32(flags, buffer: buffer, boxed: false) - webpage.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageMediaContact(let phoneNumber, let firstName, let lastName, let vcard, let userId): - return ("messageMediaContact", [("phoneNumber", phoneNumber as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("vcard", vcard as Any), ("userId", userId as Any)]) - case .messageMediaDice(let flags, let value, let emoticon, let gameOutcome): - return ("messageMediaDice", [("flags", flags as Any), ("value", value as Any), ("emoticon", emoticon as Any), ("gameOutcome", gameOutcome as Any)]) - case .messageMediaDocument(let flags, let document, let altDocuments, let videoCover, let videoTimestamp, let ttlSeconds): - return ("messageMediaDocument", [("flags", flags as Any), ("document", document as Any), ("altDocuments", altDocuments as Any), ("videoCover", videoCover as Any), ("videoTimestamp", videoTimestamp as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .messageMediaEmpty: + } + break + case .messageMediaUnsupported: + if boxed { + buffer.appendInt32(-1618676578) + } + break + case .messageMediaVenue(let _data): + if boxed { + buffer.appendInt32(784356159) + } + _data.geo.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.address, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + serializeString(_data.venueId, buffer: buffer, boxed: false) + serializeString(_data.venueType, buffer: buffer, boxed: false) + break + case .messageMediaVideoStream(let _data): + if boxed { + buffer.appendInt32(-899896439) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.call.serialize(buffer, true) + break + case .messageMediaWebPage(let _data): + if boxed { + buffer.appendInt32(-571405253) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.webpage.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageMediaContact(let _data): + return ("messageMediaContact", [("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("userId", _data.userId as Any)]) + case .messageMediaDice(let _data): + return ("messageMediaDice", [("flags", _data.flags as Any), ("value", _data.value as Any), ("emoticon", _data.emoticon as Any), ("gameOutcome", _data.gameOutcome as Any)]) + case .messageMediaDocument(let _data): + return ("messageMediaDocument", [("flags", _data.flags as Any), ("document", _data.document as Any), ("altDocuments", _data.altDocuments as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .messageMediaEmpty: return ("messageMediaEmpty", []) - case .messageMediaGame(let game): - return ("messageMediaGame", [("game", game as Any)]) - case .messageMediaGeo(let geo): - return ("messageMediaGeo", [("geo", geo as Any)]) - case .messageMediaGeoLive(let flags, let geo, let heading, let period, let proximityNotificationRadius): - return ("messageMediaGeoLive", [("flags", flags as Any), ("geo", geo as Any), ("heading", heading as Any), ("period", period as Any), ("proximityNotificationRadius", proximityNotificationRadius as Any)]) - case .messageMediaGiveaway(let flags, let channels, let countriesIso2, let prizeDescription, let quantity, let months, let stars, let untilDate): - return ("messageMediaGiveaway", [("flags", flags as Any), ("channels", channels as Any), ("countriesIso2", countriesIso2 as Any), ("prizeDescription", prizeDescription as Any), ("quantity", quantity as Any), ("months", months as Any), ("stars", stars as Any), ("untilDate", untilDate as Any)]) - case .messageMediaGiveawayResults(let flags, let channelId, let additionalPeersCount, let launchMsgId, let winnersCount, let unclaimedCount, let winners, let months, let stars, let prizeDescription, let untilDate): - return ("messageMediaGiveawayResults", [("flags", flags as Any), ("channelId", channelId as Any), ("additionalPeersCount", additionalPeersCount as Any), ("launchMsgId", launchMsgId as Any), ("winnersCount", winnersCount as Any), ("unclaimedCount", unclaimedCount as Any), ("winners", winners as Any), ("months", months as Any), ("stars", stars as Any), ("prizeDescription", prizeDescription as Any), ("untilDate", untilDate as Any)]) - case .messageMediaInvoice(let flags, let title, let description, let photo, let receiptMsgId, let currency, let totalAmount, let startParam, let extendedMedia): - return ("messageMediaInvoice", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("receiptMsgId", receiptMsgId as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("startParam", startParam as Any), ("extendedMedia", extendedMedia as Any)]) - case .messageMediaPaidMedia(let starsAmount, let extendedMedia): - return ("messageMediaPaidMedia", [("starsAmount", starsAmount as Any), ("extendedMedia", extendedMedia as Any)]) - case .messageMediaPhoto(let flags, let photo, let ttlSeconds): - return ("messageMediaPhoto", [("flags", flags as Any), ("photo", photo as Any), ("ttlSeconds", ttlSeconds as Any)]) - case .messageMediaPoll(let poll, let results): - return ("messageMediaPoll", [("poll", poll as Any), ("results", results as Any)]) - case .messageMediaStory(let flags, let peer, let id, let story): - return ("messageMediaStory", [("flags", flags as Any), ("peer", peer as Any), ("id", id as Any), ("story", story as Any)]) - case .messageMediaToDo(let flags, let todo, let completions): - return ("messageMediaToDo", [("flags", flags as Any), ("todo", todo as Any), ("completions", completions as Any)]) - case .messageMediaUnsupported: + case .messageMediaGame(let _data): + return ("messageMediaGame", [("game", _data.game as Any)]) + case .messageMediaGeo(let _data): + return ("messageMediaGeo", [("geo", _data.geo as Any)]) + case .messageMediaGeoLive(let _data): + return ("messageMediaGeoLive", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any)]) + case .messageMediaGiveaway(let _data): + return ("messageMediaGiveaway", [("flags", _data.flags as Any), ("channels", _data.channels as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("quantity", _data.quantity as Any), ("months", _data.months as Any), ("stars", _data.stars as Any), ("untilDate", _data.untilDate as Any)]) + case .messageMediaGiveawayResults(let _data): + return ("messageMediaGiveawayResults", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("additionalPeersCount", _data.additionalPeersCount as Any), ("launchMsgId", _data.launchMsgId as Any), ("winnersCount", _data.winnersCount as Any), ("unclaimedCount", _data.unclaimedCount as Any), ("winners", _data.winners as Any), ("months", _data.months as Any), ("stars", _data.stars as Any), ("prizeDescription", _data.prizeDescription as Any), ("untilDate", _data.untilDate as Any)]) + case .messageMediaInvoice(let _data): + return ("messageMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("receiptMsgId", _data.receiptMsgId as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("startParam", _data.startParam as Any), ("extendedMedia", _data.extendedMedia as Any)]) + case .messageMediaPaidMedia(let _data): + return ("messageMediaPaidMedia", [("starsAmount", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any)]) + case .messageMediaPhoto(let _data): + return ("messageMediaPhoto", [("flags", _data.flags as Any), ("photo", _data.photo as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + case .messageMediaPoll(let _data): + return ("messageMediaPoll", [("poll", _data.poll as Any), ("results", _data.results as Any)]) + case .messageMediaStory(let _data): + return ("messageMediaStory", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("id", _data.id as Any), ("story", _data.story as Any)]) + case .messageMediaToDo(let _data): + return ("messageMediaToDo", [("flags", _data.flags as Any), ("todo", _data.todo as Any), ("completions", _data.completions as Any)]) + case .messageMediaUnsupported: return ("messageMediaUnsupported", []) - case .messageMediaVenue(let geo, let title, let address, let provider, let venueId, let venueType): - return ("messageMediaVenue", [("geo", geo as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any)]) - case .messageMediaVideoStream(let flags, let call): - return ("messageMediaVideoStream", [("flags", flags as Any), ("call", call as Any)]) - case .messageMediaWebPage(let flags, let webpage): - return ("messageMediaWebPage", [("flags", flags as Any), ("webpage", webpage as Any)]) - } - } - + case .messageMediaVenue(let _data): + return ("messageMediaVenue", [("geo", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + case .messageMediaVideoStream(let _data): + return ("messageMediaVideoStream", [("flags", _data.flags as Any), ("call", _data.call as Any)]) + case .messageMediaWebPage(let _data): + return ("messageMediaWebPage", [("flags", _data.flags as Any), ("webpage", _data.webpage as Any)]) + } + } + public static func parse_messageMediaContact(_ reader: BufferReader) -> MessageMedia? { var _1: String? _1 = parseString(reader) @@ -988,7 +1529,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageMedia.messageMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!, userId: _5!) + return Api.MessageMedia.messageMediaContact(Cons_messageMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!, userId: _5!)) } else { return nil @@ -1002,15 +1543,17 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.messages.EmojiGameOutcome? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameOutcome - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameOutcome + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaDice(flags: _1!, value: _2!, emoticon: _3!, gameOutcome: _4) + return Api.MessageMedia.messageMediaDice(Cons_messageMediaDice(flags: _1!, value: _2!, emoticon: _3!, gameOutcome: _4)) } else { return nil @@ -1020,21 +1563,31 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _3: [Api.Document]? - if Int(_1!) & Int(1 << 5) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + } var _4: Api.Photo? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _5: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 5) == 0) || _3 != nil @@ -1042,7 +1595,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 10) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageMedia.messageMediaDocument(flags: _1!, document: _2, altDocuments: _3, videoCover: _4, videoTimestamp: _5, ttlSeconds: _6) + return Api.MessageMedia.messageMediaDocument(Cons_messageMediaDocument(flags: _1!, document: _2, altDocuments: _3, videoCover: _4, videoTimestamp: _5, ttlSeconds: _6)) } else { return nil @@ -1058,7 +1611,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageMedia.messageMediaGame(game: _1!) + return Api.MessageMedia.messageMediaGame(Cons_messageMediaGame(game: _1!)) } else { return nil @@ -1071,7 +1624,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.MessageMedia.messageMediaGeo(geo: _1!) + return Api.MessageMedia.messageMediaGeo(Cons_messageMediaGeo(geo: _1!)) } else { return nil @@ -1085,18 +1638,22 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageMedia.messageMediaGeoLive(flags: _1!, geo: _2!, heading: _3, period: _4!, proximityNotificationRadius: _5) + return Api.MessageMedia.messageMediaGeoLive(Cons_messageMediaGeoLive(flags: _1!, geo: _2!, heading: _3, period: _4!, proximityNotificationRadius: _5)) } else { return nil @@ -1110,17 +1667,25 @@ public extension Api { _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) } var _3: [String]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } var _4: String? - if Int(_1!) & Int(1 << 3) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _4 = parseString(reader) + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = reader.readInt32() + } var _7: Int64? - if Int(_1!) & Int(1 << 5) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 5) != 0 { + _7 = reader.readInt64() + } var _8: Int32? _8 = reader.readInt32() let _c1 = _1 != nil @@ -1132,7 +1697,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 5) == 0) || _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.MessageMedia.messageMediaGiveaway(flags: _1!, channels: _2!, countriesIso2: _3, prizeDescription: _4, quantity: _5!, months: _6, stars: _7, untilDate: _8!) + return Api.MessageMedia.messageMediaGiveaway(Cons_messageMediaGiveaway(flags: _1!, channels: _2!, countriesIso2: _3, prizeDescription: _4, quantity: _5!, months: _6, stars: _7, untilDate: _8!)) } else { return nil @@ -1144,7 +1709,9 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } var _4: Int32? _4 = reader.readInt32() var _5: Int32? @@ -1156,11 +1723,17 @@ public extension Api { _7 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) } var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } var _9: Int64? - if Int(_1!) & Int(1 << 5) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 5) != 0 { + _9 = reader.readInt64() + } var _10: String? - if Int(_1!) & Int(1 << 1) != 0 {_10 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _10 = parseString(reader) + } var _11: Int32? _11 = reader.readInt32() let _c1 = _1 != nil @@ -1175,7 +1748,7 @@ public extension Api { let _c10 = (Int(_1!) & Int(1 << 1) == 0) || _10 != nil let _c11 = _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.MessageMedia.messageMediaGiveawayResults(flags: _1!, channelId: _2!, additionalPeersCount: _3, launchMsgId: _4!, winnersCount: _5!, unclaimedCount: _6!, winners: _7!, months: _8, stars: _9, prizeDescription: _10, untilDate: _11!) + return Api.MessageMedia.messageMediaGiveawayResults(Cons_messageMediaGiveawayResults(flags: _1!, channelId: _2!, additionalPeersCount: _3, launchMsgId: _4!, winnersCount: _5!, unclaimedCount: _6!, winners: _7!, months: _8, stars: _9, prizeDescription: _10, untilDate: _11!)) } else { return nil @@ -1189,11 +1762,15 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.WebDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } var _6: String? _6 = parseString(reader) var _7: Int64? @@ -1201,9 +1778,11 @@ public extension Api { var _8: String? _8 = parseString(reader) var _9: Api.MessageExtendedMedia? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageExtendedMedia - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.MessageExtendedMedia + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1214,7 +1793,7 @@ public extension Api { let _c8 = _8 != nil let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.MessageMedia.messageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, receiptMsgId: _5, currency: _6!, totalAmount: _7!, startParam: _8!, extendedMedia: _9) + return Api.MessageMedia.messageMediaInvoice(Cons_messageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, receiptMsgId: _5, currency: _6!, totalAmount: _7!, startParam: _8!, extendedMedia: _9)) } else { return nil @@ -1230,7 +1809,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageMedia.messageMediaPaidMedia(starsAmount: _1!, extendedMedia: _2!) + return Api.MessageMedia.messageMediaPaidMedia(Cons_messageMediaPaidMedia(starsAmount: _1!, extendedMedia: _2!)) } else { return nil @@ -1240,16 +1819,20 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Photo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _3: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageMedia.messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3) + return Api.MessageMedia.messageMediaPhoto(Cons_messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3)) } else { return nil @@ -1267,7 +1850,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageMedia.messageMediaPoll(poll: _1!, results: _2!) + return Api.MessageMedia.messageMediaPoll(Cons_messageMediaPoll(poll: _1!, results: _2!)) } else { return nil @@ -1283,15 +1866,17 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.StoryItem? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StoryItem - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StoryItem + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaStory(flags: _1!, peer: _2!, id: _3!, story: _4) + return Api.MessageMedia.messageMediaStory(Cons_messageMediaStory(flags: _1!, peer: _2!, id: _3!, story: _4)) } else { return nil @@ -1305,14 +1890,16 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.TodoList } var _3: [Api.TodoCompletion]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoCompletion.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoCompletion.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageMedia.messageMediaToDo(flags: _1!, todo: _2!, completions: _3) + return Api.MessageMedia.messageMediaToDo(Cons_messageMediaToDo(flags: _1!, todo: _2!, completions: _3)) } else { return nil @@ -1343,7 +1930,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageMedia.messageMediaVenue(geo: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!) + return Api.MessageMedia.messageMediaVenue(Cons_messageMediaVenue(geo: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!)) } else { return nil @@ -1359,7 +1946,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageMedia.messageMediaVideoStream(flags: _1!, call: _2!) + return Api.MessageMedia.messageMediaVideoStream(Cons_messageMediaVideoStream(flags: _1!, call: _2!)) } else { return nil @@ -1375,12 +1962,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageMedia.messageMediaWebPage(flags: _1!, webpage: _2!) + return Api.MessageMedia.messageMediaWebPage(Cons_messageMediaWebPage(flags: _1!, webpage: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api17.swift b/submodules/TelegramApi/Sources/Api17.swift index abefb9f76c..ce9899e348 100644 --- a/submodules/TelegramApi/Sources/Api17.swift +++ b/submodules/TelegramApi/Sources/Api17.swift @@ -1,28 +1,40 @@ public extension Api { enum MessagePeerReaction: TypeConstructorDescription { - case messagePeerReaction(flags: Int32, peerId: Api.Peer, date: Int32, reaction: Api.Reaction) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messagePeerReaction(let flags, let peerId, let date, let reaction): - if boxed { - buffer.appendInt32(-1938180548) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peerId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messagePeerReaction(let flags, let peerId, let date, let reaction): - return ("messagePeerReaction", [("flags", flags as Any), ("peerId", peerId as Any), ("date", date as Any), ("reaction", reaction as Any)]) - } - } - + public class Cons_messagePeerReaction { + public var flags: Int32 + public var peerId: Api.Peer + public var date: Int32 + public var reaction: Api.Reaction + public init(flags: Int32, peerId: Api.Peer, date: Int32, reaction: Api.Reaction) { + self.flags = flags + self.peerId = peerId + self.date = date + self.reaction = reaction + } + } + case messagePeerReaction(Cons_messagePeerReaction) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messagePeerReaction(let _data): + if boxed { + buffer.appendInt32(-1938180548) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peerId.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.reaction.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messagePeerReaction(let _data): + return ("messagePeerReaction", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + } + } + public static func parse_messagePeerReaction(_ reader: BufferReader) -> MessagePeerReaction? { var _1: Int32? _1 = reader.readInt32() @@ -41,64 +53,91 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessagePeerReaction.messagePeerReaction(flags: _1!, peerId: _2!, date: _3!, reaction: _4!) + return Api.MessagePeerReaction.messagePeerReaction(Cons_messagePeerReaction(flags: _1!, peerId: _2!, date: _3!, reaction: _4!)) } else { return nil } } - } } public extension Api { enum MessagePeerVote: TypeConstructorDescription { - case messagePeerVote(peer: Api.Peer, option: Buffer, date: Int32) - case messagePeerVoteInputOption(peer: Api.Peer, date: Int32) - case messagePeerVoteMultiple(peer: Api.Peer, options: [Buffer], date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messagePeerVote(let peer, let option, let date): - if boxed { - buffer.appendInt32(-1228133028) - } - peer.serialize(buffer, true) - serializeBytes(option, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .messagePeerVoteInputOption(let peer, let date): - if boxed { - buffer.appendInt32(1959634180) - } - peer.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .messagePeerVoteMultiple(let peer, let options, let date): - if boxed { - buffer.appendInt32(1177089766) - } - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(options.count)) - for item in options { - serializeBytes(item, buffer: buffer, boxed: false) - } - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messagePeerVote(let peer, let option, let date): - return ("messagePeerVote", [("peer", peer as Any), ("option", option as Any), ("date", date as Any)]) - case .messagePeerVoteInputOption(let peer, let date): - return ("messagePeerVoteInputOption", [("peer", peer as Any), ("date", date as Any)]) - case .messagePeerVoteMultiple(let peer, let options, let date): - return ("messagePeerVoteMultiple", [("peer", peer as Any), ("options", options as Any), ("date", date as Any)]) - } - } - + public class Cons_messagePeerVote { + public var peer: Api.Peer + public var option: Buffer + public var date: Int32 + public init(peer: Api.Peer, option: Buffer, date: Int32) { + self.peer = peer + self.option = option + self.date = date + } + } + public class Cons_messagePeerVoteInputOption { + public var peer: Api.Peer + public var date: Int32 + public init(peer: Api.Peer, date: Int32) { + self.peer = peer + self.date = date + } + } + public class Cons_messagePeerVoteMultiple { + public var peer: Api.Peer + public var options: [Buffer] + public var date: Int32 + public init(peer: Api.Peer, options: [Buffer], date: Int32) { + self.peer = peer + self.options = options + self.date = date + } + } + case messagePeerVote(Cons_messagePeerVote) + case messagePeerVoteInputOption(Cons_messagePeerVoteInputOption) + case messagePeerVoteMultiple(Cons_messagePeerVoteMultiple) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messagePeerVote(let _data): + if boxed { + buffer.appendInt32(-1228133028) + } + _data.peer.serialize(buffer, true) + serializeBytes(_data.option, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .messagePeerVoteInputOption(let _data): + if boxed { + buffer.appendInt32(1959634180) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .messagePeerVoteMultiple(let _data): + if boxed { + buffer.appendInt32(1177089766) + } + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.options.count)) + for item in _data.options { + serializeBytes(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messagePeerVote(let _data): + return ("messagePeerVote", [("peer", _data.peer as Any), ("option", _data.option as Any), ("date", _data.date as Any)]) + case .messagePeerVoteInputOption(let _data): + return ("messagePeerVoteInputOption", [("peer", _data.peer as Any), ("date", _data.date as Any)]) + case .messagePeerVoteMultiple(let _data): + return ("messagePeerVoteMultiple", [("peer", _data.peer as Any), ("options", _data.options as Any), ("date", _data.date as Any)]) + } + } + public static func parse_messagePeerVote(_ reader: BufferReader) -> MessagePeerVote? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -112,7 +151,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessagePeerVote.messagePeerVote(peer: _1!, option: _2!, date: _3!) + return Api.MessagePeerVote.messagePeerVote(Cons_messagePeerVote(peer: _1!, option: _2!, date: _3!)) } else { return nil @@ -128,7 +167,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessagePeerVote.messagePeerVoteInputOption(peer: _1!, date: _2!) + return Api.MessagePeerVote.messagePeerVoteInputOption(Cons_messagePeerVoteInputOption(peer: _1!, date: _2!)) } else { return nil @@ -149,38 +188,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessagePeerVote.messagePeerVoteMultiple(peer: _1!, options: _2!, date: _3!) + return Api.MessagePeerVote.messagePeerVoteMultiple(Cons_messagePeerVoteMultiple(peer: _1!, options: _2!, date: _3!)) } else { return nil } } - } } public extension Api { enum MessageRange: TypeConstructorDescription { - case messageRange(minId: Int32, maxId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageRange(let minId, let maxId): - if boxed { - buffer.appendInt32(182649427) - } - serializeInt32(minId, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageRange(let minId, let maxId): - return ("messageRange", [("minId", minId as Any), ("maxId", maxId as Any)]) - } - } - + public class Cons_messageRange { + public var minId: Int32 + public var maxId: Int32 + public init(minId: Int32, maxId: Int32) { + self.minId = minId + self.maxId = maxId + } + } + case messageRange(Cons_messageRange) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageRange(let _data): + if boxed { + buffer.appendInt32(182649427) + } + serializeInt32(_data.minId, buffer: buffer, boxed: false) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageRange(let _data): + return ("messageRange", [("minId", _data.minId as Any), ("maxId", _data.maxId as Any)]) + } + } + public static func parse_messageRange(_ reader: BufferReader) -> MessageRange? { var _1: Int32? _1 = reader.readInt32() @@ -189,52 +235,67 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageRange.messageRange(minId: _1!, maxId: _2!) + return Api.MessageRange.messageRange(Cons_messageRange(minId: _1!, maxId: _2!)) } else { return nil } } - } } public extension Api { enum MessageReactions: TypeConstructorDescription { - case messageReactions(flags: Int32, results: [Api.ReactionCount], recentReactions: [Api.MessagePeerReaction]?, topReactors: [Api.MessageReactor]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReactions(let flags, let results, let recentReactions, let topReactors): - if boxed { - buffer.appendInt32(171155211) - } - serializeInt32(flags, buffer: buffer, boxed: false) + public class Cons_messageReactions { + public var flags: Int32 + public var results: [Api.ReactionCount] + public var recentReactions: [Api.MessagePeerReaction]? + public var topReactors: [Api.MessageReactor]? + public init(flags: Int32, results: [Api.ReactionCount], recentReactions: [Api.MessagePeerReaction]?, topReactors: [Api.MessageReactor]?) { + self.flags = flags + self.results = results + self.recentReactions = recentReactions + self.topReactors = topReactors + } + } + case messageReactions(Cons_messageReactions) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReactions(let _data): + if boxed { + buffer.appendInt32(171155211) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.results.count)) + for item in _data.results { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(results.count)) - for item in results { + buffer.appendInt32(Int32(_data.recentReactions!.count)) + for item in _data.recentReactions! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentReactions!.count)) - for item in recentReactions! { + } + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topReactors!.count)) + for item in _data.topReactors! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topReactors!.count)) - for item in topReactors! { - item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReactions(let flags, let results, let recentReactions, let topReactors): - return ("messageReactions", [("flags", flags as Any), ("results", results as Any), ("recentReactions", recentReactions as Any), ("topReactors", topReactors as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReactions(let _data): + return ("messageReactions", [("flags", _data.flags as Any), ("results", _data.results as Any), ("recentReactions", _data.recentReactions as Any), ("topReactors", _data.topReactors as Any)]) + } + } + public static func parse_messageReactions(_ reader: BufferReader) -> MessageReactions? { var _1: Int32? _1 = reader.readInt32() @@ -243,105 +304,147 @@ public extension Api { _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) } var _3: [Api.MessagePeerReaction]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerReaction.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerReaction.self) + } + } var _4: [Api.MessageReactor]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageReactor.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageReactor.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 4) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageReactions.messageReactions(flags: _1!, results: _2!, recentReactions: _3, topReactors: _4) + return Api.MessageReactions.messageReactions(Cons_messageReactions(flags: _1!, results: _2!, recentReactions: _3, topReactors: _4)) } else { return nil } } - } } public extension Api { enum MessageReactor: TypeConstructorDescription { - case messageReactor(flags: Int32, peerId: Api.Peer?, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReactor(let flags, let peerId, let count): - if boxed { - buffer.appendInt32(1269016922) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {peerId!.serialize(buffer, true)} - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReactor(let flags, let peerId, let count): - return ("messageReactor", [("flags", flags as Any), ("peerId", peerId as Any), ("count", count as Any)]) - } - } - + public class Cons_messageReactor { + public var flags: Int32 + public var peerId: Api.Peer? + public var count: Int32 + public init(flags: Int32, peerId: Api.Peer?, count: Int32) { + self.flags = flags + self.peerId = peerId + self.count = count + } + } + case messageReactor(Cons_messageReactor) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReactor(let _data): + if boxed { + buffer.appendInt32(1269016922) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.peerId!.serialize(buffer, true) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReactor(let _data): + return ("messageReactor", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("count", _data.count as Any)]) + } + } + public static func parse_messageReactor(_ reader: BufferReader) -> MessageReactor? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Int32? _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.MessageReactor.messageReactor(flags: _1!, peerId: _2, count: _3!) + return Api.MessageReactor.messageReactor(Cons_messageReactor(flags: _1!, peerId: _2, count: _3!)) } else { return nil } } - } } public extension Api { enum MessageReplies: TypeConstructorDescription { - case messageReplies(flags: Int32, replies: Int32, repliesPts: Int32, recentRepliers: [Api.Peer]?, channelId: Int64?, maxId: Int32?, readMaxId: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReplies(let flags, let replies, let repliesPts, let recentRepliers, let channelId, let maxId, let readMaxId): - if boxed { - buffer.appendInt32(-2083123262) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(replies, buffer: buffer, boxed: false) - serializeInt32(repliesPts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentRepliers!.count)) - for item in recentRepliers! { + public class Cons_messageReplies { + public var flags: Int32 + public var replies: Int32 + public var repliesPts: Int32 + public var recentRepliers: [Api.Peer]? + public var channelId: Int64? + public var maxId: Int32? + public var readMaxId: Int32? + public init(flags: Int32, replies: Int32, repliesPts: Int32, recentRepliers: [Api.Peer]?, channelId: Int64?, maxId: Int32?, readMaxId: Int32?) { + self.flags = flags + self.replies = replies + self.repliesPts = repliesPts + self.recentRepliers = recentRepliers + self.channelId = channelId + self.maxId = maxId + self.readMaxId = readMaxId + } + } + case messageReplies(Cons_messageReplies) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReplies(let _data): + if boxed { + buffer.appendInt32(-2083123262) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.replies, buffer: buffer, boxed: false) + serializeInt32(_data.repliesPts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentRepliers!.count)) + for item in _data.recentRepliers! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(channelId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(maxId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(readMaxId!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReplies(let flags, let replies, let repliesPts, let recentRepliers, let channelId, let maxId, let readMaxId): - return ("messageReplies", [("flags", flags as Any), ("replies", replies as Any), ("repliesPts", repliesPts as Any), ("recentRepliers", recentRepliers as Any), ("channelId", channelId as Any), ("maxId", maxId as Any), ("readMaxId", readMaxId as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.channelId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.maxId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.readMaxId!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReplies(let _data): + return ("messageReplies", [("flags", _data.flags as Any), ("replies", _data.replies as Any), ("repliesPts", _data.repliesPts as Any), ("recentRepliers", _data.recentRepliers as Any), ("channelId", _data.channelId as Any), ("maxId", _data.maxId as Any), ("readMaxId", _data.readMaxId as Any)]) + } + } + public static func parse_messageReplies(_ reader: BufferReader) -> MessageReplies? { var _1: Int32? _1 = reader.readInt32() @@ -350,15 +453,23 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: [Api.Peer]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + } var _5: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } var _6: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = reader.readInt32() + } var _7: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -367,89 +478,156 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MessageReplies.messageReplies(flags: _1!, replies: _2!, repliesPts: _3!, recentRepliers: _4, channelId: _5, maxId: _6, readMaxId: _7) + return Api.MessageReplies.messageReplies(Cons_messageReplies(flags: _1!, replies: _2!, repliesPts: _3!, recentRepliers: _4, channelId: _5, maxId: _6, readMaxId: _7)) } else { return nil } } - } } public extension Api { indirect enum MessageReplyHeader: TypeConstructorDescription { - case messageReplyHeader(flags: Int32, replyToMsgId: Int32?, replyToPeerId: Api.Peer?, replyFrom: Api.MessageFwdHeader?, replyMedia: Api.MessageMedia?, replyToTopId: Int32?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, todoItemId: Int32?) - case messageReplyStoryHeader(peer: Api.Peer, storyId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReplyHeader(let flags, let replyToMsgId, let replyToPeerId, let replyFrom, let replyMedia, let replyToTopId, let quoteText, let quoteEntities, let quoteOffset, let todoItemId): - if boxed { - buffer.appendInt32(1763137035) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(replyToMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {replyToPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {replyFrom!.serialize(buffer, true)} - if Int(flags) & Int(1 << 8) != 0 {replyMedia!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(replyToTopId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeString(quoteText!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(quoteEntities!.count)) - for item in quoteEntities! { + public class Cons_messageReplyHeader { + public var flags: Int32 + public var replyToMsgId: Int32? + public var replyToPeerId: Api.Peer? + public var replyFrom: Api.MessageFwdHeader? + public var replyMedia: Api.MessageMedia? + public var replyToTopId: Int32? + public var quoteText: String? + public var quoteEntities: [Api.MessageEntity]? + public var quoteOffset: Int32? + public var todoItemId: Int32? + public init(flags: Int32, replyToMsgId: Int32?, replyToPeerId: Api.Peer?, replyFrom: Api.MessageFwdHeader?, replyMedia: Api.MessageMedia?, replyToTopId: Int32?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?, todoItemId: Int32?) { + self.flags = flags + self.replyToMsgId = replyToMsgId + self.replyToPeerId = replyToPeerId + self.replyFrom = replyFrom + self.replyMedia = replyMedia + self.replyToTopId = replyToTopId + self.quoteText = quoteText + self.quoteEntities = quoteEntities + self.quoteOffset = quoteOffset + self.todoItemId = todoItemId + } + } + public class Cons_messageReplyStoryHeader { + public var peer: Api.Peer + public var storyId: Int32 + public init(peer: Api.Peer, storyId: Int32) { + self.peer = peer + self.storyId = storyId + } + } + case messageReplyHeader(Cons_messageReplyHeader) + case messageReplyStoryHeader(Cons_messageReplyStoryHeader) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReplyHeader(let _data): + if boxed { + buffer.appendInt32(1763137035) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.replyToMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.replyToPeerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.replyFrom!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.replyMedia!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.replyToTopId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.quoteText!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.quoteEntities!.count)) + for item in _data.quoteEntities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(quoteOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(todoItemId!, buffer: buffer, boxed: false)} - break - case .messageReplyStoryHeader(let peer, let storyId): - if boxed { - buffer.appendInt32(240843065) } - peer.serialize(buffer, true) - serializeInt32(storyId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReplyHeader(let flags, let replyToMsgId, let replyToPeerId, let replyFrom, let replyMedia, let replyToTopId, let quoteText, let quoteEntities, let quoteOffset, let todoItemId): - return ("messageReplyHeader", [("flags", flags as Any), ("replyToMsgId", replyToMsgId as Any), ("replyToPeerId", replyToPeerId as Any), ("replyFrom", replyFrom as Any), ("replyMedia", replyMedia as Any), ("replyToTopId", replyToTopId as Any), ("quoteText", quoteText as Any), ("quoteEntities", quoteEntities as Any), ("quoteOffset", quoteOffset as Any), ("todoItemId", todoItemId as Any)]) - case .messageReplyStoryHeader(let peer, let storyId): - return ("messageReplyStoryHeader", [("peer", peer as Any), ("storyId", storyId as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.quoteOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.todoItemId!, buffer: buffer, boxed: false) + } + break + case .messageReplyStoryHeader(let _data): + if boxed { + buffer.appendInt32(240843065) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.storyId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReplyHeader(let _data): + return ("messageReplyHeader", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("replyFrom", _data.replyFrom as Any), ("replyMedia", _data.replyMedia as Any), ("replyToTopId", _data.replyToTopId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("todoItemId", _data.todoItemId as Any)]) + case .messageReplyStoryHeader(let _data): + return ("messageReplyStoryHeader", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any)]) + } + } + public static func parse_messageReplyHeader(_ reader: BufferReader) -> MessageReplyHeader? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _2 = reader.readInt32() + } var _3: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _4: Api.MessageFwdHeader? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + } + } var _5: Api.MessageMedia? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } var _7: String? - if Int(_1!) & Int(1 << 6) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _7 = parseString(reader) + } var _8: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 7) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _9: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _9 = reader.readInt32() + } var _10: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _10 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -461,7 +639,7 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 10) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 11) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.MessageReplyHeader.messageReplyHeader(flags: _1!, replyToMsgId: _2, replyToPeerId: _3, replyFrom: _4, replyMedia: _5, replyToTopId: _6, quoteText: _7, quoteEntities: _8, quoteOffset: _9, todoItemId: _10) + return Api.MessageReplyHeader.messageReplyHeader(Cons_messageReplyHeader(flags: _1!, replyToMsgId: _2, replyToPeerId: _3, replyFrom: _4, replyMedia: _5, replyToTopId: _6, quoteText: _7, quoteEntities: _8, quoteOffset: _9, todoItemId: _10)) } else { return nil @@ -477,38 +655,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageReplyHeader.messageReplyStoryHeader(peer: _1!, storyId: _2!) + return Api.MessageReplyHeader.messageReplyStoryHeader(Cons_messageReplyStoryHeader(peer: _1!, storyId: _2!)) } else { return nil } } - } } public extension Api { enum MessageReportOption: TypeConstructorDescription { - case messageReportOption(text: String, option: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReportOption(let text, let option): - if boxed { - buffer.appendInt32(2030298073) - } - serializeString(text, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReportOption(let text, let option): - return ("messageReportOption", [("text", text as Any), ("option", option as Any)]) - } - } - + public class Cons_messageReportOption { + public var text: String + public var option: Buffer + public init(text: String, option: Buffer) { + self.text = text + self.option = option + } + } + case messageReportOption(Cons_messageReportOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReportOption(let _data): + if boxed { + buffer.appendInt32(2030298073) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeBytes(_data.option, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReportOption(let _data): + return ("messageReportOption", [("text", _data.text as Any), ("option", _data.option as Any)]) + } + } + public static func parse_messageReportOption(_ reader: BufferReader) -> MessageReportOption? { var _1: String? _1 = parseString(reader) @@ -517,67 +702,95 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageReportOption.messageReportOption(text: _1!, option: _2!) + return Api.MessageReportOption.messageReportOption(Cons_messageReportOption(text: _1!, option: _2!)) } else { return nil } } - } } public extension Api { enum MessageViews: TypeConstructorDescription { - case messageViews(flags: Int32, views: Int32?, forwards: Int32?, replies: Api.MessageReplies?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageViews(let flags, let views, let forwards, let replies): - if boxed { - buffer.appendInt32(1163625789) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(views!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(forwards!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {replies!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageViews(let flags, let views, let forwards, let replies): - return ("messageViews", [("flags", flags as Any), ("views", views as Any), ("forwards", forwards as Any), ("replies", replies as Any)]) - } - } - + public class Cons_messageViews { + public var flags: Int32 + public var views: Int32? + public var forwards: Int32? + public var replies: Api.MessageReplies? + public init(flags: Int32, views: Int32?, forwards: Int32?, replies: Api.MessageReplies?) { + self.flags = flags + self.views = views + self.forwards = forwards + self.replies = replies + } + } + case messageViews(Cons_messageViews) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageViews(let _data): + if boxed { + buffer.appendInt32(1163625789) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.views!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.forwards!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replies!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageViews(let _data): + return ("messageViews", [("flags", _data.flags as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("replies", _data.replies as Any)]) + } + } + public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: Api.MessageReplies? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MessageReplies - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MessageReplies + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageViews.messageViews(flags: _1!, views: _2, forwards: _3, replies: _4) + return Api.MessageViews.messageViews(Cons_messageViews(flags: _1!, views: _2, forwards: _3, replies: _4)) } else { return nil } } - } } public extension Api { enum MessagesFilter: TypeConstructorDescription { + public class Cons_inputMessagesFilterPhoneCalls { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } case inputMessagesFilterChatPhotos case inputMessagesFilterContacts case inputMessagesFilterDocument @@ -586,7 +799,7 @@ public extension Api { case inputMessagesFilterGif case inputMessagesFilterMusic case inputMessagesFilterMyMentions - case inputMessagesFilterPhoneCalls(flags: Int32) + case inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls) case inputMessagesFilterPhotoVideo case inputMessagesFilterPhotos case inputMessagesFilterPinned @@ -595,153 +808,137 @@ public extension Api { case inputMessagesFilterUrl case inputMessagesFilterVideo case inputMessagesFilterVoice - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputMessagesFilterChatPhotos: - if boxed { - buffer.appendInt32(975236280) - } - - break - case .inputMessagesFilterContacts: - if boxed { - buffer.appendInt32(-530392189) - } - - break - case .inputMessagesFilterDocument: - if boxed { - buffer.appendInt32(-1629621880) - } - - break - case .inputMessagesFilterEmpty: - if boxed { - buffer.appendInt32(1474492012) - } - - break - case .inputMessagesFilterGeo: - if boxed { - buffer.appendInt32(-419271411) - } - - break - case .inputMessagesFilterGif: - if boxed { - buffer.appendInt32(-3644025) - } - - break - case .inputMessagesFilterMusic: - if boxed { - buffer.appendInt32(928101534) - } - - break - case .inputMessagesFilterMyMentions: - if boxed { - buffer.appendInt32(-1040652646) - } - - break - case .inputMessagesFilterPhoneCalls(let flags): - if boxed { - buffer.appendInt32(-2134272152) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .inputMessagesFilterPhotoVideo: - if boxed { - buffer.appendInt32(1458172132) - } - - break - case .inputMessagesFilterPhotos: - if boxed { - buffer.appendInt32(-1777752804) - } - - break - case .inputMessagesFilterPinned: - if boxed { - buffer.appendInt32(464520273) - } - - break - case .inputMessagesFilterRoundVideo: - if boxed { - buffer.appendInt32(-1253451181) - } - - break - case .inputMessagesFilterRoundVoice: - if boxed { - buffer.appendInt32(2054952868) - } - - break - case .inputMessagesFilterUrl: - if boxed { - buffer.appendInt32(2129714567) - } - - break - case .inputMessagesFilterVideo: - if boxed { - buffer.appendInt32(-1614803355) - } - - break - case .inputMessagesFilterVoice: - if boxed { - buffer.appendInt32(1358283666) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputMessagesFilterChatPhotos: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputMessagesFilterChatPhotos: + if boxed { + buffer.appendInt32(975236280) + } + break + case .inputMessagesFilterContacts: + if boxed { + buffer.appendInt32(-530392189) + } + break + case .inputMessagesFilterDocument: + if boxed { + buffer.appendInt32(-1629621880) + } + break + case .inputMessagesFilterEmpty: + if boxed { + buffer.appendInt32(1474492012) + } + break + case .inputMessagesFilterGeo: + if boxed { + buffer.appendInt32(-419271411) + } + break + case .inputMessagesFilterGif: + if boxed { + buffer.appendInt32(-3644025) + } + break + case .inputMessagesFilterMusic: + if boxed { + buffer.appendInt32(928101534) + } + break + case .inputMessagesFilterMyMentions: + if boxed { + buffer.appendInt32(-1040652646) + } + break + case .inputMessagesFilterPhoneCalls(let _data): + if boxed { + buffer.appendInt32(-2134272152) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .inputMessagesFilterPhotoVideo: + if boxed { + buffer.appendInt32(1458172132) + } + break + case .inputMessagesFilterPhotos: + if boxed { + buffer.appendInt32(-1777752804) + } + break + case .inputMessagesFilterPinned: + if boxed { + buffer.appendInt32(464520273) + } + break + case .inputMessagesFilterRoundVideo: + if boxed { + buffer.appendInt32(-1253451181) + } + break + case .inputMessagesFilterRoundVoice: + if boxed { + buffer.appendInt32(2054952868) + } + break + case .inputMessagesFilterUrl: + if boxed { + buffer.appendInt32(2129714567) + } + break + case .inputMessagesFilterVideo: + if boxed { + buffer.appendInt32(-1614803355) + } + break + case .inputMessagesFilterVoice: + if boxed { + buffer.appendInt32(1358283666) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputMessagesFilterChatPhotos: return ("inputMessagesFilterChatPhotos", []) - case .inputMessagesFilterContacts: + case .inputMessagesFilterContacts: return ("inputMessagesFilterContacts", []) - case .inputMessagesFilterDocument: + case .inputMessagesFilterDocument: return ("inputMessagesFilterDocument", []) - case .inputMessagesFilterEmpty: + case .inputMessagesFilterEmpty: return ("inputMessagesFilterEmpty", []) - case .inputMessagesFilterGeo: + case .inputMessagesFilterGeo: return ("inputMessagesFilterGeo", []) - case .inputMessagesFilterGif: + case .inputMessagesFilterGif: return ("inputMessagesFilterGif", []) - case .inputMessagesFilterMusic: + case .inputMessagesFilterMusic: return ("inputMessagesFilterMusic", []) - case .inputMessagesFilterMyMentions: + case .inputMessagesFilterMyMentions: return ("inputMessagesFilterMyMentions", []) - case .inputMessagesFilterPhoneCalls(let flags): - return ("inputMessagesFilterPhoneCalls", [("flags", flags as Any)]) - case .inputMessagesFilterPhotoVideo: + case .inputMessagesFilterPhoneCalls(let _data): + return ("inputMessagesFilterPhoneCalls", [("flags", _data.flags as Any)]) + case .inputMessagesFilterPhotoVideo: return ("inputMessagesFilterPhotoVideo", []) - case .inputMessagesFilterPhotos: + case .inputMessagesFilterPhotos: return ("inputMessagesFilterPhotos", []) - case .inputMessagesFilterPinned: + case .inputMessagesFilterPinned: return ("inputMessagesFilterPinned", []) - case .inputMessagesFilterRoundVideo: + case .inputMessagesFilterRoundVideo: return ("inputMessagesFilterRoundVideo", []) - case .inputMessagesFilterRoundVoice: + case .inputMessagesFilterRoundVoice: return ("inputMessagesFilterRoundVoice", []) - case .inputMessagesFilterUrl: + case .inputMessagesFilterUrl: return ("inputMessagesFilterUrl", []) - case .inputMessagesFilterVideo: + case .inputMessagesFilterVideo: return ("inputMessagesFilterVideo", []) - case .inputMessagesFilterVoice: + case .inputMessagesFilterVoice: return ("inputMessagesFilterVoice", []) - } - } - + } + } + public static func parse_inputMessagesFilterChatPhotos(_ reader: BufferReader) -> MessagesFilter? { return Api.MessagesFilter.inputMessagesFilterChatPhotos } @@ -771,7 +968,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.MessagesFilter.inputMessagesFilterPhoneCalls(flags: _1!) + return Api.MessagesFilter.inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls(flags: _1!)) } else { return nil @@ -801,32 +998,39 @@ public extension Api { public static func parse_inputMessagesFilterVoice(_ reader: BufferReader) -> MessagesFilter? { return Api.MessagesFilter.inputMessagesFilterVoice } - } } public extension Api { enum MissingInvitee: TypeConstructorDescription { - case missingInvitee(flags: Int32, userId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .missingInvitee(let flags, let userId): - if boxed { - buffer.appendInt32(1653379620) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .missingInvitee(let flags, let userId): - return ("missingInvitee", [("flags", flags as Any), ("userId", userId as Any)]) - } - } - + public class Cons_missingInvitee { + public var flags: Int32 + public var userId: Int64 + public init(flags: Int32, userId: Int64) { + self.flags = flags + self.userId = userId + } + } + case missingInvitee(Cons_missingInvitee) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .missingInvitee(let _data): + if boxed { + buffer.appendInt32(1653379620) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .missingInvitee(let _data): + return ("missingInvitee", [("flags", _data.flags as Any), ("userId", _data.userId as Any)]) + } + } + public static func parse_missingInvitee(_ reader: BufferReader) -> MissingInvitee? { var _1: Int32? _1 = reader.readInt32() @@ -835,57 +1039,80 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MissingInvitee.missingInvitee(flags: _1!, userId: _2!) + return Api.MissingInvitee.missingInvitee(Cons_missingInvitee(flags: _1!, userId: _2!)) } else { return nil } } - } } public extension Api { enum MyBoost: TypeConstructorDescription { - case myBoost(flags: Int32, slot: Int32, peer: Api.Peer?, date: Int32, expires: Int32, cooldownUntilDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .myBoost(let flags, let slot, let peer, let date, let expires, let cooldownUntilDate): - if boxed { - buffer.appendInt32(-1001897636) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(slot, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {peer!.serialize(buffer, true)} - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(expires, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(cooldownUntilDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .myBoost(let flags, let slot, let peer, let date, let expires, let cooldownUntilDate): - return ("myBoost", [("flags", flags as Any), ("slot", slot as Any), ("peer", peer as Any), ("date", date as Any), ("expires", expires as Any), ("cooldownUntilDate", cooldownUntilDate as Any)]) - } - } - + public class Cons_myBoost { + public var flags: Int32 + public var slot: Int32 + public var peer: Api.Peer? + public var date: Int32 + public var expires: Int32 + public var cooldownUntilDate: Int32? + public init(flags: Int32, slot: Int32, peer: Api.Peer?, date: Int32, expires: Int32, cooldownUntilDate: Int32?) { + self.flags = flags + self.slot = slot + self.peer = peer + self.date = date + self.expires = expires + self.cooldownUntilDate = cooldownUntilDate + } + } + case myBoost(Cons_myBoost) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .myBoost(let _data): + if boxed { + buffer.appendInt32(-1001897636) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.slot, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.peer!.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.cooldownUntilDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .myBoost(let _data): + return ("myBoost", [("flags", _data.flags as Any), ("slot", _data.slot as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("cooldownUntilDate", _data.cooldownUntilDate as Any)]) + } + } + public static func parse_myBoost(_ reader: BufferReader) -> MyBoost? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _4: Int32? _4 = reader.readInt32() var _5: Int32? _5 = reader.readInt32() var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -893,39 +1120,48 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MyBoost.myBoost(flags: _1!, slot: _2!, peer: _3, date: _4!, expires: _5!, cooldownUntilDate: _6) + return Api.MyBoost.myBoost(Cons_myBoost(flags: _1!, slot: _2!, peer: _3, date: _4!, expires: _5!, cooldownUntilDate: _6)) } else { return nil } } - } } public extension Api { enum NearestDc: TypeConstructorDescription { - case nearestDc(country: String, thisDc: Int32, nearestDc: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .nearestDc(let country, let thisDc, let nearestDc): - if boxed { - buffer.appendInt32(-1910892683) - } - serializeString(country, buffer: buffer, boxed: false) - serializeInt32(thisDc, buffer: buffer, boxed: false) - serializeInt32(nearestDc, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .nearestDc(let country, let thisDc, let nearestDc): - return ("nearestDc", [("country", country as Any), ("thisDc", thisDc as Any), ("nearestDc", nearestDc as Any)]) - } - } - + public class Cons_nearestDc { + public var country: String + public var thisDc: Int32 + public var nearestDc: Int32 + public init(country: String, thisDc: Int32, nearestDc: Int32) { + self.country = country + self.thisDc = thisDc + self.nearestDc = nearestDc + } + } + case nearestDc(Cons_nearestDc) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .nearestDc(let _data): + if boxed { + buffer.appendInt32(-1910892683) + } + serializeString(_data.country, buffer: buffer, boxed: false) + serializeInt32(_data.thisDc, buffer: buffer, boxed: false) + serializeInt32(_data.nearestDc, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .nearestDc(let _data): + return ("nearestDc", [("country", _data.country as Any), ("thisDc", _data.thisDc as Any), ("nearestDc", _data.nearestDc as Any)]) + } + } + public static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? { var _1: String? _1 = parseString(reader) @@ -937,12 +1173,11 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.NearestDc.nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!) + return Api.NearestDc.nearestDc(Cons_nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api18.swift b/submodules/TelegramApi/Sources/Api18.swift index 11ea4e2a43..5cd98a2121 100644 --- a/submodules/TelegramApi/Sources/Api18.swift +++ b/submodules/TelegramApi/Sources/Api18.swift @@ -1,53 +1,65 @@ public extension Api { enum NotificationSound: TypeConstructorDescription { + public class Cons_notificationSoundLocal { + public var title: String + public var data: String + public init(title: String, data: String) { + self.title = title + self.data = data + } + } + public class Cons_notificationSoundRingtone { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } case notificationSoundDefault - case notificationSoundLocal(title: String, data: String) + case notificationSoundLocal(Cons_notificationSoundLocal) case notificationSoundNone - case notificationSoundRingtone(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .notificationSoundDefault: - if boxed { - buffer.appendInt32(-1746354498) - } - - break - case .notificationSoundLocal(let title, let data): - if boxed { - buffer.appendInt32(-2096391452) - } - serializeString(title, buffer: buffer, boxed: false) - serializeString(data, buffer: buffer, boxed: false) - break - case .notificationSoundNone: - if boxed { - buffer.appendInt32(1863070943) - } - - break - case .notificationSoundRingtone(let id): - if boxed { - buffer.appendInt32(-9666487) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .notificationSoundDefault: + case notificationSoundRingtone(Cons_notificationSoundRingtone) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .notificationSoundDefault: + if boxed { + buffer.appendInt32(-1746354498) + } + break + case .notificationSoundLocal(let _data): + if boxed { + buffer.appendInt32(-2096391452) + } + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.data, buffer: buffer, boxed: false) + break + case .notificationSoundNone: + if boxed { + buffer.appendInt32(1863070943) + } + break + case .notificationSoundRingtone(let _data): + if boxed { + buffer.appendInt32(-9666487) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .notificationSoundDefault: return ("notificationSoundDefault", []) - case .notificationSoundLocal(let title, let data): - return ("notificationSoundLocal", [("title", title as Any), ("data", data as Any)]) - case .notificationSoundNone: + case .notificationSoundLocal(let _data): + return ("notificationSoundLocal", [("title", _data.title as Any), ("data", _data.data as Any)]) + case .notificationSoundNone: return ("notificationSoundNone", []) - case .notificationSoundRingtone(let id): - return ("notificationSoundRingtone", [("id", id as Any)]) - } - } - + case .notificationSoundRingtone(let _data): + return ("notificationSoundRingtone", [("id", _data.id as Any)]) + } + } + public static func parse_notificationSoundDefault(_ reader: BufferReader) -> NotificationSound? { return Api.NotificationSound.notificationSoundDefault } @@ -59,7 +71,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.NotificationSound.notificationSoundLocal(title: _1!, data: _2!) + return Api.NotificationSound.notificationSoundLocal(Cons_notificationSoundLocal(title: _1!, data: _2!)) } else { return nil @@ -73,74 +85,84 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.NotificationSound.notificationSoundRingtone(id: _1!) + return Api.NotificationSound.notificationSoundRingtone(Cons_notificationSoundRingtone(id: _1!)) } else { return nil } } - } } public extension Api { enum NotifyPeer: TypeConstructorDescription { + public class Cons_notifyForumTopic { + public var peer: Api.Peer + public var topMsgId: Int32 + public init(peer: Api.Peer, topMsgId: Int32) { + self.peer = peer + self.topMsgId = topMsgId + } + } + public class Cons_notifyPeer { + public var peer: Api.Peer + public init(peer: Api.Peer) { + self.peer = peer + } + } case notifyBroadcasts case notifyChats - case notifyForumTopic(peer: Api.Peer, topMsgId: Int32) - case notifyPeer(peer: Api.Peer) + case notifyForumTopic(Cons_notifyForumTopic) + case notifyPeer(Cons_notifyPeer) case notifyUsers - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .notifyBroadcasts: - if boxed { - buffer.appendInt32(-703403793) - } - - break - case .notifyChats: - if boxed { - buffer.appendInt32(-1073230141) - } - - break - case .notifyForumTopic(let peer, let topMsgId): - if boxed { - buffer.appendInt32(577659656) - } - peer.serialize(buffer, true) - serializeInt32(topMsgId, buffer: buffer, boxed: false) - break - case .notifyPeer(let peer): - if boxed { - buffer.appendInt32(-1613493288) - } - peer.serialize(buffer, true) - break - case .notifyUsers: - if boxed { - buffer.appendInt32(-1261946036) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .notifyBroadcasts: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .notifyBroadcasts: + if boxed { + buffer.appendInt32(-703403793) + } + break + case .notifyChats: + if boxed { + buffer.appendInt32(-1073230141) + } + break + case .notifyForumTopic(let _data): + if boxed { + buffer.appendInt32(577659656) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMsgId, buffer: buffer, boxed: false) + break + case .notifyPeer(let _data): + if boxed { + buffer.appendInt32(-1613493288) + } + _data.peer.serialize(buffer, true) + break + case .notifyUsers: + if boxed { + buffer.appendInt32(-1261946036) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .notifyBroadcasts: return ("notifyBroadcasts", []) - case .notifyChats: + case .notifyChats: return ("notifyChats", []) - case .notifyForumTopic(let peer, let topMsgId): - return ("notifyForumTopic", [("peer", peer as Any), ("topMsgId", topMsgId as Any)]) - case .notifyPeer(let peer): - return ("notifyPeer", [("peer", peer as Any)]) - case .notifyUsers: + case .notifyForumTopic(let _data): + return ("notifyForumTopic", [("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any)]) + case .notifyPeer(let _data): + return ("notifyPeer", [("peer", _data.peer as Any)]) + case .notifyUsers: return ("notifyUsers", []) - } - } - + } + } + public static func parse_notifyBroadcasts(_ reader: BufferReader) -> NotifyPeer? { return Api.NotifyPeer.notifyBroadcasts } @@ -157,7 +179,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.NotifyPeer.notifyForumTopic(peer: _1!, topMsgId: _2!) + return Api.NotifyPeer.notifyForumTopic(Cons_notifyForumTopic(peer: _1!, topMsgId: _2!)) } else { return nil @@ -170,7 +192,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.NotifyPeer.notifyPeer(peer: _1!) + return Api.NotifyPeer.notifyPeer(Cons_notifyPeer(peer: _1!)) } else { return nil @@ -179,84 +201,106 @@ public extension Api { public static func parse_notifyUsers(_ reader: BufferReader) -> NotifyPeer? { return Api.NotifyPeer.notifyUsers } - } } public extension Api { enum OutboxReadDate: TypeConstructorDescription { - case outboxReadDate(date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .outboxReadDate(let date): - if boxed { - buffer.appendInt32(1001931436) - } - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .outboxReadDate(let date): - return ("outboxReadDate", [("date", date as Any)]) - } - } - + public class Cons_outboxReadDate { + public var date: Int32 + public init(date: Int32) { + self.date = date + } + } + case outboxReadDate(Cons_outboxReadDate) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .outboxReadDate(let _data): + if boxed { + buffer.appendInt32(1001931436) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .outboxReadDate(let _data): + return ("outboxReadDate", [("date", _data.date as Any)]) + } + } + public static func parse_outboxReadDate(_ reader: BufferReader) -> OutboxReadDate? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.OutboxReadDate.outboxReadDate(date: _1!) + return Api.OutboxReadDate.outboxReadDate(Cons_outboxReadDate(date: _1!)) } else { return nil } } - } } public extension Api { enum Page: TypeConstructorDescription { - case page(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document], views: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .page(let flags, let url, let blocks, let photos, let documents, let views): - if boxed { - buffer.appendInt32(-1738178803) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(photos.count)) - for item in photos { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(views!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .page(let flags, let url, let blocks, let photos, let documents, let views): - return ("page", [("flags", flags as Any), ("url", url as Any), ("blocks", blocks as Any), ("photos", photos as Any), ("documents", documents as Any), ("views", views as Any)]) - } - } - + public class Cons_page { + public var flags: Int32 + public var url: String + public var blocks: [Api.PageBlock] + public var photos: [Api.Photo] + public var documents: [Api.Document] + public var views: Int32? + public init(flags: Int32, url: String, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document], views: Int32?) { + self.flags = flags + self.url = url + self.blocks = blocks + self.photos = photos + self.documents = documents + self.views = views + } + } + case page(Cons_page) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .page(let _data): + if boxed { + buffer.appendInt32(-1738178803) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.photos.count)) + for item in _data.photos { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.views!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .page(let _data): + return ("page", [("flags", _data.flags as Any), ("url", _data.url as Any), ("blocks", _data.blocks as Any), ("photos", _data.photos as Any), ("documents", _data.documents as Any), ("views", _data.views as Any)]) + } + } + public static func parse_page(_ reader: BufferReader) -> Page? { var _1: Int32? _1 = reader.readInt32() @@ -275,7 +319,9 @@ public extension Api { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } var _6: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -283,361 +329,602 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Page.page(flags: _1!, url: _2!, blocks: _3!, photos: _4!, documents: _5!, views: _6) + return Api.Page.page(Cons_page(flags: _1!, url: _2!, blocks: _3!, photos: _4!, documents: _5!, views: _6)) } else { return nil } } - } } public extension Api { indirect enum PageBlock: TypeConstructorDescription { - case pageBlockAnchor(name: String) - case pageBlockAudio(audioId: Int64, caption: Api.PageCaption) - case pageBlockAuthorDate(author: Api.RichText, publishedDate: Int32) - case pageBlockBlockquote(text: Api.RichText, caption: Api.RichText) - case pageBlockChannel(channel: Api.Chat) - case pageBlockCollage(items: [Api.PageBlock], caption: Api.PageCaption) - case pageBlockCover(cover: Api.PageBlock) - case pageBlockDetails(flags: Int32, blocks: [Api.PageBlock], title: Api.RichText) + public class Cons_pageBlockAnchor { + public var name: String + public init(name: String) { + self.name = name + } + } + public class Cons_pageBlockAudio { + public var audioId: Int64 + public var caption: Api.PageCaption + public init(audioId: Int64, caption: Api.PageCaption) { + self.audioId = audioId + self.caption = caption + } + } + public class Cons_pageBlockAuthorDate { + public var author: Api.RichText + public var publishedDate: Int32 + public init(author: Api.RichText, publishedDate: Int32) { + self.author = author + self.publishedDate = publishedDate + } + } + public class Cons_pageBlockBlockquote { + public var text: Api.RichText + public var caption: Api.RichText + public init(text: Api.RichText, caption: Api.RichText) { + self.text = text + self.caption = caption + } + } + public class Cons_pageBlockChannel { + public var channel: Api.Chat + public init(channel: Api.Chat) { + self.channel = channel + } + } + public class Cons_pageBlockCollage { + public var items: [Api.PageBlock] + public var caption: Api.PageCaption + public init(items: [Api.PageBlock], caption: Api.PageCaption) { + self.items = items + self.caption = caption + } + } + public class Cons_pageBlockCover { + public var cover: Api.PageBlock + public init(cover: Api.PageBlock) { + self.cover = cover + } + } + public class Cons_pageBlockDetails { + public var flags: Int32 + public var blocks: [Api.PageBlock] + public var title: Api.RichText + public init(flags: Int32, blocks: [Api.PageBlock], title: Api.RichText) { + self.flags = flags + self.blocks = blocks + self.title = title + } + } + public class Cons_pageBlockEmbed { + public var flags: Int32 + public var url: String? + public var html: String? + public var posterPhotoId: Int64? + public var w: Int32? + public var h: Int32? + public var caption: Api.PageCaption + public init(flags: Int32, url: String?, html: String?, posterPhotoId: Int64?, w: Int32?, h: Int32?, caption: Api.PageCaption) { + self.flags = flags + self.url = url + self.html = html + self.posterPhotoId = posterPhotoId + self.w = w + self.h = h + self.caption = caption + } + } + public class Cons_pageBlockEmbedPost { + public var url: String + public var webpageId: Int64 + public var authorPhotoId: Int64 + public var author: String + public var date: Int32 + public var blocks: [Api.PageBlock] + public var caption: Api.PageCaption + public init(url: String, webpageId: Int64, authorPhotoId: Int64, author: String, date: Int32, blocks: [Api.PageBlock], caption: Api.PageCaption) { + self.url = url + self.webpageId = webpageId + self.authorPhotoId = authorPhotoId + self.author = author + self.date = date + self.blocks = blocks + self.caption = caption + } + } + public class Cons_pageBlockFooter { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockHeader { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockKicker { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockList { + public var items: [Api.PageListItem] + public init(items: [Api.PageListItem]) { + self.items = items + } + } + public class Cons_pageBlockMap { + public var geo: Api.GeoPoint + public var zoom: Int32 + public var w: Int32 + public var h: Int32 + public var caption: Api.PageCaption + public init(geo: Api.GeoPoint, zoom: Int32, w: Int32, h: Int32, caption: Api.PageCaption) { + self.geo = geo + self.zoom = zoom + self.w = w + self.h = h + self.caption = caption + } + } + public class Cons_pageBlockOrderedList { + public var items: [Api.PageListOrderedItem] + public init(items: [Api.PageListOrderedItem]) { + self.items = items + } + } + public class Cons_pageBlockParagraph { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockPhoto { + public var flags: Int32 + public var photoId: Int64 + public var caption: Api.PageCaption + public var url: String? + public var webpageId: Int64? + public init(flags: Int32, photoId: Int64, caption: Api.PageCaption, url: String?, webpageId: Int64?) { + self.flags = flags + self.photoId = photoId + self.caption = caption + self.url = url + self.webpageId = webpageId + } + } + public class Cons_pageBlockPreformatted { + public var text: Api.RichText + public var language: String + public init(text: Api.RichText, language: String) { + self.text = text + self.language = language + } + } + public class Cons_pageBlockPullquote { + public var text: Api.RichText + public var caption: Api.RichText + public init(text: Api.RichText, caption: Api.RichText) { + self.text = text + self.caption = caption + } + } + public class Cons_pageBlockRelatedArticles { + public var title: Api.RichText + public var articles: [Api.PageRelatedArticle] + public init(title: Api.RichText, articles: [Api.PageRelatedArticle]) { + self.title = title + self.articles = articles + } + } + public class Cons_pageBlockSlideshow { + public var items: [Api.PageBlock] + public var caption: Api.PageCaption + public init(items: [Api.PageBlock], caption: Api.PageCaption) { + self.items = items + self.caption = caption + } + } + public class Cons_pageBlockSubheader { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockSubtitle { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockTable { + public var flags: Int32 + public var title: Api.RichText + public var rows: [Api.PageTableRow] + public init(flags: Int32, title: Api.RichText, rows: [Api.PageTableRow]) { + self.flags = flags + self.title = title + self.rows = rows + } + } + public class Cons_pageBlockTitle { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_pageBlockVideo { + public var flags: Int32 + public var videoId: Int64 + public var caption: Api.PageCaption + public init(flags: Int32, videoId: Int64, caption: Api.PageCaption) { + self.flags = flags + self.videoId = videoId + self.caption = caption + } + } + case pageBlockAnchor(Cons_pageBlockAnchor) + case pageBlockAudio(Cons_pageBlockAudio) + case pageBlockAuthorDate(Cons_pageBlockAuthorDate) + case pageBlockBlockquote(Cons_pageBlockBlockquote) + case pageBlockChannel(Cons_pageBlockChannel) + case pageBlockCollage(Cons_pageBlockCollage) + case pageBlockCover(Cons_pageBlockCover) + case pageBlockDetails(Cons_pageBlockDetails) case pageBlockDivider - case pageBlockEmbed(flags: Int32, url: String?, html: String?, posterPhotoId: Int64?, w: Int32?, h: Int32?, caption: Api.PageCaption) - case pageBlockEmbedPost(url: String, webpageId: Int64, authorPhotoId: Int64, author: String, date: Int32, blocks: [Api.PageBlock], caption: Api.PageCaption) - case pageBlockFooter(text: Api.RichText) - case pageBlockHeader(text: Api.RichText) - case pageBlockKicker(text: Api.RichText) - case pageBlockList(items: [Api.PageListItem]) - case pageBlockMap(geo: Api.GeoPoint, zoom: Int32, w: Int32, h: Int32, caption: Api.PageCaption) - case pageBlockOrderedList(items: [Api.PageListOrderedItem]) - case pageBlockParagraph(text: Api.RichText) - case pageBlockPhoto(flags: Int32, photoId: Int64, caption: Api.PageCaption, url: String?, webpageId: Int64?) - case pageBlockPreformatted(text: Api.RichText, language: String) - case pageBlockPullquote(text: Api.RichText, caption: Api.RichText) - case pageBlockRelatedArticles(title: Api.RichText, articles: [Api.PageRelatedArticle]) - case pageBlockSlideshow(items: [Api.PageBlock], caption: Api.PageCaption) - case pageBlockSubheader(text: Api.RichText) - case pageBlockSubtitle(text: Api.RichText) - case pageBlockTable(flags: Int32, title: Api.RichText, rows: [Api.PageTableRow]) - case pageBlockTitle(text: Api.RichText) + case pageBlockEmbed(Cons_pageBlockEmbed) + case pageBlockEmbedPost(Cons_pageBlockEmbedPost) + case pageBlockFooter(Cons_pageBlockFooter) + case pageBlockHeader(Cons_pageBlockHeader) + case pageBlockKicker(Cons_pageBlockKicker) + case pageBlockList(Cons_pageBlockList) + case pageBlockMap(Cons_pageBlockMap) + case pageBlockOrderedList(Cons_pageBlockOrderedList) + case pageBlockParagraph(Cons_pageBlockParagraph) + case pageBlockPhoto(Cons_pageBlockPhoto) + case pageBlockPreformatted(Cons_pageBlockPreformatted) + case pageBlockPullquote(Cons_pageBlockPullquote) + case pageBlockRelatedArticles(Cons_pageBlockRelatedArticles) + case pageBlockSlideshow(Cons_pageBlockSlideshow) + case pageBlockSubheader(Cons_pageBlockSubheader) + case pageBlockSubtitle(Cons_pageBlockSubtitle) + case pageBlockTable(Cons_pageBlockTable) + case pageBlockTitle(Cons_pageBlockTitle) case pageBlockUnsupported - case pageBlockVideo(flags: Int32, videoId: Int64, caption: Api.PageCaption) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageBlockAnchor(let name): - if boxed { - buffer.appendInt32(-837994576) - } - serializeString(name, buffer: buffer, boxed: false) - break - case .pageBlockAudio(let audioId, let caption): - if boxed { - buffer.appendInt32(-2143067670) - } - serializeInt64(audioId, buffer: buffer, boxed: false) - caption.serialize(buffer, true) - break - case .pageBlockAuthorDate(let author, let publishedDate): - if boxed { - buffer.appendInt32(-1162877472) - } - author.serialize(buffer, true) - serializeInt32(publishedDate, buffer: buffer, boxed: false) - break - case .pageBlockBlockquote(let text, let caption): - if boxed { - buffer.appendInt32(641563686) - } - text.serialize(buffer, true) - caption.serialize(buffer, true) - break - case .pageBlockChannel(let channel): - if boxed { - buffer.appendInt32(-283684427) - } - channel.serialize(buffer, true) - break - case .pageBlockCollage(let items, let caption): - if boxed { - buffer.appendInt32(1705048653) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(items.count)) - for item in items { - item.serialize(buffer, true) - } - caption.serialize(buffer, true) - break - case .pageBlockCover(let cover): - if boxed { - buffer.appendInt32(972174080) - } - cover.serialize(buffer, true) - break - case .pageBlockDetails(let flags, let blocks, let title): - if boxed { - buffer.appendInt32(1987480557) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - item.serialize(buffer, true) - } - title.serialize(buffer, true) - break - case .pageBlockDivider: - if boxed { - buffer.appendInt32(-618614392) - } - - break - case .pageBlockEmbed(let flags, let url, let html, let posterPhotoId, let w, let h, let caption): - if boxed { - buffer.appendInt32(-1468953147) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(html!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(posterPhotoId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(w!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(h!, buffer: buffer, boxed: false)} - caption.serialize(buffer, true) - break - case .pageBlockEmbedPost(let url, let webpageId, let authorPhotoId, let author, let date, let blocks, let caption): - if boxed { - buffer.appendInt32(-229005301) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(webpageId, buffer: buffer, boxed: false) - serializeInt64(authorPhotoId, buffer: buffer, boxed: false) - serializeString(author, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - item.serialize(buffer, true) - } - caption.serialize(buffer, true) - break - case .pageBlockFooter(let text): - if boxed { - buffer.appendInt32(1216809369) - } - text.serialize(buffer, true) - break - case .pageBlockHeader(let text): - if boxed { - buffer.appendInt32(-1076861716) - } - text.serialize(buffer, true) - break - case .pageBlockKicker(let text): - if boxed { - buffer.appendInt32(504660880) - } - text.serialize(buffer, true) - break - case .pageBlockList(let items): - if boxed { - buffer.appendInt32(-454524911) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(items.count)) - for item in items { - item.serialize(buffer, true) - } - break - case .pageBlockMap(let geo, let zoom, let w, let h, let caption): - if boxed { - buffer.appendInt32(-1538310410) - } - geo.serialize(buffer, true) - serializeInt32(zoom, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - caption.serialize(buffer, true) - break - case .pageBlockOrderedList(let items): - if boxed { - buffer.appendInt32(-1702174239) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(items.count)) - for item in items { - item.serialize(buffer, true) - } - break - case .pageBlockParagraph(let text): - if boxed { - buffer.appendInt32(1182402406) - } - text.serialize(buffer, true) - break - case .pageBlockPhoto(let flags, let photoId, let caption, let url, let webpageId): - if boxed { - buffer.appendInt32(391759200) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(photoId, buffer: buffer, boxed: false) - caption.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(webpageId!, buffer: buffer, boxed: false)} - break - case .pageBlockPreformatted(let text, let language): - if boxed { - buffer.appendInt32(-1066346178) - } - text.serialize(buffer, true) - serializeString(language, buffer: buffer, boxed: false) - break - case .pageBlockPullquote(let text, let caption): - if boxed { - buffer.appendInt32(1329878739) - } - text.serialize(buffer, true) - caption.serialize(buffer, true) - break - case .pageBlockRelatedArticles(let title, let articles): - if boxed { - buffer.appendInt32(370236054) - } - title.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(articles.count)) - for item in articles { - item.serialize(buffer, true) - } - break - case .pageBlockSlideshow(let items, let caption): - if boxed { - buffer.appendInt32(52401552) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(items.count)) - for item in items { - item.serialize(buffer, true) - } - caption.serialize(buffer, true) - break - case .pageBlockSubheader(let text): - if boxed { - buffer.appendInt32(-248793375) - } - text.serialize(buffer, true) - break - case .pageBlockSubtitle(let text): - if boxed { - buffer.appendInt32(-1879401953) - } - text.serialize(buffer, true) - break - case .pageBlockTable(let flags, let title, let rows): - if boxed { - buffer.appendInt32(-1085412734) - } - serializeInt32(flags, buffer: buffer, boxed: false) - title.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rows.count)) - for item in rows { - item.serialize(buffer, true) - } - break - case .pageBlockTitle(let text): - if boxed { - buffer.appendInt32(1890305021) - } - text.serialize(buffer, true) - break - case .pageBlockUnsupported: - if boxed { - buffer.appendInt32(324435594) - } - - break - case .pageBlockVideo(let flags, let videoId, let caption): - if boxed { - buffer.appendInt32(2089805750) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(videoId, buffer: buffer, boxed: false) - caption.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageBlockAnchor(let name): - return ("pageBlockAnchor", [("name", name as Any)]) - case .pageBlockAudio(let audioId, let caption): - return ("pageBlockAudio", [("audioId", audioId as Any), ("caption", caption as Any)]) - case .pageBlockAuthorDate(let author, let publishedDate): - return ("pageBlockAuthorDate", [("author", author as Any), ("publishedDate", publishedDate as Any)]) - case .pageBlockBlockquote(let text, let caption): - return ("pageBlockBlockquote", [("text", text as Any), ("caption", caption as Any)]) - case .pageBlockChannel(let channel): - return ("pageBlockChannel", [("channel", channel as Any)]) - case .pageBlockCollage(let items, let caption): - return ("pageBlockCollage", [("items", items as Any), ("caption", caption as Any)]) - case .pageBlockCover(let cover): - return ("pageBlockCover", [("cover", cover as Any)]) - case .pageBlockDetails(let flags, let blocks, let title): - return ("pageBlockDetails", [("flags", flags as Any), ("blocks", blocks as Any), ("title", title as Any)]) - case .pageBlockDivider: + case pageBlockVideo(Cons_pageBlockVideo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageBlockAnchor(let _data): + if boxed { + buffer.appendInt32(-837994576) + } + serializeString(_data.name, buffer: buffer, boxed: false) + break + case .pageBlockAudio(let _data): + if boxed { + buffer.appendInt32(-2143067670) + } + serializeInt64(_data.audioId, buffer: buffer, boxed: false) + _data.caption.serialize(buffer, true) + break + case .pageBlockAuthorDate(let _data): + if boxed { + buffer.appendInt32(-1162877472) + } + _data.author.serialize(buffer, true) + serializeInt32(_data.publishedDate, buffer: buffer, boxed: false) + break + case .pageBlockBlockquote(let _data): + if boxed { + buffer.appendInt32(641563686) + } + _data.text.serialize(buffer, true) + _data.caption.serialize(buffer, true) + break + case .pageBlockChannel(let _data): + if boxed { + buffer.appendInt32(-283684427) + } + _data.channel.serialize(buffer, true) + break + case .pageBlockCollage(let _data): + if boxed { + buffer.appendInt32(1705048653) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.items.count)) + for item in _data.items { + item.serialize(buffer, true) + } + _data.caption.serialize(buffer, true) + break + case .pageBlockCover(let _data): + if boxed { + buffer.appendInt32(972174080) + } + _data.cover.serialize(buffer, true) + break + case .pageBlockDetails(let _data): + if boxed { + buffer.appendInt32(1987480557) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + _data.title.serialize(buffer, true) + break + case .pageBlockDivider: + if boxed { + buffer.appendInt32(-618614392) + } + break + case .pageBlockEmbed(let _data): + if boxed { + buffer.appendInt32(-1468953147) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.html!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.posterPhotoId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.w!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.h!, buffer: buffer, boxed: false) + } + _data.caption.serialize(buffer, true) + break + case .pageBlockEmbedPost(let _data): + if boxed { + buffer.appendInt32(-229005301) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.webpageId, buffer: buffer, boxed: false) + serializeInt64(_data.authorPhotoId, buffer: buffer, boxed: false) + serializeString(_data.author, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + _data.caption.serialize(buffer, true) + break + case .pageBlockFooter(let _data): + if boxed { + buffer.appendInt32(1216809369) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeader(let _data): + if boxed { + buffer.appendInt32(-1076861716) + } + _data.text.serialize(buffer, true) + break + case .pageBlockKicker(let _data): + if boxed { + buffer.appendInt32(504660880) + } + _data.text.serialize(buffer, true) + break + case .pageBlockList(let _data): + if boxed { + buffer.appendInt32(-454524911) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.items.count)) + for item in _data.items { + item.serialize(buffer, true) + } + break + case .pageBlockMap(let _data): + if boxed { + buffer.appendInt32(-1538310410) + } + _data.geo.serialize(buffer, true) + serializeInt32(_data.zoom, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + _data.caption.serialize(buffer, true) + break + case .pageBlockOrderedList(let _data): + if boxed { + buffer.appendInt32(-1702174239) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.items.count)) + for item in _data.items { + item.serialize(buffer, true) + } + break + case .pageBlockParagraph(let _data): + if boxed { + buffer.appendInt32(1182402406) + } + _data.text.serialize(buffer, true) + break + case .pageBlockPhoto(let _data): + if boxed { + buffer.appendInt32(391759200) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.photoId, buffer: buffer, boxed: false) + _data.caption.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.webpageId!, buffer: buffer, boxed: false) + } + break + case .pageBlockPreformatted(let _data): + if boxed { + buffer.appendInt32(-1066346178) + } + _data.text.serialize(buffer, true) + serializeString(_data.language, buffer: buffer, boxed: false) + break + case .pageBlockPullquote(let _data): + if boxed { + buffer.appendInt32(1329878739) + } + _data.text.serialize(buffer, true) + _data.caption.serialize(buffer, true) + break + case .pageBlockRelatedArticles(let _data): + if boxed { + buffer.appendInt32(370236054) + } + _data.title.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.articles.count)) + for item in _data.articles { + item.serialize(buffer, true) + } + break + case .pageBlockSlideshow(let _data): + if boxed { + buffer.appendInt32(52401552) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.items.count)) + for item in _data.items { + item.serialize(buffer, true) + } + _data.caption.serialize(buffer, true) + break + case .pageBlockSubheader(let _data): + if boxed { + buffer.appendInt32(-248793375) + } + _data.text.serialize(buffer, true) + break + case .pageBlockSubtitle(let _data): + if boxed { + buffer.appendInt32(-1879401953) + } + _data.text.serialize(buffer, true) + break + case .pageBlockTable(let _data): + if boxed { + buffer.appendInt32(-1085412734) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rows.count)) + for item in _data.rows { + item.serialize(buffer, true) + } + break + case .pageBlockTitle(let _data): + if boxed { + buffer.appendInt32(1890305021) + } + _data.text.serialize(buffer, true) + break + case .pageBlockUnsupported: + if boxed { + buffer.appendInt32(324435594) + } + break + case .pageBlockVideo(let _data): + if boxed { + buffer.appendInt32(2089805750) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.videoId, buffer: buffer, boxed: false) + _data.caption.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageBlockAnchor(let _data): + return ("pageBlockAnchor", [("name", _data.name as Any)]) + case .pageBlockAudio(let _data): + return ("pageBlockAudio", [("audioId", _data.audioId as Any), ("caption", _data.caption as Any)]) + case .pageBlockAuthorDate(let _data): + return ("pageBlockAuthorDate", [("author", _data.author as Any), ("publishedDate", _data.publishedDate as Any)]) + case .pageBlockBlockquote(let _data): + return ("pageBlockBlockquote", [("text", _data.text as Any), ("caption", _data.caption as Any)]) + case .pageBlockChannel(let _data): + return ("pageBlockChannel", [("channel", _data.channel as Any)]) + case .pageBlockCollage(let _data): + return ("pageBlockCollage", [("items", _data.items as Any), ("caption", _data.caption as Any)]) + case .pageBlockCover(let _data): + return ("pageBlockCover", [("cover", _data.cover as Any)]) + case .pageBlockDetails(let _data): + return ("pageBlockDetails", [("flags", _data.flags as Any), ("blocks", _data.blocks as Any), ("title", _data.title as Any)]) + case .pageBlockDivider: return ("pageBlockDivider", []) - case .pageBlockEmbed(let flags, let url, let html, let posterPhotoId, let w, let h, let caption): - return ("pageBlockEmbed", [("flags", flags as Any), ("url", url as Any), ("html", html as Any), ("posterPhotoId", posterPhotoId as Any), ("w", w as Any), ("h", h as Any), ("caption", caption as Any)]) - case .pageBlockEmbedPost(let url, let webpageId, let authorPhotoId, let author, let date, let blocks, let caption): - return ("pageBlockEmbedPost", [("url", url as Any), ("webpageId", webpageId as Any), ("authorPhotoId", authorPhotoId as Any), ("author", author as Any), ("date", date as Any), ("blocks", blocks as Any), ("caption", caption as Any)]) - case .pageBlockFooter(let text): - return ("pageBlockFooter", [("text", text as Any)]) - case .pageBlockHeader(let text): - return ("pageBlockHeader", [("text", text as Any)]) - case .pageBlockKicker(let text): - return ("pageBlockKicker", [("text", text as Any)]) - case .pageBlockList(let items): - return ("pageBlockList", [("items", items as Any)]) - case .pageBlockMap(let geo, let zoom, let w, let h, let caption): - return ("pageBlockMap", [("geo", geo as Any), ("zoom", zoom as Any), ("w", w as Any), ("h", h as Any), ("caption", caption as Any)]) - case .pageBlockOrderedList(let items): - return ("pageBlockOrderedList", [("items", items as Any)]) - case .pageBlockParagraph(let text): - return ("pageBlockParagraph", [("text", text as Any)]) - case .pageBlockPhoto(let flags, let photoId, let caption, let url, let webpageId): - return ("pageBlockPhoto", [("flags", flags as Any), ("photoId", photoId as Any), ("caption", caption as Any), ("url", url as Any), ("webpageId", webpageId as Any)]) - case .pageBlockPreformatted(let text, let language): - return ("pageBlockPreformatted", [("text", text as Any), ("language", language as Any)]) - case .pageBlockPullquote(let text, let caption): - return ("pageBlockPullquote", [("text", text as Any), ("caption", caption as Any)]) - case .pageBlockRelatedArticles(let title, let articles): - return ("pageBlockRelatedArticles", [("title", title as Any), ("articles", articles as Any)]) - case .pageBlockSlideshow(let items, let caption): - return ("pageBlockSlideshow", [("items", items as Any), ("caption", caption as Any)]) - case .pageBlockSubheader(let text): - return ("pageBlockSubheader", [("text", text as Any)]) - case .pageBlockSubtitle(let text): - return ("pageBlockSubtitle", [("text", text as Any)]) - case .pageBlockTable(let flags, let title, let rows): - return ("pageBlockTable", [("flags", flags as Any), ("title", title as Any), ("rows", rows as Any)]) - case .pageBlockTitle(let text): - return ("pageBlockTitle", [("text", text as Any)]) - case .pageBlockUnsupported: + case .pageBlockEmbed(let _data): + return ("pageBlockEmbed", [("flags", _data.flags as Any), ("url", _data.url as Any), ("html", _data.html as Any), ("posterPhotoId", _data.posterPhotoId as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("caption", _data.caption as Any)]) + case .pageBlockEmbedPost(let _data): + return ("pageBlockEmbedPost", [("url", _data.url as Any), ("webpageId", _data.webpageId as Any), ("authorPhotoId", _data.authorPhotoId as Any), ("author", _data.author as Any), ("date", _data.date as Any), ("blocks", _data.blocks as Any), ("caption", _data.caption as Any)]) + case .pageBlockFooter(let _data): + return ("pageBlockFooter", [("text", _data.text as Any)]) + case .pageBlockHeader(let _data): + return ("pageBlockHeader", [("text", _data.text as Any)]) + case .pageBlockKicker(let _data): + return ("pageBlockKicker", [("text", _data.text as Any)]) + case .pageBlockList(let _data): + return ("pageBlockList", [("items", _data.items as Any)]) + case .pageBlockMap(let _data): + return ("pageBlockMap", [("geo", _data.geo as Any), ("zoom", _data.zoom as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("caption", _data.caption as Any)]) + case .pageBlockOrderedList(let _data): + return ("pageBlockOrderedList", [("items", _data.items as Any)]) + case .pageBlockParagraph(let _data): + return ("pageBlockParagraph", [("text", _data.text as Any)]) + case .pageBlockPhoto(let _data): + return ("pageBlockPhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("caption", _data.caption as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any)]) + case .pageBlockPreformatted(let _data): + return ("pageBlockPreformatted", [("text", _data.text as Any), ("language", _data.language as Any)]) + case .pageBlockPullquote(let _data): + return ("pageBlockPullquote", [("text", _data.text as Any), ("caption", _data.caption as Any)]) + case .pageBlockRelatedArticles(let _data): + return ("pageBlockRelatedArticles", [("title", _data.title as Any), ("articles", _data.articles as Any)]) + case .pageBlockSlideshow(let _data): + return ("pageBlockSlideshow", [("items", _data.items as Any), ("caption", _data.caption as Any)]) + case .pageBlockSubheader(let _data): + return ("pageBlockSubheader", [("text", _data.text as Any)]) + case .pageBlockSubtitle(let _data): + return ("pageBlockSubtitle", [("text", _data.text as Any)]) + case .pageBlockTable(let _data): + return ("pageBlockTable", [("flags", _data.flags as Any), ("title", _data.title as Any), ("rows", _data.rows as Any)]) + case .pageBlockTitle(let _data): + return ("pageBlockTitle", [("text", _data.text as Any)]) + case .pageBlockUnsupported: return ("pageBlockUnsupported", []) - case .pageBlockVideo(let flags, let videoId, let caption): - return ("pageBlockVideo", [("flags", flags as Any), ("videoId", videoId as Any), ("caption", caption as Any)]) - } - } - + case .pageBlockVideo(let _data): + return ("pageBlockVideo", [("flags", _data.flags as Any), ("videoId", _data.videoId as Any), ("caption", _data.caption as Any)]) + } + } + public static func parse_pageBlockAnchor(_ reader: BufferReader) -> PageBlock? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockAnchor(name: _1!) + return Api.PageBlock.pageBlockAnchor(Cons_pageBlockAnchor(name: _1!)) } else { return nil @@ -653,7 +940,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockAudio(audioId: _1!, caption: _2!) + return Api.PageBlock.pageBlockAudio(Cons_pageBlockAudio(audioId: _1!, caption: _2!)) } else { return nil @@ -669,7 +956,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockAuthorDate(author: _1!, publishedDate: _2!) + return Api.PageBlock.pageBlockAuthorDate(Cons_pageBlockAuthorDate(author: _1!, publishedDate: _2!)) } else { return nil @@ -687,7 +974,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockBlockquote(text: _1!, caption: _2!) + return Api.PageBlock.pageBlockBlockquote(Cons_pageBlockBlockquote(text: _1!, caption: _2!)) } else { return nil @@ -700,7 +987,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockChannel(channel: _1!) + return Api.PageBlock.pageBlockChannel(Cons_pageBlockChannel(channel: _1!)) } else { return nil @@ -718,7 +1005,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockCollage(items: _1!, caption: _2!) + return Api.PageBlock.pageBlockCollage(Cons_pageBlockCollage(items: _1!, caption: _2!)) } else { return nil @@ -731,7 +1018,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockCover(cover: _1!) + return Api.PageBlock.pageBlockCover(Cons_pageBlockCover(cover: _1!)) } else { return nil @@ -752,7 +1039,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockDetails(flags: _1!, blocks: _2!, title: _3!) + return Api.PageBlock.pageBlockDetails(Cons_pageBlockDetails(flags: _1!, blocks: _2!, title: _3!)) } else { return nil @@ -765,15 +1052,25 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 1) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } var _3: String? - if Int(_1!) & Int(1 << 2) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } var _4: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } var _5: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _6 = reader.readInt32() + } var _7: Api.PageCaption? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.PageCaption @@ -786,7 +1083,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 5) == 0) || _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PageBlock.pageBlockEmbed(flags: _1!, url: _2, html: _3, posterPhotoId: _4, w: _5, h: _6, caption: _7!) + return Api.PageBlock.pageBlockEmbed(Cons_pageBlockEmbed(flags: _1!, url: _2, html: _3, posterPhotoId: _4, w: _5, h: _6, caption: _7!)) } else { return nil @@ -819,7 +1116,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PageBlock.pageBlockEmbedPost(url: _1!, webpageId: _2!, authorPhotoId: _3!, author: _4!, date: _5!, blocks: _6!, caption: _7!) + return Api.PageBlock.pageBlockEmbedPost(Cons_pageBlockEmbedPost(url: _1!, webpageId: _2!, authorPhotoId: _3!, author: _4!, date: _5!, blocks: _6!, caption: _7!)) } else { return nil @@ -832,7 +1129,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockFooter(text: _1!) + return Api.PageBlock.pageBlockFooter(Cons_pageBlockFooter(text: _1!)) } else { return nil @@ -845,7 +1142,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockHeader(text: _1!) + return Api.PageBlock.pageBlockHeader(Cons_pageBlockHeader(text: _1!)) } else { return nil @@ -858,7 +1155,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockKicker(text: _1!) + return Api.PageBlock.pageBlockKicker(Cons_pageBlockKicker(text: _1!)) } else { return nil @@ -871,7 +1168,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockList(items: _1!) + return Api.PageBlock.pageBlockList(Cons_pageBlockList(items: _1!)) } else { return nil @@ -898,7 +1195,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PageBlock.pageBlockMap(geo: _1!, zoom: _2!, w: _3!, h: _4!, caption: _5!) + return Api.PageBlock.pageBlockMap(Cons_pageBlockMap(geo: _1!, zoom: _2!, w: _3!, h: _4!, caption: _5!)) } else { return nil @@ -911,7 +1208,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockOrderedList(items: _1!) + return Api.PageBlock.pageBlockOrderedList(Cons_pageBlockOrderedList(items: _1!)) } else { return nil @@ -924,7 +1221,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockParagraph(text: _1!) + return Api.PageBlock.pageBlockParagraph(Cons_pageBlockParagraph(text: _1!)) } else { return nil @@ -940,16 +1237,20 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.PageCaption } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PageBlock.pageBlockPhoto(flags: _1!, photoId: _2!, caption: _3!, url: _4, webpageId: _5) + return Api.PageBlock.pageBlockPhoto(Cons_pageBlockPhoto(flags: _1!, photoId: _2!, caption: _3!, url: _4, webpageId: _5)) } else { return nil @@ -965,7 +1266,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockPreformatted(text: _1!, language: _2!) + return Api.PageBlock.pageBlockPreformatted(Cons_pageBlockPreformatted(text: _1!, language: _2!)) } else { return nil @@ -983,7 +1284,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockPullquote(text: _1!, caption: _2!) + return Api.PageBlock.pageBlockPullquote(Cons_pageBlockPullquote(text: _1!, caption: _2!)) } else { return nil @@ -1001,7 +1302,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockRelatedArticles(title: _1!, articles: _2!) + return Api.PageBlock.pageBlockRelatedArticles(Cons_pageBlockRelatedArticles(title: _1!, articles: _2!)) } else { return nil @@ -1019,7 +1320,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageBlock.pageBlockSlideshow(items: _1!, caption: _2!) + return Api.PageBlock.pageBlockSlideshow(Cons_pageBlockSlideshow(items: _1!, caption: _2!)) } else { return nil @@ -1032,7 +1333,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockSubheader(text: _1!) + return Api.PageBlock.pageBlockSubheader(Cons_pageBlockSubheader(text: _1!)) } else { return nil @@ -1045,7 +1346,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockSubtitle(text: _1!) + return Api.PageBlock.pageBlockSubtitle(Cons_pageBlockSubtitle(text: _1!)) } else { return nil @@ -1066,7 +1367,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockTable(flags: _1!, title: _2!, rows: _3!) + return Api.PageBlock.pageBlockTable(Cons_pageBlockTable(flags: _1!, title: _2!, rows: _3!)) } else { return nil @@ -1079,7 +1380,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageBlock.pageBlockTitle(text: _1!) + return Api.PageBlock.pageBlockTitle(Cons_pageBlockTitle(text: _1!)) } else { return nil @@ -1101,12 +1402,11 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockVideo(flags: _1!, videoId: _2!, caption: _3!) + return Api.PageBlock.pageBlockVideo(Cons_pageBlockVideo(flags: _1!, videoId: _2!, caption: _3!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api19.swift b/submodules/TelegramApi/Sources/Api19.swift index 2cb2a538fd..42f2e03a4e 100644 --- a/submodules/TelegramApi/Sources/Api19.swift +++ b/submodules/TelegramApi/Sources/Api19.swift @@ -1,26 +1,34 @@ public extension Api { indirect enum PageCaption: TypeConstructorDescription { - case pageCaption(text: Api.RichText, credit: Api.RichText) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageCaption(let text, let credit): - if boxed { - buffer.appendInt32(1869903447) - } - text.serialize(buffer, true) - credit.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageCaption(let text, let credit): - return ("pageCaption", [("text", text as Any), ("credit", credit as Any)]) - } - } - + public class Cons_pageCaption { + public var text: Api.RichText + public var credit: Api.RichText + public init(text: Api.RichText, credit: Api.RichText) { + self.text = text + self.credit = credit + } + } + case pageCaption(Cons_pageCaption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageCaption(let _data): + if boxed { + buffer.appendInt32(1869903447) + } + _data.text.serialize(buffer, true) + _data.credit.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageCaption(let _data): + return ("pageCaption", [("text", _data.text as Any), ("credit", _data.credit as Any)]) + } + } + public static func parse_pageCaption(_ reader: BufferReader) -> PageCaption? { var _1: Api.RichText? if let signature = reader.readInt32() { @@ -33,50 +41,61 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageCaption.pageCaption(text: _1!, credit: _2!) + return Api.PageCaption.pageCaption(Cons_pageCaption(text: _1!, credit: _2!)) } else { return nil } } - } } public extension Api { indirect enum PageListItem: TypeConstructorDescription { - case pageListItemBlocks(blocks: [Api.PageBlock]) - case pageListItemText(text: Api.RichText) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageListItemBlocks(let blocks): - if boxed { - buffer.appendInt32(635466748) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - item.serialize(buffer, true) - } - break - case .pageListItemText(let text): - if boxed { - buffer.appendInt32(-1188055347) - } - text.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageListItemBlocks(let blocks): - return ("pageListItemBlocks", [("blocks", blocks as Any)]) - case .pageListItemText(let text): - return ("pageListItemText", [("text", text as Any)]) - } - } - + public class Cons_pageListItemBlocks { + public var blocks: [Api.PageBlock] + public init(blocks: [Api.PageBlock]) { + self.blocks = blocks + } + } + public class Cons_pageListItemText { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + case pageListItemBlocks(Cons_pageListItemBlocks) + case pageListItemText(Cons_pageListItemText) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageListItemBlocks(let _data): + if boxed { + buffer.appendInt32(635466748) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + break + case .pageListItemText(let _data): + if boxed { + buffer.appendInt32(-1188055347) + } + _data.text.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageListItemBlocks(let _data): + return ("pageListItemBlocks", [("blocks", _data.blocks as Any)]) + case .pageListItemText(let _data): + return ("pageListItemText", [("text", _data.text as Any)]) + } + } + public static func parse_pageListItemBlocks(_ reader: BufferReader) -> PageListItem? { var _1: [Api.PageBlock]? if let _ = reader.readInt32() { @@ -84,7 +103,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageListItem.pageListItemBlocks(blocks: _1!) + return Api.PageListItem.pageListItemBlocks(Cons_pageListItemBlocks(blocks: _1!)) } else { return nil @@ -97,52 +116,67 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageListItem.pageListItemText(text: _1!) + return Api.PageListItem.pageListItemText(Cons_pageListItemText(text: _1!)) } else { return nil } } - } } public extension Api { indirect enum PageListOrderedItem: TypeConstructorDescription { - case pageListOrderedItemBlocks(num: String, blocks: [Api.PageBlock]) - case pageListOrderedItemText(num: String, text: Api.RichText) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageListOrderedItemBlocks(let num, let blocks): - if boxed { - buffer.appendInt32(-1730311882) - } - serializeString(num, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - item.serialize(buffer, true) - } - break - case .pageListOrderedItemText(let num, let text): - if boxed { - buffer.appendInt32(1577484359) - } - serializeString(num, buffer: buffer, boxed: false) - text.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageListOrderedItemBlocks(let num, let blocks): - return ("pageListOrderedItemBlocks", [("num", num as Any), ("blocks", blocks as Any)]) - case .pageListOrderedItemText(let num, let text): - return ("pageListOrderedItemText", [("num", num as Any), ("text", text as Any)]) - } - } - + public class Cons_pageListOrderedItemBlocks { + public var num: String + public var blocks: [Api.PageBlock] + public init(num: String, blocks: [Api.PageBlock]) { + self.num = num + self.blocks = blocks + } + } + public class Cons_pageListOrderedItemText { + public var num: String + public var text: Api.RichText + public init(num: String, text: Api.RichText) { + self.num = num + self.text = text + } + } + case pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks) + case pageListOrderedItemText(Cons_pageListOrderedItemText) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageListOrderedItemBlocks(let _data): + if boxed { + buffer.appendInt32(-1730311882) + } + serializeString(_data.num, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + break + case .pageListOrderedItemText(let _data): + if boxed { + buffer.appendInt32(1577484359) + } + serializeString(_data.num, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageListOrderedItemBlocks(let _data): + return ("pageListOrderedItemBlocks", [("num", _data.num as Any), ("blocks", _data.blocks as Any)]) + case .pageListOrderedItemText(let _data): + return ("pageListOrderedItemText", [("num", _data.num as Any), ("text", _data.text as Any)]) + } + } + public static func parse_pageListOrderedItemBlocks(_ reader: BufferReader) -> PageListOrderedItem? { var _1: String? _1 = parseString(reader) @@ -153,7 +187,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageListOrderedItem.pageListOrderedItemBlocks(num: _1!, blocks: _2!) + return Api.PageListOrderedItem.pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks(num: _1!, blocks: _2!)) } else { return nil @@ -169,44 +203,73 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PageListOrderedItem.pageListOrderedItemText(num: _1!, text: _2!) + return Api.PageListOrderedItem.pageListOrderedItemText(Cons_pageListOrderedItemText(num: _1!, text: _2!)) } else { return nil } } - } } public extension Api { enum PageRelatedArticle: TypeConstructorDescription { - case pageRelatedArticle(flags: Int32, url: String, webpageId: Int64, title: String?, description: String?, photoId: Int64?, author: String?, publishedDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageRelatedArticle(let flags, let url, let webpageId, let title, let description, let photoId, let author, let publishedDate): - if boxed { - buffer.appendInt32(-1282352120) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(webpageId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(photoId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(author!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(publishedDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageRelatedArticle(let flags, let url, let webpageId, let title, let description, let photoId, let author, let publishedDate): - return ("pageRelatedArticle", [("flags", flags as Any), ("url", url as Any), ("webpageId", webpageId as Any), ("title", title as Any), ("description", description as Any), ("photoId", photoId as Any), ("author", author as Any), ("publishedDate", publishedDate as Any)]) - } - } - + public class Cons_pageRelatedArticle { + public var flags: Int32 + public var url: String + public var webpageId: Int64 + public var title: String? + public var description: String? + public var photoId: Int64? + public var author: String? + public var publishedDate: Int32? + public init(flags: Int32, url: String, webpageId: Int64, title: String?, description: String?, photoId: Int64?, author: String?, publishedDate: Int32?) { + self.flags = flags + self.url = url + self.webpageId = webpageId + self.title = title + self.description = description + self.photoId = photoId + self.author = author + self.publishedDate = publishedDate + } + } + case pageRelatedArticle(Cons_pageRelatedArticle) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageRelatedArticle(let _data): + if boxed { + buffer.appendInt32(-1282352120) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.webpageId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.photoId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.author!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.publishedDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageRelatedArticle(let _data): + return ("pageRelatedArticle", [("flags", _data.flags as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photoId", _data.photoId as Any), ("author", _data.author as Any), ("publishedDate", _data.publishedDate as Any)]) + } + } + public static func parse_pageRelatedArticle(_ reader: BufferReader) -> PageRelatedArticle? { var _1: Int32? _1 = reader.readInt32() @@ -215,15 +278,25 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = reader.readInt64() + } var _7: String? - if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -233,91 +306,119 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PageRelatedArticle.pageRelatedArticle(flags: _1!, url: _2!, webpageId: _3!, title: _4, description: _5, photoId: _6, author: _7, publishedDate: _8) + return Api.PageRelatedArticle.pageRelatedArticle(Cons_pageRelatedArticle(flags: _1!, url: _2!, webpageId: _3!, title: _4, description: _5, photoId: _6, author: _7, publishedDate: _8)) } else { return nil } } - } } public extension Api { indirect enum PageTableCell: TypeConstructorDescription { - case pageTableCell(flags: Int32, text: Api.RichText?, colspan: Int32?, rowspan: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageTableCell(let flags, let text, let colspan, let rowspan): - if boxed { - buffer.appendInt32(878078826) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {text!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(colspan!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(rowspan!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageTableCell(let flags, let text, let colspan, let rowspan): - return ("pageTableCell", [("flags", flags as Any), ("text", text as Any), ("colspan", colspan as Any), ("rowspan", rowspan as Any)]) - } - } - + public class Cons_pageTableCell { + public var flags: Int32 + public var text: Api.RichText? + public var colspan: Int32? + public var rowspan: Int32? + public init(flags: Int32, text: Api.RichText?, colspan: Int32?, rowspan: Int32?) { + self.flags = flags + self.text = text + self.colspan = colspan + self.rowspan = rowspan + } + } + case pageTableCell(Cons_pageTableCell) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageTableCell(let _data): + if boxed { + buffer.appendInt32(878078826) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + _data.text!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.colspan!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.rowspan!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageTableCell(let _data): + return ("pageTableCell", [("flags", _data.flags as Any), ("text", _data.text as Any), ("colspan", _data.colspan as Any), ("rowspan", _data.rowspan as Any)]) + } + } + public static func parse_pageTableCell(_ reader: BufferReader) -> PageTableCell? { var _1: Int32? _1 = reader.readInt32() var _2: Api.RichText? - if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 7) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PageTableCell.pageTableCell(flags: _1!, text: _2, colspan: _3, rowspan: _4) + return Api.PageTableCell.pageTableCell(Cons_pageTableCell(flags: _1!, text: _2, colspan: _3, rowspan: _4)) } else { return nil } } - } } public extension Api { enum PageTableRow: TypeConstructorDescription { - case pageTableRow(cells: [Api.PageTableCell]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pageTableRow(let cells): - if boxed { - buffer.appendInt32(-524237339) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(cells.count)) - for item in cells { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pageTableRow(let cells): - return ("pageTableRow", [("cells", cells as Any)]) - } - } - + public class Cons_pageTableRow { + public var cells: [Api.PageTableCell] + public init(cells: [Api.PageTableCell]) { + self.cells = cells + } + } + case pageTableRow(Cons_pageTableRow) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pageTableRow(let _data): + if boxed { + buffer.appendInt32(-524237339) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.cells.count)) + for item in _data.cells { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pageTableRow(let _data): + return ("pageTableRow", [("cells", _data.cells as Any)]) + } + } + public static func parse_pageTableRow(_ reader: BufferReader) -> PageTableRow? { var _1: [Api.PageTableCell]? if let _ = reader.readInt32() { @@ -325,55 +426,58 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PageTableRow.pageTableRow(cells: _1!) + return Api.PageTableRow.pageTableRow(Cons_pageTableRow(cells: _1!)) } else { return nil } } - } } public extension Api { indirect enum PaidReactionPrivacy: TypeConstructorDescription { + public class Cons_paidReactionPrivacyPeer { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + } case paidReactionPrivacyAnonymous case paidReactionPrivacyDefault - case paidReactionPrivacyPeer(peer: Api.InputPeer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paidReactionPrivacyAnonymous: - if boxed { - buffer.appendInt32(520887001) - } - - break - case .paidReactionPrivacyDefault: - if boxed { - buffer.appendInt32(543872158) - } - - break - case .paidReactionPrivacyPeer(let peer): - if boxed { - buffer.appendInt32(-596837136) - } - peer.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paidReactionPrivacyAnonymous: + case paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paidReactionPrivacyAnonymous: + if boxed { + buffer.appendInt32(520887001) + } + break + case .paidReactionPrivacyDefault: + if boxed { + buffer.appendInt32(543872158) + } + break + case .paidReactionPrivacyPeer(let _data): + if boxed { + buffer.appendInt32(-596837136) + } + _data.peer.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paidReactionPrivacyAnonymous: return ("paidReactionPrivacyAnonymous", []) - case .paidReactionPrivacyDefault: + case .paidReactionPrivacyDefault: return ("paidReactionPrivacyDefault", []) - case .paidReactionPrivacyPeer(let peer): - return ("paidReactionPrivacyPeer", [("peer", peer as Any)]) - } - } - + case .paidReactionPrivacyPeer(let _data): + return ("paidReactionPrivacyPeer", [("peer", _data.peer as Any)]) + } + } + public static func parse_paidReactionPrivacyAnonymous(_ reader: BufferReader) -> PaidReactionPrivacy? { return Api.PaidReactionPrivacy.paidReactionPrivacyAnonymous } @@ -387,42 +491,61 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PaidReactionPrivacy.paidReactionPrivacyPeer(peer: _1!) + return Api.PaidReactionPrivacy.paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer(peer: _1!)) } else { return nil } } - } } public extension Api { enum Passkey: TypeConstructorDescription { - case passkey(flags: Int32, id: String, name: String, date: Int32, softwareEmojiId: Int64?, lastUsageDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passkey(let flags, let id, let name, let date, let softwareEmojiId, let lastUsageDate): - if boxed { - buffer.appendInt32(-1738457409) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(softwareEmojiId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(lastUsageDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passkey(let flags, let id, let name, let date, let softwareEmojiId, let lastUsageDate): - return ("passkey", [("flags", flags as Any), ("id", id as Any), ("name", name as Any), ("date", date as Any), ("softwareEmojiId", softwareEmojiId as Any), ("lastUsageDate", lastUsageDate as Any)]) - } - } - + public class Cons_passkey { + public var flags: Int32 + public var id: String + public var name: String + public var date: Int32 + public var softwareEmojiId: Int64? + public var lastUsageDate: Int32? + public init(flags: Int32, id: String, name: String, date: Int32, softwareEmojiId: Int64?, lastUsageDate: Int32?) { + self.flags = flags + self.id = id + self.name = name + self.date = date + self.softwareEmojiId = softwareEmojiId + self.lastUsageDate = lastUsageDate + } + } + case passkey(Cons_passkey) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passkey(let _data): + if boxed { + buffer.appendInt32(-1738457409) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.softwareEmojiId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.lastUsageDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passkey(let _data): + return ("passkey", [("flags", _data.flags as Any), ("id", _data.id as Any), ("name", _data.name as Any), ("date", _data.date as Any), ("softwareEmojiId", _data.softwareEmojiId as Any), ("lastUsageDate", _data.lastUsageDate as Any)]) + } + } + public static func parse_passkey(_ reader: BufferReader) -> Passkey? { var _1: Int32? _1 = reader.readInt32() @@ -433,9 +556,13 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -443,49 +570,59 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Passkey.passkey(flags: _1!, id: _2!, name: _3!, date: _4!, softwareEmojiId: _5, lastUsageDate: _6) + return Api.Passkey.passkey(Cons_passkey(flags: _1!, id: _2!, name: _3!, date: _4!, softwareEmojiId: _5, lastUsageDate: _6)) } else { return nil } } - } } public extension Api { enum PasswordKdfAlgo: TypeConstructorDescription { - case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: Buffer, salt2: Buffer, g: Int32, p: Buffer) + public class Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow { + public var salt1: Buffer + public var salt2: Buffer + public var g: Int32 + public var p: Buffer + public init(salt1: Buffer, salt2: Buffer, g: Int32, p: Buffer) { + self.salt1 = salt1 + self.salt2 = salt2 + self.g = g + self.p = p + } + } + case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) case passwordKdfAlgoUnknown - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let salt1, let salt2, let g, let p): - if boxed { - buffer.appendInt32(982592842) - } - serializeBytes(salt1, buffer: buffer, boxed: false) - serializeBytes(salt2, buffer: buffer, boxed: false) - serializeInt32(g, buffer: buffer, boxed: false) - serializeBytes(p, buffer: buffer, boxed: false) - break - case .passwordKdfAlgoUnknown: - if boxed { - buffer.appendInt32(-732254058) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let salt1, let salt2, let g, let p): - return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", salt1 as Any), ("salt2", salt2 as Any), ("g", g as Any), ("p", p as Any)]) - case .passwordKdfAlgoUnknown: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data): + if boxed { + buffer.appendInt32(982592842) + } + serializeBytes(_data.salt1, buffer: buffer, boxed: false) + serializeBytes(_data.salt2, buffer: buffer, boxed: false) + serializeInt32(_data.g, buffer: buffer, boxed: false) + serializeBytes(_data.p, buffer: buffer, boxed: false) + break + case .passwordKdfAlgoUnknown: + if boxed { + buffer.appendInt32(-732254058) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data): + return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", _data.salt1 as Any), ("salt2", _data.salt2 as Any), ("g", _data.g as Any), ("p", _data.p as Any)]) + case .passwordKdfAlgoUnknown: return ("passwordKdfAlgoUnknown", []) - } - } - + } + } + public static func parse_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(_ reader: BufferReader) -> PasswordKdfAlgo? { var _1: Buffer? _1 = parseBytes(reader) @@ -500,7 +637,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: _1!, salt2: _2!, g: _3!, p: _4!) + return Api.PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: _1!, salt2: _2!, g: _3!, p: _4!)) } else { return nil @@ -509,32 +646,39 @@ public extension Api { public static func parse_passwordKdfAlgoUnknown(_ reader: BufferReader) -> PasswordKdfAlgo? { return Api.PasswordKdfAlgo.passwordKdfAlgoUnknown } - } } public extension Api { enum PaymentCharge: TypeConstructorDescription { - case paymentCharge(id: String, providerChargeId: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentCharge(let id, let providerChargeId): - if boxed { - buffer.appendInt32(-368917890) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(providerChargeId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentCharge(let id, let providerChargeId): - return ("paymentCharge", [("id", id as Any), ("providerChargeId", providerChargeId as Any)]) - } - } - + public class Cons_paymentCharge { + public var id: String + public var providerChargeId: String + public init(id: String, providerChargeId: String) { + self.id = id + self.providerChargeId = providerChargeId + } + } + case paymentCharge(Cons_paymentCharge) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentCharge(let _data): + if boxed { + buffer.appendInt32(-368917890) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.providerChargeId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentCharge(let _data): + return ("paymentCharge", [("id", _data.id as Any), ("providerChargeId", _data.providerChargeId as Any)]) + } + } + public static func parse_paymentCharge(_ reader: BufferReader) -> PaymentCharge? { var _1: String? _1 = parseString(reader) @@ -543,38 +687,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PaymentCharge.paymentCharge(id: _1!, providerChargeId: _2!) + return Api.PaymentCharge.paymentCharge(Cons_paymentCharge(id: _1!, providerChargeId: _2!)) } else { return nil } } - } } public extension Api { enum PaymentFormMethod: TypeConstructorDescription { - case paymentFormMethod(url: String, title: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentFormMethod(let url, let title): - if boxed { - buffer.appendInt32(-1996951013) - } - serializeString(url, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentFormMethod(let url, let title): - return ("paymentFormMethod", [("url", url as Any), ("title", title as Any)]) - } - } - + public class Cons_paymentFormMethod { + public var url: String + public var title: String + public init(url: String, title: String) { + self.url = url + self.title = title + } + } + case paymentFormMethod(Cons_paymentFormMethod) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentFormMethod(let _data): + if boxed { + buffer.appendInt32(-1996951013) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentFormMethod(let _data): + return ("paymentFormMethod", [("url", _data.url as Any), ("title", _data.title as Any)]) + } + } + public static func parse_paymentFormMethod(_ reader: BufferReader) -> PaymentFormMethod? { var _1: String? _1 = parseString(reader) @@ -583,92 +734,128 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PaymentFormMethod.paymentFormMethod(url: _1!, title: _2!) + return Api.PaymentFormMethod.paymentFormMethod(Cons_paymentFormMethod(url: _1!, title: _2!)) } else { return nil } } - } } public extension Api { enum PaymentRequestedInfo: TypeConstructorDescription { - case paymentRequestedInfo(flags: Int32, name: String?, phone: String?, email: String?, shippingAddress: Api.PostAddress?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentRequestedInfo(let flags, let name, let phone, let email, let shippingAddress): - if boxed { - buffer.appendInt32(-1868808300) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(name!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(phone!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(email!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {shippingAddress!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentRequestedInfo(let flags, let name, let phone, let email, let shippingAddress): - return ("paymentRequestedInfo", [("flags", flags as Any), ("name", name as Any), ("phone", phone as Any), ("email", email as Any), ("shippingAddress", shippingAddress as Any)]) - } - } - + public class Cons_paymentRequestedInfo { + public var flags: Int32 + public var name: String? + public var phone: String? + public var email: String? + public var shippingAddress: Api.PostAddress? + public init(flags: Int32, name: String?, phone: String?, email: String?, shippingAddress: Api.PostAddress?) { + self.flags = flags + self.name = name + self.phone = phone + self.email = email + self.shippingAddress = shippingAddress + } + } + case paymentRequestedInfo(Cons_paymentRequestedInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentRequestedInfo(let _data): + if boxed { + buffer.appendInt32(-1868808300) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.name!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.phone!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.email!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.shippingAddress!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentRequestedInfo(let _data): + return ("paymentRequestedInfo", [("flags", _data.flags as Any), ("name", _data.name as Any), ("phone", _data.phone as Any), ("email", _data.email as Any), ("shippingAddress", _data.shippingAddress as Any)]) + } + } + public static func parse_paymentRequestedInfo(_ reader: BufferReader) -> PaymentRequestedInfo? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } var _5: Api.PostAddress? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PostAddress - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PostAddress + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PaymentRequestedInfo.paymentRequestedInfo(flags: _1!, name: _2, phone: _3, email: _4, shippingAddress: _5) + return Api.PaymentRequestedInfo.paymentRequestedInfo(Cons_paymentRequestedInfo(flags: _1!, name: _2, phone: _3, email: _4, shippingAddress: _5)) } else { return nil } } - } } public extension Api { enum PaymentSavedCredentials: TypeConstructorDescription { - case paymentSavedCredentialsCard(id: String, title: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentSavedCredentialsCard(let id, let title): - if boxed { - buffer.appendInt32(-842892769) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentSavedCredentialsCard(let id, let title): - return ("paymentSavedCredentialsCard", [("id", id as Any), ("title", title as Any)]) - } - } - + public class Cons_paymentSavedCredentialsCard { + public var id: String + public var title: String + public init(id: String, title: String) { + self.id = id + self.title = title + } + } + case paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentSavedCredentialsCard(let _data): + if boxed { + buffer.appendInt32(-842892769) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentSavedCredentialsCard(let _data): + return ("paymentSavedCredentialsCard", [("id", _data.id as Any), ("title", _data.title as Any)]) + } + } + public static func parse_paymentSavedCredentialsCard(_ reader: BufferReader) -> PaymentSavedCredentials? { var _1: String? _1 = parseString(reader) @@ -677,61 +864,78 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PaymentSavedCredentials.paymentSavedCredentialsCard(id: _1!, title: _2!) + return Api.PaymentSavedCredentials.paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard(id: _1!, title: _2!)) } else { return nil } } - } } public extension Api { enum Peer: TypeConstructorDescription { - case peerChannel(channelId: Int64) - case peerChat(chatId: Int64) - case peerUser(userId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerChannel(let channelId): - if boxed { - buffer.appendInt32(-1566230754) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - break - case .peerChat(let chatId): - if boxed { - buffer.appendInt32(918946202) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - break - case .peerUser(let userId): - if boxed { - buffer.appendInt32(1498486562) - } - serializeInt64(userId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerChannel(let channelId): - return ("peerChannel", [("channelId", channelId as Any)]) - case .peerChat(let chatId): - return ("peerChat", [("chatId", chatId as Any)]) - case .peerUser(let userId): - return ("peerUser", [("userId", userId as Any)]) - } - } - + public class Cons_peerChannel { + public var channelId: Int64 + public init(channelId: Int64) { + self.channelId = channelId + } + } + public class Cons_peerChat { + public var chatId: Int64 + public init(chatId: Int64) { + self.chatId = chatId + } + } + public class Cons_peerUser { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + } + case peerChannel(Cons_peerChannel) + case peerChat(Cons_peerChat) + case peerUser(Cons_peerUser) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerChannel(let _data): + if boxed { + buffer.appendInt32(-1566230754) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + break + case .peerChat(let _data): + if boxed { + buffer.appendInt32(918946202) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + break + case .peerUser(let _data): + if boxed { + buffer.appendInt32(1498486562) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerChannel(let _data): + return ("peerChannel", [("channelId", _data.channelId as Any)]) + case .peerChat(let _data): + return ("peerChat", [("chatId", _data.chatId as Any)]) + case .peerUser(let _data): + return ("peerUser", [("userId", _data.userId as Any)]) + } + } + public static func parse_peerChannel(_ reader: BufferReader) -> Peer? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Peer.peerChannel(channelId: _1!) + return Api.Peer.peerChannel(Cons_peerChannel(channelId: _1!)) } else { return nil @@ -742,7 +946,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Peer.peerChat(chatId: _1!) + return Api.Peer.peerChat(Cons_peerChat(chatId: _1!)) } else { return nil @@ -753,38 +957,45 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Peer.peerUser(userId: _1!) + return Api.Peer.peerUser(Cons_peerUser(userId: _1!)) } else { return nil } } - } } public extension Api { enum PeerBlocked: TypeConstructorDescription { - case peerBlocked(peerId: Api.Peer, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerBlocked(let peerId, let date): - if boxed { - buffer.appendInt32(-386039788) - } - peerId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerBlocked(let peerId, let date): - return ("peerBlocked", [("peerId", peerId as Any), ("date", date as Any)]) - } - } - + public class Cons_peerBlocked { + public var peerId: Api.Peer + public var date: Int32 + public init(peerId: Api.Peer, date: Int32) { + self.peerId = peerId + self.date = date + } + } + case peerBlocked(Cons_peerBlocked) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerBlocked(let _data): + if boxed { + buffer.appendInt32(-386039788) + } + _data.peerId.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerBlocked(let _data): + return ("peerBlocked", [("peerId", _data.peerId as Any), ("date", _data.date as Any)]) + } + } + public static func parse_peerBlocked(_ reader: BufferReader) -> PeerBlocked? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -795,78 +1006,121 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PeerBlocked.peerBlocked(peerId: _1!, date: _2!) + return Api.PeerBlocked.peerBlocked(Cons_peerBlocked(peerId: _1!, date: _2!)) } else { return nil } } - } } public extension Api { enum PeerColor: TypeConstructorDescription { - case inputPeerColorCollectible(collectibleId: Int64) - case peerColor(flags: Int32, color: Int32?, backgroundEmojiId: Int64?) - case peerColorCollectible(flags: Int32, collectibleId: Int64, giftEmojiId: Int64, backgroundEmojiId: Int64, accentColor: Int32, colors: [Int32], darkAccentColor: Int32?, darkColors: [Int32]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPeerColorCollectible(let collectibleId): - if boxed { - buffer.appendInt32(-1192589655) - } - serializeInt64(collectibleId, buffer: buffer, boxed: false) - break - case .peerColor(let flags, let color, let backgroundEmojiId): - if boxed { - buffer.appendInt32(-1253352753) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false)} - break - case .peerColorCollectible(let flags, let collectibleId, let giftEmojiId, let backgroundEmojiId, let accentColor, let colors, let darkAccentColor, let darkColors): - if boxed { - buffer.appendInt32(-1178573926) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(collectibleId, buffer: buffer, boxed: false) - serializeInt64(giftEmojiId, buffer: buffer, boxed: false) - serializeInt64(backgroundEmojiId, buffer: buffer, boxed: false) - serializeInt32(accentColor, buffer: buffer, boxed: false) + public class Cons_inputPeerColorCollectible { + public var collectibleId: Int64 + public init(collectibleId: Int64) { + self.collectibleId = collectibleId + } + } + public class Cons_peerColor { + public var flags: Int32 + public var color: Int32? + public var backgroundEmojiId: Int64? + public init(flags: Int32, color: Int32?, backgroundEmojiId: Int64?) { + self.flags = flags + self.color = color + self.backgroundEmojiId = backgroundEmojiId + } + } + public class Cons_peerColorCollectible { + public var flags: Int32 + public var collectibleId: Int64 + public var giftEmojiId: Int64 + public var backgroundEmojiId: Int64 + public var accentColor: Int32 + public var colors: [Int32] + public var darkAccentColor: Int32? + public var darkColors: [Int32]? + public init(flags: Int32, collectibleId: Int64, giftEmojiId: Int64, backgroundEmojiId: Int64, accentColor: Int32, colors: [Int32], darkAccentColor: Int32?, darkColors: [Int32]?) { + self.flags = flags + self.collectibleId = collectibleId + self.giftEmojiId = giftEmojiId + self.backgroundEmojiId = backgroundEmojiId + self.accentColor = accentColor + self.colors = colors + self.darkAccentColor = darkAccentColor + self.darkColors = darkColors + } + } + case inputPeerColorCollectible(Cons_inputPeerColorCollectible) + case peerColor(Cons_peerColor) + case peerColorCollectible(Cons_peerColorCollectible) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPeerColorCollectible(let _data): + if boxed { + buffer.appendInt32(-1192589655) + } + serializeInt64(_data.collectibleId, buffer: buffer, boxed: false) + break + case .peerColor(let _data): + if boxed { + buffer.appendInt32(-1253352753) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.color!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.backgroundEmojiId!, buffer: buffer, boxed: false) + } + break + case .peerColorCollectible(let _data): + if boxed { + buffer.appendInt32(-1178573926) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.collectibleId, buffer: buffer, boxed: false) + serializeInt64(_data.giftEmojiId, buffer: buffer, boxed: false) + serializeInt64(_data.backgroundEmojiId, buffer: buffer, boxed: false) + serializeInt32(_data.accentColor, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.colors.count)) + for item in _data.colors { + serializeInt32(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.darkAccentColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(colors.count)) - for item in colors { + buffer.appendInt32(Int32(_data.darkColors!.count)) + for item in _data.darkColors! { serializeInt32(item, buffer: buffer, boxed: false) } - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(darkAccentColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(darkColors!.count)) - for item in darkColors! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPeerColorCollectible(let collectibleId): - return ("inputPeerColorCollectible", [("collectibleId", collectibleId as Any)]) - case .peerColor(let flags, let color, let backgroundEmojiId): - return ("peerColor", [("flags", flags as Any), ("color", color as Any), ("backgroundEmojiId", backgroundEmojiId as Any)]) - case .peerColorCollectible(let flags, let collectibleId, let giftEmojiId, let backgroundEmojiId, let accentColor, let colors, let darkAccentColor, let darkColors): - return ("peerColorCollectible", [("flags", flags as Any), ("collectibleId", collectibleId as Any), ("giftEmojiId", giftEmojiId as Any), ("backgroundEmojiId", backgroundEmojiId as Any), ("accentColor", accentColor as Any), ("colors", colors as Any), ("darkAccentColor", darkAccentColor as Any), ("darkColors", darkColors as Any)]) - } - } - + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPeerColorCollectible(let _data): + return ("inputPeerColorCollectible", [("collectibleId", _data.collectibleId as Any)]) + case .peerColor(let _data): + return ("peerColor", [("flags", _data.flags as Any), ("color", _data.color as Any), ("backgroundEmojiId", _data.backgroundEmojiId as Any)]) + case .peerColorCollectible(let _data): + return ("peerColorCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("giftEmojiId", _data.giftEmojiId as Any), ("backgroundEmojiId", _data.backgroundEmojiId as Any), ("accentColor", _data.accentColor as Any), ("colors", _data.colors as Any), ("darkAccentColor", _data.darkAccentColor as Any), ("darkColors", _data.darkColors as Any)]) + } + } + public static func parse_inputPeerColorCollectible(_ reader: BufferReader) -> PeerColor? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.PeerColor.inputPeerColorCollectible(collectibleId: _1!) + return Api.PeerColor.inputPeerColorCollectible(Cons_inputPeerColorCollectible(collectibleId: _1!)) } else { return nil @@ -876,14 +1130,18 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.PeerColor.peerColor(flags: _1!, color: _2, backgroundEmojiId: _3) + return Api.PeerColor.peerColor(Cons_peerColor(flags: _1!, color: _2, backgroundEmojiId: _3)) } else { return nil @@ -905,11 +1163,15 @@ public extension Api { _6 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } var _7: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = reader.readInt32() + } var _8: [Int32]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -919,48 +1181,63 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 1) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PeerColor.peerColorCollectible(flags: _1!, collectibleId: _2!, giftEmojiId: _3!, backgroundEmojiId: _4!, accentColor: _5!, colors: _6!, darkAccentColor: _7, darkColors: _8) + return Api.PeerColor.peerColorCollectible(Cons_peerColorCollectible(flags: _1!, collectibleId: _2!, giftEmojiId: _3!, backgroundEmojiId: _4!, accentColor: _5!, colors: _6!, darkAccentColor: _7, darkColors: _8)) } else { return nil } } - } } public extension Api { enum PeerLocated: TypeConstructorDescription { - case peerLocated(peer: Api.Peer, expires: Int32, distance: Int32) - case peerSelfLocated(expires: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerLocated(let peer, let expires, let distance): - if boxed { - buffer.appendInt32(-901375139) - } - peer.serialize(buffer, true) - serializeInt32(expires, buffer: buffer, boxed: false) - serializeInt32(distance, buffer: buffer, boxed: false) - break - case .peerSelfLocated(let expires): - if boxed { - buffer.appendInt32(-118740917) - } - serializeInt32(expires, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerLocated(let peer, let expires, let distance): - return ("peerLocated", [("peer", peer as Any), ("expires", expires as Any), ("distance", distance as Any)]) - case .peerSelfLocated(let expires): - return ("peerSelfLocated", [("expires", expires as Any)]) - } - } - + public class Cons_peerLocated { + public var peer: Api.Peer + public var expires: Int32 + public var distance: Int32 + public init(peer: Api.Peer, expires: Int32, distance: Int32) { + self.peer = peer + self.expires = expires + self.distance = distance + } + } + public class Cons_peerSelfLocated { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + } + case peerLocated(Cons_peerLocated) + case peerSelfLocated(Cons_peerSelfLocated) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerLocated(let _data): + if boxed { + buffer.appendInt32(-901375139) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + serializeInt32(_data.distance, buffer: buffer, boxed: false) + break + case .peerSelfLocated(let _data): + if boxed { + buffer.appendInt32(-118740917) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerLocated(let _data): + return ("peerLocated", [("peer", _data.peer as Any), ("expires", _data.expires as Any), ("distance", _data.distance as Any)]) + case .peerSelfLocated(let _data): + return ("peerSelfLocated", [("expires", _data.expires as Any)]) + } + } + public static func parse_peerLocated(_ reader: BufferReader) -> PeerLocated? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -974,7 +1251,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PeerLocated.peerLocated(peer: _1!, expires: _2!, distance: _3!) + return Api.PeerLocated.peerLocated(Cons_peerLocated(peer: _1!, expires: _2!, distance: _3!)) } else { return nil @@ -985,93 +1262,164 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.PeerLocated.peerSelfLocated(expires: _1!) + return Api.PeerLocated.peerSelfLocated(Cons_peerSelfLocated(expires: _1!)) } else { return nil } } - } } public extension Api { enum PeerNotifySettings: TypeConstructorDescription { - case peerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, iosSound: Api.NotificationSound?, androidSound: Api.NotificationSound?, otherSound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesIosSound: Api.NotificationSound?, storiesAndroidSound: Api.NotificationSound?, storiesOtherSound: Api.NotificationSound?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let iosSound, let androidSound, let otherSound, let storiesMuted, let storiesHideSender, let storiesIosSound, let storiesAndroidSound, let storiesOtherSound): - if boxed { - buffer.appendInt32(-1721619444) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {showPreviews!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {silent!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(muteUntil!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {iosSound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {androidSound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {otherSound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {storiesMuted!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {storiesHideSender!.serialize(buffer, true)} - if Int(flags) & Int(1 << 8) != 0 {storiesIosSound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 9) != 0 {storiesAndroidSound!.serialize(buffer, true)} - if Int(flags) & Int(1 << 10) != 0 {storiesOtherSound!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let iosSound, let androidSound, let otherSound, let storiesMuted, let storiesHideSender, let storiesIosSound, let storiesAndroidSound, let storiesOtherSound): - return ("peerNotifySettings", [("flags", flags as Any), ("showPreviews", showPreviews as Any), ("silent", silent as Any), ("muteUntil", muteUntil as Any), ("iosSound", iosSound as Any), ("androidSound", androidSound as Any), ("otherSound", otherSound as Any), ("storiesMuted", storiesMuted as Any), ("storiesHideSender", storiesHideSender as Any), ("storiesIosSound", storiesIosSound as Any), ("storiesAndroidSound", storiesAndroidSound as Any), ("storiesOtherSound", storiesOtherSound as Any)]) - } - } - + public class Cons_peerNotifySettings { + public var flags: Int32 + public var showPreviews: Api.Bool? + public var silent: Api.Bool? + public var muteUntil: Int32? + public var iosSound: Api.NotificationSound? + public var androidSound: Api.NotificationSound? + public var otherSound: Api.NotificationSound? + public var storiesMuted: Api.Bool? + public var storiesHideSender: Api.Bool? + public var storiesIosSound: Api.NotificationSound? + public var storiesAndroidSound: Api.NotificationSound? + public var storiesOtherSound: Api.NotificationSound? + public init(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, iosSound: Api.NotificationSound?, androidSound: Api.NotificationSound?, otherSound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesIosSound: Api.NotificationSound?, storiesAndroidSound: Api.NotificationSound?, storiesOtherSound: Api.NotificationSound?) { + self.flags = flags + self.showPreviews = showPreviews + self.silent = silent + self.muteUntil = muteUntil + self.iosSound = iosSound + self.androidSound = androidSound + self.otherSound = otherSound + self.storiesMuted = storiesMuted + self.storiesHideSender = storiesHideSender + self.storiesIosSound = storiesIosSound + self.storiesAndroidSound = storiesAndroidSound + self.storiesOtherSound = storiesOtherSound + } + } + case peerNotifySettings(Cons_peerNotifySettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerNotifySettings(let _data): + if boxed { + buffer.appendInt32(-1721619444) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.showPreviews!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.silent!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.muteUntil!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.iosSound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.androidSound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.otherSound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.storiesMuted!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + _data.storiesHideSender!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.storiesIosSound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.storiesAndroidSound!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.storiesOtherSound!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerNotifySettings(let _data): + return ("peerNotifySettings", [("flags", _data.flags as Any), ("showPreviews", _data.showPreviews as Any), ("silent", _data.silent as Any), ("muteUntil", _data.muteUntil as Any), ("iosSound", _data.iosSound as Any), ("androidSound", _data.androidSound as Any), ("otherSound", _data.otherSound as Any), ("storiesMuted", _data.storiesMuted as Any), ("storiesHideSender", _data.storiesHideSender as Any), ("storiesIosSound", _data.storiesIosSound as Any), ("storiesAndroidSound", _data.storiesAndroidSound as Any), ("storiesOtherSound", _data.storiesOtherSound as Any)]) + } + } + public static func parse_peerNotifySettings(_ reader: BufferReader) -> PeerNotifySettings? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: Api.Bool? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: Api.NotificationSound? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _6: Api.NotificationSound? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _7: Api.NotificationSound? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _8: Api.Bool? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _9: Api.Bool? - if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _10: Api.NotificationSound? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _11: Api.NotificationSound? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } var _12: Api.NotificationSound? - if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.NotificationSound - } } + if Int(_1!) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -1085,70 +1433,135 @@ public extension Api { let _c11 = (Int(_1!) & Int(1 << 9) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 10) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.PeerNotifySettings.peerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, iosSound: _5, androidSound: _6, otherSound: _7, storiesMuted: _8, storiesHideSender: _9, storiesIosSound: _10, storiesAndroidSound: _11, storiesOtherSound: _12) + return Api.PeerNotifySettings.peerNotifySettings(Cons_peerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, iosSound: _5, androidSound: _6, otherSound: _7, storiesMuted: _8, storiesHideSender: _9, storiesIosSound: _10, storiesAndroidSound: _11, storiesOtherSound: _12)) } else { return nil } } - } } public extension Api { enum PeerSettings: TypeConstructorDescription { - case peerSettings(flags: Int32, geoDistance: Int32?, requestChatTitle: String?, requestChatDate: Int32?, businessBotId: Int64?, businessBotManageUrl: String?, chargePaidMessageStars: Int64?, registrationMonth: String?, phoneCountry: String?, nameChangeDate: Int32?, photoChangeDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerSettings(let flags, let geoDistance, let requestChatTitle, let requestChatDate, let businessBotId, let businessBotManageUrl, let chargePaidMessageStars, let registrationMonth, let phoneCountry, let nameChangeDate, let photoChangeDate): - if boxed { - buffer.appendInt32(-193510921) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(geoDistance!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {serializeString(requestChatTitle!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {serializeInt32(requestChatDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt64(businessBotId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeString(businessBotManageUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt64(chargePaidMessageStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {serializeString(registrationMonth!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 16) != 0 {serializeString(phoneCountry!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt32(nameChangeDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt32(photoChangeDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerSettings(let flags, let geoDistance, let requestChatTitle, let requestChatDate, let businessBotId, let businessBotManageUrl, let chargePaidMessageStars, let registrationMonth, let phoneCountry, let nameChangeDate, let photoChangeDate): - return ("peerSettings", [("flags", flags as Any), ("geoDistance", geoDistance as Any), ("requestChatTitle", requestChatTitle as Any), ("requestChatDate", requestChatDate as Any), ("businessBotId", businessBotId as Any), ("businessBotManageUrl", businessBotManageUrl as Any), ("chargePaidMessageStars", chargePaidMessageStars as Any), ("registrationMonth", registrationMonth as Any), ("phoneCountry", phoneCountry as Any), ("nameChangeDate", nameChangeDate as Any), ("photoChangeDate", photoChangeDate as Any)]) - } - } - + public class Cons_peerSettings { + public var flags: Int32 + public var geoDistance: Int32? + public var requestChatTitle: String? + public var requestChatDate: Int32? + public var businessBotId: Int64? + public var businessBotManageUrl: String? + public var chargePaidMessageStars: Int64? + public var registrationMonth: String? + public var phoneCountry: String? + public var nameChangeDate: Int32? + public var photoChangeDate: Int32? + public init(flags: Int32, geoDistance: Int32?, requestChatTitle: String?, requestChatDate: Int32?, businessBotId: Int64?, businessBotManageUrl: String?, chargePaidMessageStars: Int64?, registrationMonth: String?, phoneCountry: String?, nameChangeDate: Int32?, photoChangeDate: Int32?) { + self.flags = flags + self.geoDistance = geoDistance + self.requestChatTitle = requestChatTitle + self.requestChatDate = requestChatDate + self.businessBotId = businessBotId + self.businessBotManageUrl = businessBotManageUrl + self.chargePaidMessageStars = chargePaidMessageStars + self.registrationMonth = registrationMonth + self.phoneCountry = phoneCountry + self.nameChangeDate = nameChangeDate + self.photoChangeDate = photoChangeDate + } + } + case peerSettings(Cons_peerSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerSettings(let _data): + if boxed { + buffer.appendInt32(-193510921) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.geoDistance!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeString(_data.requestChatTitle!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeInt32(_data.requestChatDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt64(_data.businessBotId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeString(_data.businessBotManageUrl!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt64(_data.chargePaidMessageStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeString(_data.registrationMonth!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.phoneCountry!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + serializeInt32(_data.nameChangeDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + serializeInt32(_data.photoChangeDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerSettings(let _data): + return ("peerSettings", [("flags", _data.flags as Any), ("geoDistance", _data.geoDistance as Any), ("requestChatTitle", _data.requestChatTitle as Any), ("requestChatDate", _data.requestChatDate as Any), ("businessBotId", _data.businessBotId as Any), ("businessBotManageUrl", _data.businessBotManageUrl as Any), ("chargePaidMessageStars", _data.chargePaidMessageStars as Any), ("registrationMonth", _data.registrationMonth as Any), ("phoneCountry", _data.phoneCountry as Any), ("nameChangeDate", _data.nameChangeDate as Any), ("photoChangeDate", _data.photoChangeDate as Any)]) + } + } + public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _2 = reader.readInt32() + } var _3: String? - if Int(_1!) & Int(1 << 9) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 9) != 0 { + _3 = parseString(reader) + } var _4: Int32? - if Int(_1!) & Int(1 << 9) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 9) != 0 { + _4 = reader.readInt32() + } var _5: Int64? - if Int(_1!) & Int(1 << 13) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 13) != 0 { + _5 = reader.readInt64() + } var _6: String? - if Int(_1!) & Int(1 << 13) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 13) != 0 { + _6 = parseString(reader) + } var _7: Int64? - if Int(_1!) & Int(1 << 14) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 14) != 0 { + _7 = reader.readInt64() + } var _8: String? - if Int(_1!) & Int(1 << 15) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 15) != 0 { + _8 = parseString(reader) + } var _9: String? - if Int(_1!) & Int(1 << 16) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _9 = parseString(reader) + } var _10: Int32? - if Int(_1!) & Int(1 << 17) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 17) != 0 { + _10 = reader.readInt32() + } var _11: Int32? - if Int(_1!) & Int(1 << 18) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 18) != 0 { + _11 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 6) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 9) == 0) || _3 != nil @@ -1161,44 +1574,57 @@ public extension Api { let _c10 = (Int(_1!) & Int(1 << 17) == 0) || _10 != nil let _c11 = (Int(_1!) & Int(1 << 18) == 0) || _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.PeerSettings.peerSettings(flags: _1!, geoDistance: _2, requestChatTitle: _3, requestChatDate: _4, businessBotId: _5, businessBotManageUrl: _6, chargePaidMessageStars: _7, registrationMonth: _8, phoneCountry: _9, nameChangeDate: _10, photoChangeDate: _11) + return Api.PeerSettings.peerSettings(Cons_peerSettings(flags: _1!, geoDistance: _2, requestChatTitle: _3, requestChatDate: _4, businessBotId: _5, businessBotManageUrl: _6, chargePaidMessageStars: _7, registrationMonth: _8, phoneCountry: _9, nameChangeDate: _10, photoChangeDate: _11)) } else { return nil } } - } } public extension Api { enum PeerStories: TypeConstructorDescription { - case peerStories(flags: Int32, peer: Api.Peer, maxReadId: Int32?, stories: [Api.StoryItem]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerStories(let flags, let peer, let maxReadId, let stories): - if boxed { - buffer.appendInt32(-1707742823) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(maxReadId!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stories.count)) - for item in stories { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerStories(let flags, let peer, let maxReadId, let stories): - return ("peerStories", [("flags", flags as Any), ("peer", peer as Any), ("maxReadId", maxReadId as Any), ("stories", stories as Any)]) - } - } - + public class Cons_peerStories { + public var flags: Int32 + public var peer: Api.Peer + public var maxReadId: Int32? + public var stories: [Api.StoryItem] + public init(flags: Int32, peer: Api.Peer, maxReadId: Int32?, stories: [Api.StoryItem]) { + self.flags = flags + self.peer = peer + self.maxReadId = maxReadId + self.stories = stories + } + } + case peerStories(Cons_peerStories) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerStories(let _data): + if boxed { + buffer.appendInt32(-1707742823) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.maxReadId!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stories.count)) + for item in _data.stories { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerStories(let _data): + return ("peerStories", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("maxReadId", _data.maxReadId as Any), ("stories", _data.stories as Any)]) + } + } + public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { var _1: Int32? _1 = reader.readInt32() @@ -1207,7 +1633,9 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: [Api.StoryItem]? if let _ = reader.readInt32() { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryItem.self) @@ -1217,40 +1645,51 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PeerStories.peerStories(flags: _1!, peer: _2!, maxReadId: _3, stories: _4!) + return Api.PeerStories.peerStories(Cons_peerStories(flags: _1!, peer: _2!, maxReadId: _3, stories: _4!)) } else { return nil } } - } } public extension Api { enum PendingSuggestion: TypeConstructorDescription { - case pendingSuggestion(suggestion: String, title: Api.TextWithEntities, description: Api.TextWithEntities, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pendingSuggestion(let suggestion, let title, let description, let url): - if boxed { - buffer.appendInt32(-404214254) - } - serializeString(suggestion, buffer: buffer, boxed: false) - title.serialize(buffer, true) - description.serialize(buffer, true) - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pendingSuggestion(let suggestion, let title, let description, let url): - return ("pendingSuggestion", [("suggestion", suggestion as Any), ("title", title as Any), ("description", description as Any), ("url", url as Any)]) - } - } - + public class Cons_pendingSuggestion { + public var suggestion: String + public var title: Api.TextWithEntities + public var description: Api.TextWithEntities + public var url: String + public init(suggestion: String, title: Api.TextWithEntities, description: Api.TextWithEntities, url: String) { + self.suggestion = suggestion + self.title = title + self.description = description + self.url = url + } + } + case pendingSuggestion(Cons_pendingSuggestion) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pendingSuggestion(let _data): + if boxed { + buffer.appendInt32(-404214254) + } + serializeString(_data.suggestion, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + _data.description.serialize(buffer, true) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pendingSuggestion(let _data): + return ("pendingSuggestion", [("suggestion", _data.suggestion as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any)]) + } + } + public static func parse_pendingSuggestion(_ reader: BufferReader) -> PendingSuggestion? { var _1: String? _1 = parseString(reader) @@ -1269,121 +1708,234 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PendingSuggestion.pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!) + return Api.PendingSuggestion.pendingSuggestion(Cons_pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!)) } else { return nil } } - } } public extension Api { enum PhoneCall: TypeConstructorDescription { - case phoneCall(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64, protocol: Api.PhoneCallProtocol, connections: [Api.PhoneConnection], startDate: Int32, customParameters: Api.DataJSON?) - case phoneCallAccepted(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gB: Buffer, protocol: Api.PhoneCallProtocol) - case phoneCallDiscarded(flags: Int32, id: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?) - case phoneCallEmpty(id: Int64) - case phoneCallRequested(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAHash: Buffer, protocol: Api.PhoneCallProtocol) - case phoneCallWaiting(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, protocol: Api.PhoneCallProtocol, receiveDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate, let customParameters): - if boxed { - buffer.appendInt32(810769141) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - serializeBytes(gAOrB, buffer: buffer, boxed: false) - serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(connections.count)) - for item in connections { - item.serialize(buffer, true) - } - serializeInt32(startDate, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {customParameters!.serialize(buffer, true)} - break - case .phoneCallAccepted(let flags, let id, let accessHash, let date, let adminId, let participantId, let gB, let `protocol`): - if boxed { - buffer.appendInt32(912311057) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - serializeBytes(gB, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - break - case .phoneCallDiscarded(let flags, let id, let reason, let duration): - if boxed { - buffer.appendInt32(1355435489) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {reason!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - break - case .phoneCallEmpty(let id): - if boxed { - buffer.appendInt32(1399245077) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .phoneCallRequested(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAHash, let `protocol`): - if boxed { - buffer.appendInt32(347139340) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - serializeBytes(gAHash, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - break - case .phoneCallWaiting(let flags, let id, let accessHash, let date, let adminId, let participantId, let `protocol`, let receiveDate): - if boxed { - buffer.appendInt32(-987599081) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(receiveDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneCall(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint, let `protocol`, let connections, let startDate, let customParameters): - return ("phoneCall", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gAOrB", gAOrB as Any), ("keyFingerprint", keyFingerprint as Any), ("`protocol`", `protocol` as Any), ("connections", connections as Any), ("startDate", startDate as Any), ("customParameters", customParameters as Any)]) - case .phoneCallAccepted(let flags, let id, let accessHash, let date, let adminId, let participantId, let gB, let `protocol`): - return ("phoneCallAccepted", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gB", gB as Any), ("`protocol`", `protocol` as Any)]) - case .phoneCallDiscarded(let flags, let id, let reason, let duration): - return ("phoneCallDiscarded", [("flags", flags as Any), ("id", id as Any), ("reason", reason as Any), ("duration", duration as Any)]) - case .phoneCallEmpty(let id): - return ("phoneCallEmpty", [("id", id as Any)]) - case .phoneCallRequested(let flags, let id, let accessHash, let date, let adminId, let participantId, let gAHash, let `protocol`): - return ("phoneCallRequested", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gAHash", gAHash as Any), ("`protocol`", `protocol` as Any)]) - case .phoneCallWaiting(let flags, let id, let accessHash, let date, let adminId, let participantId, let `protocol`, let receiveDate): - return ("phoneCallWaiting", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("`protocol`", `protocol` as Any), ("receiveDate", receiveDate as Any)]) - } - } - + public class Cons_phoneCall { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var gAOrB: Buffer + public var keyFingerprint: Int64 + public var `protocol`: Api.PhoneCallProtocol + public var connections: [Api.PhoneConnection] + public var startDate: Int32 + public var customParameters: Api.DataJSON? + public init(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64, `protocol`: Api.PhoneCallProtocol, connections: [Api.PhoneConnection], startDate: Int32, customParameters: Api.DataJSON?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.gAOrB = gAOrB + self.keyFingerprint = keyFingerprint + self.`protocol` = `protocol` + self.connections = connections + self.startDate = startDate + self.customParameters = customParameters + } + } + public class Cons_phoneCallAccepted { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var gB: Buffer + public var `protocol`: Api.PhoneCallProtocol + public init(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gB: Buffer, `protocol`: Api.PhoneCallProtocol) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.gB = gB + self.`protocol` = `protocol` + } + } + public class Cons_phoneCallDiscarded { + public var flags: Int32 + public var id: Int64 + public var reason: Api.PhoneCallDiscardReason? + public var duration: Int32? + public init(flags: Int32, id: Int64, reason: Api.PhoneCallDiscardReason?, duration: Int32?) { + self.flags = flags + self.id = id + self.reason = reason + self.duration = duration + } + } + public class Cons_phoneCallEmpty { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + public class Cons_phoneCallRequested { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var gAHash: Buffer + public var `protocol`: Api.PhoneCallProtocol + public init(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAHash: Buffer, `protocol`: Api.PhoneCallProtocol) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.gAHash = gAHash + self.`protocol` = `protocol` + } + } + public class Cons_phoneCallWaiting { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var `protocol`: Api.PhoneCallProtocol + public var receiveDate: Int32? + public init(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, `protocol`: Api.PhoneCallProtocol, receiveDate: Int32?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.`protocol` = `protocol` + self.receiveDate = receiveDate + } + } + case phoneCall(Cons_phoneCall) + case phoneCallAccepted(Cons_phoneCallAccepted) + case phoneCallDiscarded(Cons_phoneCallDiscarded) + case phoneCallEmpty(Cons_phoneCallEmpty) + case phoneCallRequested(Cons_phoneCallRequested) + case phoneCallWaiting(Cons_phoneCallWaiting) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .phoneCall(let _data): + if boxed { + buffer.appendInt32(810769141) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + serializeBytes(_data.gAOrB, buffer: buffer, boxed: false) + serializeInt64(_data.keyFingerprint, buffer: buffer, boxed: false) + _data.`protocol`.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.connections.count)) + for item in _data.connections { + item.serialize(buffer, true) + } + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + _data.customParameters!.serialize(buffer, true) + } + break + case .phoneCallAccepted(let _data): + if boxed { + buffer.appendInt32(912311057) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + serializeBytes(_data.gB, buffer: buffer, boxed: false) + _data.`protocol`.serialize(buffer, true) + break + case .phoneCallDiscarded(let _data): + if boxed { + buffer.appendInt32(1355435489) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.reason!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.duration!, buffer: buffer, boxed: false) + } + break + case .phoneCallEmpty(let _data): + if boxed { + buffer.appendInt32(1399245077) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + case .phoneCallRequested(let _data): + if boxed { + buffer.appendInt32(347139340) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + serializeBytes(_data.gAHash, buffer: buffer, boxed: false) + _data.`protocol`.serialize(buffer, true) + break + case .phoneCallWaiting(let _data): + if boxed { + buffer.appendInt32(-987599081) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + _data.`protocol`.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.receiveDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .phoneCall(let _data): + return ("phoneCall", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAOrB", _data.gAOrB as Any), ("keyFingerprint", _data.keyFingerprint as Any), ("`protocol`", _data.`protocol` as Any), ("connections", _data.connections as Any), ("startDate", _data.startDate as Any), ("customParameters", _data.customParameters as Any)]) + case .phoneCallAccepted(let _data): + return ("phoneCallAccepted", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gB", _data.gB as Any), ("`protocol`", _data.`protocol` as Any)]) + case .phoneCallDiscarded(let _data): + return ("phoneCallDiscarded", [("flags", _data.flags as Any), ("id", _data.id as Any), ("reason", _data.reason as Any), ("duration", _data.duration as Any)]) + case .phoneCallEmpty(let _data): + return ("phoneCallEmpty", [("id", _data.id as Any)]) + case .phoneCallRequested(let _data): + return ("phoneCallRequested", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAHash", _data.gAHash as Any), ("`protocol`", _data.`protocol` as Any)]) + case .phoneCallWaiting(let _data): + return ("phoneCallWaiting", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("`protocol`", _data.`protocol` as Any), ("receiveDate", _data.receiveDate as Any)]) + } + } + public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { var _1: Int32? _1 = reader.readInt32() @@ -1412,9 +1964,11 @@ public extension Api { var _11: Int32? _11 = reader.readInt32() var _12: Api.DataJSON? - if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.DataJSON - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1428,7 +1982,7 @@ public extension Api { let _c11 = _11 != nil let _c12 = (Int(_1!) & Int(1 << 7) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.PhoneCall.phoneCall(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAOrB: _7!, keyFingerprint: _8!, protocol: _9!, connections: _10!, startDate: _11!, customParameters: _12) + return Api.PhoneCall.phoneCall(Cons_phoneCall(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAOrB: _7!, keyFingerprint: _8!, protocol: _9!, connections: _10!, startDate: _11!, customParameters: _12)) } else { return nil @@ -1462,7 +2016,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PhoneCall.phoneCallAccepted(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gB: _7!, protocol: _8!) + return Api.PhoneCall.phoneCallAccepted(Cons_phoneCallAccepted(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gB: _7!, protocol: _8!)) } else { return nil @@ -1474,17 +2028,21 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Api.PhoneCallDiscardReason? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason + } + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhoneCall.phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4) + return Api.PhoneCall.phoneCallDiscarded(Cons_phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4)) } else { return nil @@ -1495,7 +2053,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.PhoneCall.phoneCallEmpty(id: _1!) + return Api.PhoneCall.phoneCallEmpty(Cons_phoneCallEmpty(id: _1!)) } else { return nil @@ -1529,7 +2087,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PhoneCall.phoneCallRequested(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAHash: _7!, protocol: _8!) + return Api.PhoneCall.phoneCallRequested(Cons_phoneCallRequested(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAHash: _7!, protocol: _8!)) } else { return nil @@ -1553,7 +2111,9 @@ public extension Api { _7 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol } var _8: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _8 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1563,12 +2123,11 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 0) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PhoneCall.phoneCallWaiting(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, protocol: _7!, receiveDate: _8) + return Api.PhoneCall.phoneCallWaiting(Cons_phoneCallWaiting(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, protocol: _7!, receiveDate: _8)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api2.swift b/submodules/TelegramApi/Sources/Api2.swift index 2c7da602bb..fb227263a7 100644 --- a/submodules/TelegramApi/Sources/Api2.swift +++ b/submodules/TelegramApi/Sources/Api2.swift @@ -1,30 +1,48 @@ public extension Api { enum BotBusinessConnection: TypeConstructorDescription { - case botBusinessConnection(flags: Int32, connectionId: String, userId: Int64, dcId: Int32, date: Int32, rights: Api.BusinessBotRights?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botBusinessConnection(let flags, let connectionId, let userId, let dcId, let date, let rights): - if boxed { - buffer.appendInt32(-1892371723) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(connectionId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {rights!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botBusinessConnection(let flags, let connectionId, let userId, let dcId, let date, let rights): - return ("botBusinessConnection", [("flags", flags as Any), ("connectionId", connectionId as Any), ("userId", userId as Any), ("dcId", dcId as Any), ("date", date as Any), ("rights", rights as Any)]) - } - } - + public class Cons_botBusinessConnection { + public var flags: Int32 + public var connectionId: String + public var userId: Int64 + public var dcId: Int32 + public var date: Int32 + public var rights: Api.BusinessBotRights? + public init(flags: Int32, connectionId: String, userId: Int64, dcId: Int32, date: Int32, rights: Api.BusinessBotRights?) { + self.flags = flags + self.connectionId = connectionId + self.userId = userId + self.dcId = dcId + self.date = date + self.rights = rights + } + } + case botBusinessConnection(Cons_botBusinessConnection) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botBusinessConnection(let _data): + if boxed { + buffer.appendInt32(-1892371723) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.connectionId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.rights!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botBusinessConnection(let _data): + return ("botBusinessConnection", [("flags", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("userId", _data.userId as Any), ("dcId", _data.dcId as Any), ("date", _data.date as Any), ("rights", _data.rights as Any)]) + } + } + public static func parse_botBusinessConnection(_ reader: BufferReader) -> BotBusinessConnection? { var _1: Int32? _1 = reader.readInt32() @@ -37,9 +55,11 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: Api.BusinessBotRights? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.BusinessBotRights - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.BusinessBotRights + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -47,38 +67,45 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.BotBusinessConnection.botBusinessConnection(flags: _1!, connectionId: _2!, userId: _3!, dcId: _4!, date: _5!, rights: _6) + return Api.BotBusinessConnection.botBusinessConnection(Cons_botBusinessConnection(flags: _1!, connectionId: _2!, userId: _3!, dcId: _4!, date: _5!, rights: _6)) } else { return nil } } - } } public extension Api { enum BotCommand: TypeConstructorDescription { - case botCommand(command: String, description: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botCommand(let command, let description): - if boxed { - buffer.appendInt32(-1032140601) - } - serializeString(command, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botCommand(let command, let description): - return ("botCommand", [("command", command as Any), ("description", description as Any)]) - } - } - + public class Cons_botCommand { + public var command: String + public var description: String + public init(command: String, description: String) { + self.command = command + self.description = description + } + } + case botCommand(Cons_botCommand) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botCommand(let _data): + if boxed { + buffer.appendInt32(-1032140601) + } + serializeString(_data.command, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botCommand(let _data): + return ("botCommand", [("command", _data.command as Any), ("description", _data.description as Any)]) + } + } + public static func parse_botCommand(_ reader: BufferReader) -> BotCommand? { var _1: String? _1 = parseString(reader) @@ -87,92 +114,107 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BotCommand.botCommand(command: _1!, description: _2!) + return Api.BotCommand.botCommand(Cons_botCommand(command: _1!, description: _2!)) } else { return nil } } - } } public extension Api { indirect enum BotCommandScope: TypeConstructorDescription { + public class Cons_botCommandScopePeer { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + } + public class Cons_botCommandScopePeerAdmins { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + } + public class Cons_botCommandScopePeerUser { + public var peer: Api.InputPeer + public var userId: Api.InputUser + public init(peer: Api.InputPeer, userId: Api.InputUser) { + self.peer = peer + self.userId = userId + } + } case botCommandScopeChatAdmins case botCommandScopeChats case botCommandScopeDefault - case botCommandScopePeer(peer: Api.InputPeer) - case botCommandScopePeerAdmins(peer: Api.InputPeer) - case botCommandScopePeerUser(peer: Api.InputPeer, userId: Api.InputUser) + case botCommandScopePeer(Cons_botCommandScopePeer) + case botCommandScopePeerAdmins(Cons_botCommandScopePeerAdmins) + case botCommandScopePeerUser(Cons_botCommandScopePeerUser) case botCommandScopeUsers - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botCommandScopeChatAdmins: - if boxed { - buffer.appendInt32(-1180016534) - } - - break - case .botCommandScopeChats: - if boxed { - buffer.appendInt32(1877059713) - } - - break - case .botCommandScopeDefault: - if boxed { - buffer.appendInt32(795652779) - } - - break - case .botCommandScopePeer(let peer): - if boxed { - buffer.appendInt32(-610432643) - } - peer.serialize(buffer, true) - break - case .botCommandScopePeerAdmins(let peer): - if boxed { - buffer.appendInt32(1071145937) - } - peer.serialize(buffer, true) - break - case .botCommandScopePeerUser(let peer, let userId): - if boxed { - buffer.appendInt32(169026035) - } - peer.serialize(buffer, true) - userId.serialize(buffer, true) - break - case .botCommandScopeUsers: - if boxed { - buffer.appendInt32(1011811544) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botCommandScopeChatAdmins: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botCommandScopeChatAdmins: + if boxed { + buffer.appendInt32(-1180016534) + } + break + case .botCommandScopeChats: + if boxed { + buffer.appendInt32(1877059713) + } + break + case .botCommandScopeDefault: + if boxed { + buffer.appendInt32(795652779) + } + break + case .botCommandScopePeer(let _data): + if boxed { + buffer.appendInt32(-610432643) + } + _data.peer.serialize(buffer, true) + break + case .botCommandScopePeerAdmins(let _data): + if boxed { + buffer.appendInt32(1071145937) + } + _data.peer.serialize(buffer, true) + break + case .botCommandScopePeerUser(let _data): + if boxed { + buffer.appendInt32(169026035) + } + _data.peer.serialize(buffer, true) + _data.userId.serialize(buffer, true) + break + case .botCommandScopeUsers: + if boxed { + buffer.appendInt32(1011811544) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botCommandScopeChatAdmins: return ("botCommandScopeChatAdmins", []) - case .botCommandScopeChats: + case .botCommandScopeChats: return ("botCommandScopeChats", []) - case .botCommandScopeDefault: + case .botCommandScopeDefault: return ("botCommandScopeDefault", []) - case .botCommandScopePeer(let peer): - return ("botCommandScopePeer", [("peer", peer as Any)]) - case .botCommandScopePeerAdmins(let peer): - return ("botCommandScopePeerAdmins", [("peer", peer as Any)]) - case .botCommandScopePeerUser(let peer, let userId): - return ("botCommandScopePeerUser", [("peer", peer as Any), ("userId", userId as Any)]) - case .botCommandScopeUsers: + case .botCommandScopePeer(let _data): + return ("botCommandScopePeer", [("peer", _data.peer as Any)]) + case .botCommandScopePeerAdmins(let _data): + return ("botCommandScopePeerAdmins", [("peer", _data.peer as Any)]) + case .botCommandScopePeerUser(let _data): + return ("botCommandScopePeerUser", [("peer", _data.peer as Any), ("userId", _data.userId as Any)]) + case .botCommandScopeUsers: return ("botCommandScopeUsers", []) - } - } - + } + } + public static func parse_botCommandScopeChatAdmins(_ reader: BufferReader) -> BotCommandScope? { return Api.BotCommandScope.botCommandScopeChatAdmins } @@ -189,7 +231,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.BotCommandScope.botCommandScopePeer(peer: _1!) + return Api.BotCommandScope.botCommandScopePeer(Cons_botCommandScopePeer(peer: _1!)) } else { return nil @@ -202,7 +244,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.BotCommandScope.botCommandScopePeerAdmins(peer: _1!) + return Api.BotCommandScope.botCommandScopePeerAdmins(Cons_botCommandScopePeerAdmins(peer: _1!)) } else { return nil @@ -220,7 +262,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BotCommandScope.botCommandScopePeerUser(peer: _1!, userId: _2!) + return Api.BotCommandScope.botCommandScopePeerUser(Cons_botCommandScopePeerUser(peer: _1!, userId: _2!)) } else { return nil @@ -229,77 +271,136 @@ public extension Api { public static func parse_botCommandScopeUsers(_ reader: BufferReader) -> BotCommandScope? { return Api.BotCommandScope.botCommandScopeUsers } - } } public extension Api { enum BotInfo: TypeConstructorDescription { - case botInfo(flags: Int32, userId: Int64?, description: String?, descriptionPhoto: Api.Photo?, descriptionDocument: Api.Document?, commands: [Api.BotCommand]?, menuButton: Api.BotMenuButton?, privacyPolicyUrl: String?, appSettings: Api.BotAppSettings?, verifierSettings: Api.BotVerifierSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings, let verifierSettings): - if boxed { - buffer.appendInt32(1300890265) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {descriptionPhoto!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {descriptionDocument!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(commands!.count)) - for item in commands! { + public class Cons_botInfo { + public var flags: Int32 + public var userId: Int64? + public var description: String? + public var descriptionPhoto: Api.Photo? + public var descriptionDocument: Api.Document? + public var commands: [Api.BotCommand]? + public var menuButton: Api.BotMenuButton? + public var privacyPolicyUrl: String? + public var appSettings: Api.BotAppSettings? + public var verifierSettings: Api.BotVerifierSettings? + public init(flags: Int32, userId: Int64?, description: String?, descriptionPhoto: Api.Photo?, descriptionDocument: Api.Document?, commands: [Api.BotCommand]?, menuButton: Api.BotMenuButton?, privacyPolicyUrl: String?, appSettings: Api.BotAppSettings?, verifierSettings: Api.BotVerifierSettings?) { + self.flags = flags + self.userId = userId + self.description = description + self.descriptionPhoto = descriptionPhoto + self.descriptionDocument = descriptionDocument + self.commands = commands + self.menuButton = menuButton + self.privacyPolicyUrl = privacyPolicyUrl + self.appSettings = appSettings + self.verifierSettings = verifierSettings + } + } + case botInfo(Cons_botInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botInfo(let _data): + if boxed { + buffer.appendInt32(1300890265) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.userId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.descriptionPhoto!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.descriptionDocument!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.commands!.count)) + for item in _data.commands! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 3) != 0 {menuButton!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {serializeString(privacyPolicyUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {appSettings!.serialize(buffer, true)} - if Int(flags) & Int(1 << 9) != 0 {verifierSettings!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton, let privacyPolicyUrl, let appSettings, let verifierSettings): - return ("botInfo", [("flags", flags as Any), ("userId", userId as Any), ("description", description as Any), ("descriptionPhoto", descriptionPhoto as Any), ("descriptionDocument", descriptionDocument as Any), ("commands", commands as Any), ("menuButton", menuButton as Any), ("privacyPolicyUrl", privacyPolicyUrl as Any), ("appSettings", appSettings as Any), ("verifierSettings", verifierSettings as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.menuButton!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeString(_data.privacyPolicyUrl!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.appSettings!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.verifierSettings!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botInfo(let _data): + return ("botInfo", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("description", _data.description as Any), ("descriptionPhoto", _data.descriptionPhoto as Any), ("descriptionDocument", _data.descriptionDocument as Any), ("commands", _data.commands as Any), ("menuButton", _data.menuButton as Any), ("privacyPolicyUrl", _data.privacyPolicyUrl as Any), ("appSettings", _data.appSettings as Any), ("verifierSettings", _data.verifierSettings as Any)]) + } + } + public static func parse_botInfo(_ reader: BufferReader) -> BotInfo? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: Api.Photo? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _5: Api.Document? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _6: [Api.BotCommand]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) + } + } var _7: Api.BotMenuButton? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.BotMenuButton - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.BotMenuButton + } + } var _8: String? - if Int(_1!) & Int(1 << 7) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 7) != 0 { + _8 = parseString(reader) + } var _9: Api.BotAppSettings? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.BotAppSettings - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.BotAppSettings + } + } var _10: Api.BotVerifierSettings? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.BotVerifierSettings - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.BotVerifierSettings + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -311,155 +412,294 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 8) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 9) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.BotInfo.botInfo(flags: _1!, userId: _2, description: _3, descriptionPhoto: _4, descriptionDocument: _5, commands: _6, menuButton: _7, privacyPolicyUrl: _8, appSettings: _9, verifierSettings: _10) + return Api.BotInfo.botInfo(Cons_botInfo(flags: _1!, userId: _2, description: _3, descriptionPhoto: _4, descriptionDocument: _5, commands: _6, menuButton: _7, privacyPolicyUrl: _8, appSettings: _9, verifierSettings: _10)) } else { return nil } } - } } public extension Api { enum BotInlineMessage: TypeConstructorDescription { - case botInlineMessageMediaAuto(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageMediaContact(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageMediaGeo(flags: Int32, geo: Api.GeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageMediaInvoice(flags: Int32, title: String, description: String, photo: Api.WebDocument?, currency: String, totalAmount: Int64, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageMediaVenue(flags: Int32, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageMediaWebPage(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?) - case botInlineMessageText(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup): - if boxed { - buffer.appendInt32(1984755728) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_botInlineMessageMediaAuto { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageMediaContact { + public var flags: Int32 + public var phoneNumber: String + public var firstName: String + public var lastName: String + public var vcard: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.phoneNumber = phoneNumber + self.firstName = firstName + self.lastName = lastName + self.vcard = vcard + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageMediaGeo { + public var flags: Int32 + public var geo: Api.GeoPoint + public var heading: Int32? + public var period: Int32? + public var proximityNotificationRadius: Int32? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, geo: Api.GeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.geo = geo + self.heading = heading + self.period = period + self.proximityNotificationRadius = proximityNotificationRadius + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageMediaInvoice { + public var flags: Int32 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var currency: String + public var totalAmount: Int64 + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, title: String, description: String, photo: Api.WebDocument?, currency: String, totalAmount: Int64, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.title = title + self.description = description + self.photo = photo + self.currency = currency + self.totalAmount = totalAmount + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageMediaVenue { + public var flags: Int32 + public var geo: Api.GeoPoint + public var title: String + public var address: String + public var provider: String + public var venueId: String + public var venueType: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.geo = geo + self.title = title + self.address = address + self.provider = provider + self.venueId = venueId + self.venueType = venueType + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageMediaWebPage { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var url: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.url = url + self.replyMarkup = replyMarkup + } + } + public class Cons_botInlineMessageText { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.replyMarkup = replyMarkup + } + } + case botInlineMessageMediaAuto(Cons_botInlineMessageMediaAuto) + case botInlineMessageMediaContact(Cons_botInlineMessageMediaContact) + case botInlineMessageMediaGeo(Cons_botInlineMessageMediaGeo) + case botInlineMessageMediaInvoice(Cons_botInlineMessageMediaInvoice) + case botInlineMessageMediaVenue(Cons_botInlineMessageMediaVenue) + case botInlineMessageMediaWebPage(Cons_botInlineMessageMediaWebPage) + case botInlineMessageText(Cons_botInlineMessageText) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botInlineMessageMediaAuto(let _data): + if boxed { + buffer.appendInt32(1984755728) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup): - if boxed { - buffer.appendInt32(416402882) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeString(vcard, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageMediaGeo(let flags, let geo, let heading, let period, let proximityNotificationRadius, let replyMarkup): - if boxed { - buffer.appendInt32(85477117) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(heading!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(proximityNotificationRadius!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageMediaInvoice(let flags, let title, let description, let photo, let currency, let totalAmount, let replyMarkup): - if boxed { - buffer.appendInt32(894081801) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageMediaVenue(let flags, let geo, let title, let address, let provider, let venueId, let venueType, let replyMarkup): - if boxed { - buffer.appendInt32(-1970903652) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geo.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(address, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - serializeString(venueId, buffer: buffer, boxed: false) - serializeString(venueType, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup): - if boxed { - buffer.appendInt32(-2137335386) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageMediaContact(let _data): + if boxed { + buffer.appendInt32(416402882) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + serializeString(_data.vcard, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageMediaGeo(let _data): + if boxed { + buffer.appendInt32(85477117) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.heading!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.period!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.proximityNotificationRadius!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageMediaInvoice(let _data): + if boxed { + buffer.appendInt32(894081801) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageMediaVenue(let _data): + if boxed { + buffer.appendInt32(-1970903652) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geo.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.address, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + serializeString(_data.venueId, buffer: buffer, boxed: false) + serializeString(_data.venueType, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageMediaWebPage(let _data): + if boxed { + buffer.appendInt32(-2137335386) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - serializeString(url, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .botInlineMessageText(let flags, let message, let entities, let replyMarkup): - if boxed { - buffer.appendInt32(-1937807902) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + } + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .botInlineMessageText(let _data): + if boxed { + buffer.appendInt32(-1937807902) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup): - return ("botInlineMessageMediaAuto", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup): - return ("botInlineMessageMediaContact", [("flags", flags as Any), ("phoneNumber", phoneNumber as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("vcard", vcard as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageMediaGeo(let flags, let geo, let heading, let period, let proximityNotificationRadius, let replyMarkup): - return ("botInlineMessageMediaGeo", [("flags", flags as Any), ("geo", geo as Any), ("heading", heading as Any), ("period", period as Any), ("proximityNotificationRadius", proximityNotificationRadius as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageMediaInvoice(let flags, let title, let description, let photo, let currency, let totalAmount, let replyMarkup): - return ("botInlineMessageMediaInvoice", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageMediaVenue(let flags, let geo, let title, let address, let provider, let venueId, let venueType, let replyMarkup): - return ("botInlineMessageMediaVenue", [("flags", flags as Any), ("geo", geo as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup): - return ("botInlineMessageMediaWebPage", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("url", url as Any), ("replyMarkup", replyMarkup as Any)]) - case .botInlineMessageText(let flags, let message, let entities, let replyMarkup): - return ("botInlineMessageText", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botInlineMessageMediaAuto(let _data): + return ("botInlineMessageMediaAuto", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageMediaContact(let _data): + return ("botInlineMessageMediaContact", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageMediaGeo(let _data): + return ("botInlineMessageMediaGeo", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageMediaInvoice(let _data): + return ("botInlineMessageMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageMediaVenue(let _data): + return ("botInlineMessageMediaVenue", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageMediaWebPage(let _data): + return ("botInlineMessageMediaWebPage", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("url", _data.url as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .botInlineMessageText(let _data): + return ("botInlineMessageText", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + } + } + public static func parse_botInlineMessageMediaAuto(_ reader: BufferReader) -> BotInlineMessage? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.BotInlineMessage.botInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4) + return Api.BotInlineMessage.botInlineMessageMediaAuto(Cons_botInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)) } else { return nil @@ -477,9 +717,11 @@ public extension Api { var _5: String? _5 = parseString(reader) var _6: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -487,7 +729,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.BotInlineMessage.botInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6) + return Api.BotInlineMessage.botInlineMessageMediaContact(Cons_botInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6)) } else { return nil @@ -501,15 +743,23 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } var _6: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -517,7 +767,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.BotInlineMessage.botInlineMessageMediaGeo(flags: _1!, geo: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6) + return Api.BotInlineMessage.botInlineMessageMediaGeo(Cons_botInlineMessageMediaGeo(flags: _1!, geo: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6)) } else { return nil @@ -531,17 +781,21 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.WebDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _5: String? _5 = parseString(reader) var _6: Int64? _6 = reader.readInt64() var _7: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -550,7 +804,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.BotInlineMessage.botInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, currency: _5!, totalAmount: _6!, replyMarkup: _7) + return Api.BotInlineMessage.botInlineMessageMediaInvoice(Cons_botInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, currency: _5!, totalAmount: _6!, replyMarkup: _7)) } else { return nil @@ -574,9 +828,11 @@ public extension Api { var _7: String? _7 = parseString(reader) var _8: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -586,7 +842,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.BotInlineMessage.botInlineMessageMediaVenue(flags: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8) + return Api.BotInlineMessage.botInlineMessageMediaVenue(Cons_botInlineMessageMediaVenue(flags: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8)) } else { return nil @@ -598,22 +854,26 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: String? _4 = parseString(reader) var _5: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.BotInlineMessage.botInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5) + return Api.BotInlineMessage.botInlineMessageMediaWebPage(Cons_botInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5)) } else { return nil @@ -625,73 +885,136 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.BotInlineMessage.botInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4) + return Api.BotInlineMessage.botInlineMessageText(Cons_botInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)) } else { return nil } } - } } public extension Api { enum BotInlineResult: TypeConstructorDescription { - case botInlineMediaResult(flags: Int32, id: String, type: String, photo: Api.Photo?, document: Api.Document?, title: String?, description: String?, sendMessage: Api.BotInlineMessage) - case botInlineResult(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.WebDocument?, content: Api.WebDocument?, sendMessage: Api.BotInlineMessage) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botInlineMediaResult(let flags, let id, let type, let photo, let document, let title, let description, let sendMessage): - if boxed { - buffer.appendInt32(400266251) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - sendMessage.serialize(buffer, true) - break - case .botInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage): - if boxed { - buffer.appendInt32(295067450) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {thumb!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {content!.serialize(buffer, true)} - sendMessage.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botInlineMediaResult(let flags, let id, let type, let photo, let document, let title, let description, let sendMessage): - return ("botInlineMediaResult", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("photo", photo as Any), ("document", document as Any), ("title", title as Any), ("description", description as Any), ("sendMessage", sendMessage as Any)]) - case .botInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage): - return ("botInlineResult", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("title", title as Any), ("description", description as Any), ("url", url as Any), ("thumb", thumb as Any), ("content", content as Any), ("sendMessage", sendMessage as Any)]) - } - } - + public class Cons_botInlineMediaResult { + public var flags: Int32 + public var id: String + public var type: String + public var photo: Api.Photo? + public var document: Api.Document? + public var title: String? + public var description: String? + public var sendMessage: Api.BotInlineMessage + public init(flags: Int32, id: String, type: String, photo: Api.Photo?, document: Api.Document?, title: String?, description: String?, sendMessage: Api.BotInlineMessage) { + self.flags = flags + self.id = id + self.type = type + self.photo = photo + self.document = document + self.title = title + self.description = description + self.sendMessage = sendMessage + } + } + public class Cons_botInlineResult { + public var flags: Int32 + public var id: String + public var type: String + public var title: String? + public var description: String? + public var url: String? + public var thumb: Api.WebDocument? + public var content: Api.WebDocument? + public var sendMessage: Api.BotInlineMessage + public init(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.WebDocument?, content: Api.WebDocument?, sendMessage: Api.BotInlineMessage) { + self.flags = flags + self.id = id + self.type = type + self.title = title + self.description = description + self.url = url + self.thumb = thumb + self.content = content + self.sendMessage = sendMessage + } + } + case botInlineMediaResult(Cons_botInlineMediaResult) + case botInlineResult(Cons_botInlineResult) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botInlineMediaResult(let _data): + if boxed { + buffer.appendInt32(400266251) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + _data.sendMessage.serialize(buffer, true) + break + case .botInlineResult(let _data): + if boxed { + buffer.appendInt32(295067450) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.thumb!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.content!.serialize(buffer, true) + } + _data.sendMessage.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botInlineMediaResult(let _data): + return ("botInlineMediaResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("photo", _data.photo as Any), ("document", _data.document as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sendMessage", _data.sendMessage as Any)]) + case .botInlineResult(let _data): + return ("botInlineResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any), ("thumb", _data.thumb as Any), ("content", _data.content as Any), ("sendMessage", _data.sendMessage as Any)]) + } + } + public static func parse_botInlineMediaResult(_ reader: BufferReader) -> BotInlineResult? { var _1: Int32? _1 = reader.readInt32() @@ -700,17 +1023,25 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.Photo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _5: Api.Document? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _6: String? - if Int(_1!) & Int(1 << 2) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } var _8: Api.BotInlineMessage? if let signature = reader.readInt32() { _8 = Api.parse(reader, signature: signature) as? Api.BotInlineMessage @@ -724,7 +1055,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.BotInlineResult.botInlineMediaResult(flags: _1!, id: _2!, type: _3!, photo: _4, document: _5, title: _6, description: _7, sendMessage: _8!) + return Api.BotInlineResult.botInlineMediaResult(Cons_botInlineMediaResult(flags: _1!, id: _2!, type: _3!, photo: _4, document: _5, title: _6, description: _7, sendMessage: _8!)) } else { return nil @@ -738,19 +1069,29 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } var _7: Api.WebDocument? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _8: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _9: Api.BotInlineMessage? if let signature = reader.readInt32() { _9 = Api.parse(reader, signature: signature) as? Api.BotInlineMessage @@ -765,56 +1106,61 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.BotInlineResult.botInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!) + return Api.BotInlineResult.botInlineResult(Cons_botInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!)) } else { return nil } } - } } public extension Api { enum BotMenuButton: TypeConstructorDescription { - case botMenuButton(text: String, url: String) + public class Cons_botMenuButton { + public var text: String + public var url: String + public init(text: String, url: String) { + self.text = text + self.url = url + } + } + case botMenuButton(Cons_botMenuButton) case botMenuButtonCommands case botMenuButtonDefault - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botMenuButton(let text, let url): - if boxed { - buffer.appendInt32(-944407322) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - case .botMenuButtonCommands: - if boxed { - buffer.appendInt32(1113113093) - } - - break - case .botMenuButtonDefault: - if boxed { - buffer.appendInt32(1966318984) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botMenuButton(let text, let url): - return ("botMenuButton", [("text", text as Any), ("url", url as Any)]) - case .botMenuButtonCommands: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botMenuButton(let _data): + if boxed { + buffer.appendInt32(-944407322) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .botMenuButtonCommands: + if boxed { + buffer.appendInt32(1113113093) + } + break + case .botMenuButtonDefault: + if boxed { + buffer.appendInt32(1966318984) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botMenuButton(let _data): + return ("botMenuButton", [("text", _data.text as Any), ("url", _data.url as Any)]) + case .botMenuButtonCommands: return ("botMenuButtonCommands", []) - case .botMenuButtonDefault: + case .botMenuButtonDefault: return ("botMenuButtonDefault", []) - } - } - + } + } + public static func parse_botMenuButton(_ reader: BufferReader) -> BotMenuButton? { var _1: String? _1 = parseString(reader) @@ -823,7 +1169,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BotMenuButton.botMenuButton(text: _1!, url: _2!) + return Api.BotMenuButton.botMenuButton(Cons_botMenuButton(text: _1!, url: _2!)) } else { return nil @@ -835,32 +1181,39 @@ public extension Api { public static func parse_botMenuButtonDefault(_ reader: BufferReader) -> BotMenuButton? { return Api.BotMenuButton.botMenuButtonDefault } - } } public extension Api { indirect enum BotPreviewMedia: TypeConstructorDescription { - case botPreviewMedia(date: Int32, media: Api.MessageMedia) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botPreviewMedia(let date, let media): - if boxed { - buffer.appendInt32(602479523) - } - serializeInt32(date, buffer: buffer, boxed: false) - media.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botPreviewMedia(let date, let media): - return ("botPreviewMedia", [("date", date as Any), ("media", media as Any)]) - } - } - + public class Cons_botPreviewMedia { + public var date: Int32 + public var media: Api.MessageMedia + public init(date: Int32, media: Api.MessageMedia) { + self.date = date + self.media = media + } + } + case botPreviewMedia(Cons_botPreviewMedia) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botPreviewMedia(let _data): + if boxed { + buffer.appendInt32(602479523) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.media.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botPreviewMedia(let _data): + return ("botPreviewMedia", [("date", _data.date as Any), ("media", _data.media as Any)]) + } + } + public static func parse_botPreviewMedia(_ reader: BufferReader) -> BotPreviewMedia? { var _1: Int32? _1 = reader.readInt32() @@ -871,39 +1224,48 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BotPreviewMedia.botPreviewMedia(date: _1!, media: _2!) + return Api.BotPreviewMedia.botPreviewMedia(Cons_botPreviewMedia(date: _1!, media: _2!)) } else { return nil } } - } } public extension Api { enum BotVerification: TypeConstructorDescription { - case botVerification(botId: Int64, icon: Int64, description: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botVerification(let botId, let icon, let description): - if boxed { - buffer.appendInt32(-113453988) - } - serializeInt64(botId, buffer: buffer, boxed: false) - serializeInt64(icon, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botVerification(let botId, let icon, let description): - return ("botVerification", [("botId", botId as Any), ("icon", icon as Any), ("description", description as Any)]) - } - } - + public class Cons_botVerification { + public var botId: Int64 + public var icon: Int64 + public var description: String + public init(botId: Int64, icon: Int64, description: String) { + self.botId = botId + self.icon = icon + self.description = description + } + } + case botVerification(Cons_botVerification) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botVerification(let _data): + if boxed { + buffer.appendInt32(-113453988) + } + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt64(_data.icon, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botVerification(let _data): + return ("botVerification", [("botId", _data.botId as Any), ("icon", _data.icon as Any), ("description", _data.description as Any)]) + } + } + public static func parse_botVerification(_ reader: BufferReader) -> BotVerification? { var _1: Int64? _1 = reader.readInt64() @@ -915,40 +1277,53 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.BotVerification.botVerification(botId: _1!, icon: _2!, description: _3!) + return Api.BotVerification.botVerification(Cons_botVerification(botId: _1!, icon: _2!, description: _3!)) } else { return nil } } - } } public extension Api { enum BotVerifierSettings: TypeConstructorDescription { - case botVerifierSettings(flags: Int32, icon: Int64, company: String, customDescription: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botVerifierSettings(let flags, let icon, let company, let customDescription): - if boxed { - buffer.appendInt32(-1328716265) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(icon, buffer: buffer, boxed: false) - serializeString(company, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(customDescription!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botVerifierSettings(let flags, let icon, let company, let customDescription): - return ("botVerifierSettings", [("flags", flags as Any), ("icon", icon as Any), ("company", company as Any), ("customDescription", customDescription as Any)]) - } - } - + public class Cons_botVerifierSettings { + public var flags: Int32 + public var icon: Int64 + public var company: String + public var customDescription: String? + public init(flags: Int32, icon: Int64, company: String, customDescription: String?) { + self.flags = flags + self.icon = icon + self.company = company + self.customDescription = customDescription + } + } + case botVerifierSettings(Cons_botVerifierSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botVerifierSettings(let _data): + if boxed { + buffer.appendInt32(-1328716265) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.icon, buffer: buffer, boxed: false) + serializeString(_data.company, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.customDescription!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botVerifierSettings(let _data): + return ("botVerifierSettings", [("flags", _data.flags as Any), ("icon", _data.icon as Any), ("company", _data.company as Any), ("customDescription", _data.customDescription as Any)]) + } + } + public static func parse_botVerifierSettings(_ reader: BufferReader) -> BotVerifierSettings? { var _1: Int32? _1 = reader.readInt32() @@ -957,46 +1332,59 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.BotVerifierSettings.botVerifierSettings(flags: _1!, icon: _2!, company: _3!, customDescription: _4) + return Api.BotVerifierSettings.botVerifierSettings(Cons_botVerifierSettings(flags: _1!, icon: _2!, company: _3!, customDescription: _4)) } else { return nil } } - } } public extension Api { enum BusinessAwayMessage: TypeConstructorDescription { - case businessAwayMessage(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.BusinessRecipients) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessAwayMessage(let flags, let shortcutId, let schedule, let recipients): - if boxed { - buffer.appendInt32(-283809188) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - schedule.serialize(buffer, true) - recipients.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessAwayMessage(let flags, let shortcutId, let schedule, let recipients): - return ("businessAwayMessage", [("flags", flags as Any), ("shortcutId", shortcutId as Any), ("schedule", schedule as Any), ("recipients", recipients as Any)]) - } - } - + public class Cons_businessAwayMessage { + public var flags: Int32 + public var shortcutId: Int32 + public var schedule: Api.BusinessAwayMessageSchedule + public var recipients: Api.BusinessRecipients + public init(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.BusinessRecipients) { + self.flags = flags + self.shortcutId = shortcutId + self.schedule = schedule + self.recipients = recipients + } + } + case businessAwayMessage(Cons_businessAwayMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessAwayMessage(let _data): + if boxed { + buffer.appendInt32(-283809188) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + _data.schedule.serialize(buffer, true) + _data.recipients.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessAwayMessage(let _data): + return ("businessAwayMessage", [("flags", _data.flags as Any), ("shortcutId", _data.shortcutId as Any), ("schedule", _data.schedule as Any), ("recipients", _data.recipients as Any)]) + } + } + public static func parse_businessAwayMessage(_ reader: BufferReader) -> BusinessAwayMessage? { var _1: Int32? _1 = reader.readInt32() @@ -1015,56 +1403,61 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.BusinessAwayMessage.businessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!) + return Api.BusinessAwayMessage.businessAwayMessage(Cons_businessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!)) } else { return nil } } - } } public extension Api { enum BusinessAwayMessageSchedule: TypeConstructorDescription { + public class Cons_businessAwayMessageScheduleCustom { + public var startDate: Int32 + public var endDate: Int32 + public init(startDate: Int32, endDate: Int32) { + self.startDate = startDate + self.endDate = endDate + } + } case businessAwayMessageScheduleAlways - case businessAwayMessageScheduleCustom(startDate: Int32, endDate: Int32) + case businessAwayMessageScheduleCustom(Cons_businessAwayMessageScheduleCustom) case businessAwayMessageScheduleOutsideWorkHours - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessAwayMessageScheduleAlways: - if boxed { - buffer.appendInt32(-910564679) - } - - break - case .businessAwayMessageScheduleCustom(let startDate, let endDate): - if boxed { - buffer.appendInt32(-867328308) - } - serializeInt32(startDate, buffer: buffer, boxed: false) - serializeInt32(endDate, buffer: buffer, boxed: false) - break - case .businessAwayMessageScheduleOutsideWorkHours: - if boxed { - buffer.appendInt32(-1007487743) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessAwayMessageScheduleAlways: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessAwayMessageScheduleAlways: + if boxed { + buffer.appendInt32(-910564679) + } + break + case .businessAwayMessageScheduleCustom(let _data): + if boxed { + buffer.appendInt32(-867328308) + } + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + serializeInt32(_data.endDate, buffer: buffer, boxed: false) + break + case .businessAwayMessageScheduleOutsideWorkHours: + if boxed { + buffer.appendInt32(-1007487743) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessAwayMessageScheduleAlways: return ("businessAwayMessageScheduleAlways", []) - case .businessAwayMessageScheduleCustom(let startDate, let endDate): - return ("businessAwayMessageScheduleCustom", [("startDate", startDate as Any), ("endDate", endDate as Any)]) - case .businessAwayMessageScheduleOutsideWorkHours: + case .businessAwayMessageScheduleCustom(let _data): + return ("businessAwayMessageScheduleCustom", [("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any)]) + case .businessAwayMessageScheduleOutsideWorkHours: return ("businessAwayMessageScheduleOutsideWorkHours", []) - } - } - + } + } + public static func parse_businessAwayMessageScheduleAlways(_ reader: BufferReader) -> BusinessAwayMessageSchedule? { return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleAlways } @@ -1076,7 +1469,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleCustom(startDate: _1!, endDate: _2!) + return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleCustom(Cons_businessAwayMessageScheduleCustom(startDate: _1!, endDate: _2!)) } else { return nil @@ -1085,132 +1478,173 @@ public extension Api { public static func parse_businessAwayMessageScheduleOutsideWorkHours(_ reader: BufferReader) -> BusinessAwayMessageSchedule? { return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleOutsideWorkHours } - } } public extension Api { enum BusinessBotRecipients: TypeConstructorDescription { - case businessBotRecipients(flags: Int32, users: [Int64]?, excludeUsers: [Int64]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessBotRecipients(let flags, let users, let excludeUsers): - if boxed { - buffer.appendInt32(-1198722189) + public class Cons_businessBotRecipients { + public var flags: Int32 + public var users: [Int64]? + public var excludeUsers: [Int64]? + public init(flags: Int32, users: [Int64]?, excludeUsers: [Int64]?) { + self.flags = flags + self.users = users + self.excludeUsers = excludeUsers + } + } + case businessBotRecipients(Cons_businessBotRecipients) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessBotRecipients(let _data): + if boxed { + buffer.appendInt32(-1198722189) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users!.count)) + for item in _data.users! { + serializeInt64(item, buffer: buffer, boxed: false) } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users!.count)) - for item in users! { + } + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.excludeUsers!.count)) + for item in _data.excludeUsers! { serializeInt64(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(excludeUsers!.count)) - for item in excludeUsers! { - serializeInt64(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessBotRecipients(let flags, let users, let excludeUsers): - return ("businessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessBotRecipients(let _data): + return ("businessBotRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any), ("excludeUsers", _data.excludeUsers as Any)]) + } + } + public static func parse_businessBotRecipients(_ reader: BufferReader) -> BusinessBotRecipients? { var _1: Int32? _1 = reader.readInt32() var _2: [Int64]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } var _3: [Int64]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.BusinessBotRecipients.businessBotRecipients(flags: _1!, users: _2, excludeUsers: _3) + return Api.BusinessBotRecipients.businessBotRecipients(Cons_businessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)) } else { return nil } } - } } public extension Api { enum BusinessBotRights: TypeConstructorDescription { - case businessBotRights(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessBotRights(let flags): - if boxed { - buffer.appendInt32(-1604170505) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessBotRights(let flags): - return ("businessBotRights", [("flags", flags as Any)]) - } - } - + public class Cons_businessBotRights { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case businessBotRights(Cons_businessBotRights) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessBotRights(let _data): + if boxed { + buffer.appendInt32(-1604170505) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessBotRights(let _data): + return ("businessBotRights", [("flags", _data.flags as Any)]) + } + } + public static func parse_businessBotRights(_ reader: BufferReader) -> BusinessBotRights? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.BusinessBotRights.businessBotRights(flags: _1!) + return Api.BusinessBotRights.businessBotRights(Cons_businessBotRights(flags: _1!)) } else { return nil } } - } } public extension Api { enum BusinessChatLink: TypeConstructorDescription { - case businessChatLink(flags: Int32, link: String, message: String, entities: [Api.MessageEntity]?, title: String?, views: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessChatLink(let flags, let link, let message, let entities, let title, let views): - if boxed { - buffer.appendInt32(-1263638929) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(link, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_businessChatLink { + public var flags: Int32 + public var link: String + public var message: String + public var entities: [Api.MessageEntity]? + public var title: String? + public var views: Int32 + public init(flags: Int32, link: String, message: String, entities: [Api.MessageEntity]?, title: String?, views: Int32) { + self.flags = flags + self.link = link + self.message = message + self.entities = entities + self.title = title + self.views = views + } + } + case businessChatLink(Cons_businessChatLink) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessChatLink(let _data): + if boxed { + buffer.appendInt32(-1263638929) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.link, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - serializeInt32(views, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessChatLink(let flags, let link, let message, let entities, let title, let views): - return ("businessChatLink", [("flags", flags as Any), ("link", link as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any), ("views", views as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + serializeInt32(_data.views, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessChatLink(let _data): + return ("businessChatLink", [("flags", _data.flags as Any), ("link", _data.link as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("title", _data.title as Any), ("views", _data.views as Any)]) + } + } + public static func parse_businessChatLink(_ reader: BufferReader) -> BusinessChatLink? { var _1: Int32? _1 = reader.readInt32() @@ -1219,11 +1653,15 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: Int32? _6 = reader.readInt32() let _c1 = _1 != nil @@ -1233,12 +1671,11 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.BusinessChatLink.businessChatLink(flags: _1!, link: _2!, message: _3!, entities: _4, title: _5, views: _6!) + return Api.BusinessChatLink.businessChatLink(Cons_businessChatLink(flags: _1!, link: _2!, message: _3!, entities: _4, title: _5, views: _6!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api20.swift b/submodules/TelegramApi/Sources/Api20.swift index 27e9c3383d..ef367505a0 100644 --- a/submodules/TelegramApi/Sources/Api20.swift +++ b/submodules/TelegramApi/Sources/Api20.swift @@ -1,61 +1,63 @@ public extension Api { enum PhoneCallDiscardReason: TypeConstructorDescription { + public class Cons_phoneCallDiscardReasonMigrateConferenceCall { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } case phoneCallDiscardReasonBusy case phoneCallDiscardReasonDisconnect case phoneCallDiscardReasonHangup - case phoneCallDiscardReasonMigrateConferenceCall(slug: String) + case phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall) case phoneCallDiscardReasonMissed - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneCallDiscardReasonBusy: - if boxed { - buffer.appendInt32(-84416311) - } - - break - case .phoneCallDiscardReasonDisconnect: - if boxed { - buffer.appendInt32(-527056480) - } - - break - case .phoneCallDiscardReasonHangup: - if boxed { - buffer.appendInt32(1471006352) - } - - break - case .phoneCallDiscardReasonMigrateConferenceCall(let slug): - if boxed { - buffer.appendInt32(-1615072777) - } - serializeString(slug, buffer: buffer, boxed: false) - break - case .phoneCallDiscardReasonMissed: - if boxed { - buffer.appendInt32(-2048646399) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneCallDiscardReasonBusy: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .phoneCallDiscardReasonBusy: + if boxed { + buffer.appendInt32(-84416311) + } + break + case .phoneCallDiscardReasonDisconnect: + if boxed { + buffer.appendInt32(-527056480) + } + break + case .phoneCallDiscardReasonHangup: + if boxed { + buffer.appendInt32(1471006352) + } + break + case .phoneCallDiscardReasonMigrateConferenceCall(let _data): + if boxed { + buffer.appendInt32(-1615072777) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + case .phoneCallDiscardReasonMissed: + if boxed { + buffer.appendInt32(-2048646399) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .phoneCallDiscardReasonBusy: return ("phoneCallDiscardReasonBusy", []) - case .phoneCallDiscardReasonDisconnect: + case .phoneCallDiscardReasonDisconnect: return ("phoneCallDiscardReasonDisconnect", []) - case .phoneCallDiscardReasonHangup: + case .phoneCallDiscardReasonHangup: return ("phoneCallDiscardReasonHangup", []) - case .phoneCallDiscardReasonMigrateConferenceCall(let slug): - return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", slug as Any)]) - case .phoneCallDiscardReasonMissed: + case .phoneCallDiscardReasonMigrateConferenceCall(let _data): + return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", _data.slug as Any)]) + case .phoneCallDiscardReasonMissed: return ("phoneCallDiscardReasonMissed", []) - } - } - + } + } + public static func parse_phoneCallDiscardReasonBusy(_ reader: BufferReader) -> PhoneCallDiscardReason? { return Api.PhoneCallDiscardReason.phoneCallDiscardReasonBusy } @@ -70,7 +72,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMigrateConferenceCall(slug: _1!) + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall(slug: _1!)) } else { return nil @@ -79,38 +81,49 @@ public extension Api { public static func parse_phoneCallDiscardReasonMissed(_ reader: BufferReader) -> PhoneCallDiscardReason? { return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMissed } - } } public extension Api { enum PhoneCallProtocol: TypeConstructorDescription { - case phoneCallProtocol(flags: Int32, minLayer: Int32, maxLayer: Int32, libraryVersions: [String]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneCallProtocol(let flags, let minLayer, let maxLayer, let libraryVersions): - if boxed { - buffer.appendInt32(-58224696) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(minLayer, buffer: buffer, boxed: false) - serializeInt32(maxLayer, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(libraryVersions.count)) - for item in libraryVersions { - serializeString(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneCallProtocol(let flags, let minLayer, let maxLayer, let libraryVersions): - return ("phoneCallProtocol", [("flags", flags as Any), ("minLayer", minLayer as Any), ("maxLayer", maxLayer as Any), ("libraryVersions", libraryVersions as Any)]) - } - } - + public class Cons_phoneCallProtocol { + public var flags: Int32 + public var minLayer: Int32 + public var maxLayer: Int32 + public var libraryVersions: [String] + public init(flags: Int32, minLayer: Int32, maxLayer: Int32, libraryVersions: [String]) { + self.flags = flags + self.minLayer = minLayer + self.maxLayer = maxLayer + self.libraryVersions = libraryVersions + } + } + case phoneCallProtocol(Cons_phoneCallProtocol) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .phoneCallProtocol(let _data): + if boxed { + buffer.appendInt32(-58224696) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.minLayer, buffer: buffer, boxed: false) + serializeInt32(_data.maxLayer, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.libraryVersions.count)) + for item in _data.libraryVersions { + serializeString(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .phoneCallProtocol(let _data): + return ("phoneCallProtocol", [("flags", _data.flags as Any), ("minLayer", _data.minLayer as Any), ("maxLayer", _data.maxLayer as Any), ("libraryVersions", _data.libraryVersions as Any)]) + } + } + public static func parse_phoneCallProtocol(_ reader: BufferReader) -> PhoneCallProtocol? { var _1: Int32? _1 = reader.readInt32() @@ -127,57 +140,90 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhoneCallProtocol.phoneCallProtocol(flags: _1!, minLayer: _2!, maxLayer: _3!, libraryVersions: _4!) + return Api.PhoneCallProtocol.phoneCallProtocol(Cons_phoneCallProtocol(flags: _1!, minLayer: _2!, maxLayer: _3!, libraryVersions: _4!)) } else { return nil } } - } } public extension Api { enum PhoneConnection: TypeConstructorDescription { - case phoneConnection(flags: Int32, id: Int64, ip: String, ipv6: String, port: Int32, peerTag: Buffer) - case phoneConnectionWebrtc(flags: Int32, id: Int64, ip: String, ipv6: String, port: Int32, username: String, password: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneConnection(let flags, let id, let ip, let ipv6, let port, let peerTag): - if boxed { - buffer.appendInt32(-1665063993) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(ip, buffer: buffer, boxed: false) - serializeString(ipv6, buffer: buffer, boxed: false) - serializeInt32(port, buffer: buffer, boxed: false) - serializeBytes(peerTag, buffer: buffer, boxed: false) - break - case .phoneConnectionWebrtc(let flags, let id, let ip, let ipv6, let port, let username, let password): - if boxed { - buffer.appendInt32(1667228533) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(ip, buffer: buffer, boxed: false) - serializeString(ipv6, buffer: buffer, boxed: false) - serializeInt32(port, buffer: buffer, boxed: false) - serializeString(username, buffer: buffer, boxed: false) - serializeString(password, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneConnection(let flags, let id, let ip, let ipv6, let port, let peerTag): - return ("phoneConnection", [("flags", flags as Any), ("id", id as Any), ("ip", ip as Any), ("ipv6", ipv6 as Any), ("port", port as Any), ("peerTag", peerTag as Any)]) - case .phoneConnectionWebrtc(let flags, let id, let ip, let ipv6, let port, let username, let password): - return ("phoneConnectionWebrtc", [("flags", flags as Any), ("id", id as Any), ("ip", ip as Any), ("ipv6", ipv6 as Any), ("port", port as Any), ("username", username as Any), ("password", password as Any)]) - } - } - + public class Cons_phoneConnection { + public var flags: Int32 + public var id: Int64 + public var ip: String + public var ipv6: String + public var port: Int32 + public var peerTag: Buffer + public init(flags: Int32, id: Int64, ip: String, ipv6: String, port: Int32, peerTag: Buffer) { + self.flags = flags + self.id = id + self.ip = ip + self.ipv6 = ipv6 + self.port = port + self.peerTag = peerTag + } + } + public class Cons_phoneConnectionWebrtc { + public var flags: Int32 + public var id: Int64 + public var ip: String + public var ipv6: String + public var port: Int32 + public var username: String + public var password: String + public init(flags: Int32, id: Int64, ip: String, ipv6: String, port: Int32, username: String, password: String) { + self.flags = flags + self.id = id + self.ip = ip + self.ipv6 = ipv6 + self.port = port + self.username = username + self.password = password + } + } + case phoneConnection(Cons_phoneConnection) + case phoneConnectionWebrtc(Cons_phoneConnectionWebrtc) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .phoneConnection(let _data): + if boxed { + buffer.appendInt32(-1665063993) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.ip, buffer: buffer, boxed: false) + serializeString(_data.ipv6, buffer: buffer, boxed: false) + serializeInt32(_data.port, buffer: buffer, boxed: false) + serializeBytes(_data.peerTag, buffer: buffer, boxed: false) + break + case .phoneConnectionWebrtc(let _data): + if boxed { + buffer.appendInt32(1667228533) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.ip, buffer: buffer, boxed: false) + serializeString(_data.ipv6, buffer: buffer, boxed: false) + serializeInt32(_data.port, buffer: buffer, boxed: false) + serializeString(_data.username, buffer: buffer, boxed: false) + serializeString(_data.password, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .phoneConnection(let _data): + return ("phoneConnection", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ip", _data.ip as Any), ("ipv6", _data.ipv6 as Any), ("port", _data.port as Any), ("peerTag", _data.peerTag as Any)]) + case .phoneConnectionWebrtc(let _data): + return ("phoneConnectionWebrtc", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ip", _data.ip as Any), ("ipv6", _data.ipv6 as Any), ("port", _data.port as Any), ("username", _data.username as Any), ("password", _data.password as Any)]) + } + } + public static func parse_phoneConnection(_ reader: BufferReader) -> PhoneConnection? { var _1: Int32? _1 = reader.readInt32() @@ -198,7 +244,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.PhoneConnection.phoneConnection(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, peerTag: _6!) + return Api.PhoneConnection.phoneConnection(Cons_phoneConnection(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, peerTag: _6!)) } else { return nil @@ -227,61 +273,88 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PhoneConnection.phoneConnectionWebrtc(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, username: _6!, password: _7!) + return Api.PhoneConnection.phoneConnectionWebrtc(Cons_phoneConnectionWebrtc(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, username: _6!, password: _7!)) } else { return nil } } - } } public extension Api { enum Photo: TypeConstructorDescription { - case photo(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, sizes: [Api.PhotoSize], videoSizes: [Api.VideoSize]?, dcId: Int32) - case photoEmpty(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .photo(let flags, let id, let accessHash, let fileReference, let date, let sizes, let videoSizes, let dcId): - if boxed { - buffer.appendInt32(-82216347) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) + public class Cons_photo { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public var date: Int32 + public var sizes: [Api.PhotoSize] + public var videoSizes: [Api.VideoSize]? + public var dcId: Int32 + public init(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, sizes: [Api.PhotoSize], videoSizes: [Api.VideoSize]?, dcId: Int32) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + self.date = date + self.sizes = sizes + self.videoSizes = videoSizes + self.dcId = dcId + } + } + public class Cons_photoEmpty { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + case photo(Cons_photo) + case photoEmpty(Cons_photoEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .photo(let _data): + if boxed { + buffer.appendInt32(-82216347) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sizes.count)) + for item in _data.sizes { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sizes.count)) - for item in sizes { + buffer.appendInt32(Int32(_data.videoSizes!.count)) + for item in _data.videoSizes! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(videoSizes!.count)) - for item in videoSizes! { - item.serialize(buffer, true) - }} - serializeInt32(dcId, buffer: buffer, boxed: false) - break - case .photoEmpty(let id): - if boxed { - buffer.appendInt32(590459437) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .photo(let flags, let id, let accessHash, let fileReference, let date, let sizes, let videoSizes, let dcId): - return ("photo", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any), ("date", date as Any), ("sizes", sizes as Any), ("videoSizes", videoSizes as Any), ("dcId", dcId as Any)]) - case .photoEmpty(let id): - return ("photoEmpty", [("id", id as Any)]) - } - } - + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + break + case .photoEmpty(let _data): + if boxed { + buffer.appendInt32(590459437) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .photo(let _data): + return ("photo", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("date", _data.date as Any), ("sizes", _data.sizes as Any), ("videoSizes", _data.videoSizes as Any), ("dcId", _data.dcId as Any)]) + case .photoEmpty(let _data): + return ("photoEmpty", [("id", _data.id as Any)]) + } + } + public static func parse_photo(_ reader: BufferReader) -> Photo? { var _1: Int32? _1 = reader.readInt32() @@ -298,9 +371,11 @@ public extension Api { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) } var _7: [Api.VideoSize]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.VideoSize.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.VideoSize.self) + } + } var _8: Int32? _8 = reader.readInt32() let _c1 = _1 != nil @@ -312,7 +387,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Photo.photo(flags: _1!, id: _2!, accessHash: _3!, fileReference: _4!, date: _5!, sizes: _6!, videoSizes: _7, dcId: _8!) + return Api.Photo.photo(Cons_photo(flags: _1!, id: _2!, accessHash: _3!, fileReference: _4!, date: _5!, sizes: _6!, videoSizes: _7, dcId: _8!)) } else { return nil @@ -323,97 +398,154 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Photo.photoEmpty(id: _1!) + return Api.Photo.photoEmpty(Cons_photoEmpty(id: _1!)) } else { return nil } } - } } public extension Api { enum PhotoSize: TypeConstructorDescription { - case photoCachedSize(type: String, w: Int32, h: Int32, bytes: Buffer) - case photoPathSize(type: String, bytes: Buffer) - case photoSize(type: String, w: Int32, h: Int32, size: Int32) - case photoSizeEmpty(type: String) - case photoSizeProgressive(type: String, w: Int32, h: Int32, sizes: [Int32]) - case photoStrippedSize(type: String, bytes: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .photoCachedSize(let type, let w, let h, let bytes): - if boxed { - buffer.appendInt32(35527382) - } - serializeString(type, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - case .photoPathSize(let type, let bytes): - if boxed { - buffer.appendInt32(-668906175) - } - serializeString(type, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - case .photoSize(let type, let w, let h, let size): - if boxed { - buffer.appendInt32(1976012384) - } - serializeString(type, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - break - case .photoSizeEmpty(let type): - if boxed { - buffer.appendInt32(236446268) - } - serializeString(type, buffer: buffer, boxed: false) - break - case .photoSizeProgressive(let type, let w, let h, let sizes): - if boxed { - buffer.appendInt32(-96535659) - } - serializeString(type, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sizes.count)) - for item in sizes { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .photoStrippedSize(let type, let bytes): - if boxed { - buffer.appendInt32(-525288402) - } - serializeString(type, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .photoCachedSize(let type, let w, let h, let bytes): - return ("photoCachedSize", [("type", type as Any), ("w", w as Any), ("h", h as Any), ("bytes", bytes as Any)]) - case .photoPathSize(let type, let bytes): - return ("photoPathSize", [("type", type as Any), ("bytes", bytes as Any)]) - case .photoSize(let type, let w, let h, let size): - return ("photoSize", [("type", type as Any), ("w", w as Any), ("h", h as Any), ("size", size as Any)]) - case .photoSizeEmpty(let type): - return ("photoSizeEmpty", [("type", type as Any)]) - case .photoSizeProgressive(let type, let w, let h, let sizes): - return ("photoSizeProgressive", [("type", type as Any), ("w", w as Any), ("h", h as Any), ("sizes", sizes as Any)]) - case .photoStrippedSize(let type, let bytes): - return ("photoStrippedSize", [("type", type as Any), ("bytes", bytes as Any)]) - } - } - + public class Cons_photoCachedSize { + public var type: String + public var w: Int32 + public var h: Int32 + public var bytes: Buffer + public init(type: String, w: Int32, h: Int32, bytes: Buffer) { + self.type = type + self.w = w + self.h = h + self.bytes = bytes + } + } + public class Cons_photoPathSize { + public var type: String + public var bytes: Buffer + public init(type: String, bytes: Buffer) { + self.type = type + self.bytes = bytes + } + } + public class Cons_photoSize { + public var type: String + public var w: Int32 + public var h: Int32 + public var size: Int32 + public init(type: String, w: Int32, h: Int32, size: Int32) { + self.type = type + self.w = w + self.h = h + self.size = size + } + } + public class Cons_photoSizeEmpty { + public var type: String + public init(type: String) { + self.type = type + } + } + public class Cons_photoSizeProgressive { + public var type: String + public var w: Int32 + public var h: Int32 + public var sizes: [Int32] + public init(type: String, w: Int32, h: Int32, sizes: [Int32]) { + self.type = type + self.w = w + self.h = h + self.sizes = sizes + } + } + public class Cons_photoStrippedSize { + public var type: String + public var bytes: Buffer + public init(type: String, bytes: Buffer) { + self.type = type + self.bytes = bytes + } + } + case photoCachedSize(Cons_photoCachedSize) + case photoPathSize(Cons_photoPathSize) + case photoSize(Cons_photoSize) + case photoSizeEmpty(Cons_photoSizeEmpty) + case photoSizeProgressive(Cons_photoSizeProgressive) + case photoStrippedSize(Cons_photoStrippedSize) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .photoCachedSize(let _data): + if boxed { + buffer.appendInt32(35527382) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + case .photoPathSize(let _data): + if boxed { + buffer.appendInt32(-668906175) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + case .photoSize(let _data): + if boxed { + buffer.appendInt32(1976012384) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + serializeInt32(_data.size, buffer: buffer, boxed: false) + break + case .photoSizeEmpty(let _data): + if boxed { + buffer.appendInt32(236446268) + } + serializeString(_data.type, buffer: buffer, boxed: false) + break + case .photoSizeProgressive(let _data): + if boxed { + buffer.appendInt32(-96535659) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sizes.count)) + for item in _data.sizes { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .photoStrippedSize(let _data): + if boxed { + buffer.appendInt32(-525288402) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .photoCachedSize(let _data): + return ("photoCachedSize", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("bytes", _data.bytes as Any)]) + case .photoPathSize(let _data): + return ("photoPathSize", [("type", _data.type as Any), ("bytes", _data.bytes as Any)]) + case .photoSize(let _data): + return ("photoSize", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("size", _data.size as Any)]) + case .photoSizeEmpty(let _data): + return ("photoSizeEmpty", [("type", _data.type as Any)]) + case .photoSizeProgressive(let _data): + return ("photoSizeProgressive", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("sizes", _data.sizes as Any)]) + case .photoStrippedSize(let _data): + return ("photoStrippedSize", [("type", _data.type as Any), ("bytes", _data.bytes as Any)]) + } + } + public static func parse_photoCachedSize(_ reader: BufferReader) -> PhotoSize? { var _1: String? _1 = parseString(reader) @@ -428,7 +560,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoCachedSize(type: _1!, w: _2!, h: _3!, bytes: _4!) + return Api.PhotoSize.photoCachedSize(Cons_photoCachedSize(type: _1!, w: _2!, h: _3!, bytes: _4!)) } else { return nil @@ -442,7 +574,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PhotoSize.photoPathSize(type: _1!, bytes: _2!) + return Api.PhotoSize.photoPathSize(Cons_photoPathSize(type: _1!, bytes: _2!)) } else { return nil @@ -462,7 +594,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoSize(type: _1!, w: _2!, h: _3!, size: _4!) + return Api.PhotoSize.photoSize(Cons_photoSize(type: _1!, w: _2!, h: _3!, size: _4!)) } else { return nil @@ -473,7 +605,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.PhotoSize.photoSizeEmpty(type: _1!) + return Api.PhotoSize.photoSizeEmpty(Cons_photoSizeEmpty(type: _1!)) } else { return nil @@ -495,7 +627,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoSizeProgressive(type: _1!, w: _2!, h: _3!, sizes: _4!) + return Api.PhotoSize.photoSizeProgressive(Cons_photoSizeProgressive(type: _1!, w: _2!, h: _3!, sizes: _4!)) } else { return nil @@ -509,46 +641,65 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PhotoSize.photoStrippedSize(type: _1!, bytes: _2!) + return Api.PhotoSize.photoStrippedSize(Cons_photoStrippedSize(type: _1!, bytes: _2!)) } else { return nil } } - } } public extension Api { enum Poll: TypeConstructorDescription { - case poll(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .poll(let id, let flags, let question, let answers, let closePeriod, let closeDate): - if boxed { - buffer.appendInt32(1484026161) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(flags, buffer: buffer, boxed: false) - question.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(answers.count)) - for item in answers { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(closePeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(closeDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .poll(let id, let flags, let question, let answers, let closePeriod, let closeDate): - return ("poll", [("id", id as Any), ("flags", flags as Any), ("question", question as Any), ("answers", answers as Any), ("closePeriod", closePeriod as Any), ("closeDate", closeDate as Any)]) - } - } - + public class Cons_poll { + public var id: Int64 + public var flags: Int32 + public var question: Api.TextWithEntities + public var answers: [Api.PollAnswer] + public var closePeriod: Int32? + public var closeDate: Int32? + public init(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?) { + self.id = id + self.flags = flags + self.question = question + self.answers = answers + self.closePeriod = closePeriod + self.closeDate = closeDate + } + } + case poll(Cons_poll) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .poll(let _data): + if boxed { + buffer.appendInt32(1484026161) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.question.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.answers.count)) + for item in _data.answers { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.closePeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.closeDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .poll(let _data): + return ("poll", [("id", _data.id as Any), ("flags", _data.flags as Any), ("question", _data.question as Any), ("answers", _data.answers as Any), ("closePeriod", _data.closePeriod as Any), ("closeDate", _data.closeDate as Any)]) + } + } + public static func parse_poll(_ reader: BufferReader) -> Poll? { var _1: Int64? _1 = reader.readInt64() @@ -563,9 +714,13 @@ public extension Api { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswer.self) } var _5: Int32? - if Int(_2!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_2!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_2!) & Int(1 << 5) != 0 {_6 = reader.readInt32() } + if Int(_2!) & Int(1 << 5) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -573,38 +728,45 @@ public extension Api { let _c5 = (Int(_2!) & Int(1 << 4) == 0) || _5 != nil let _c6 = (Int(_2!) & Int(1 << 5) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Poll.poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6) + return Api.Poll.poll(Cons_poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6)) } else { return nil } } - } } public extension Api { enum PollAnswer: TypeConstructorDescription { - case pollAnswer(text: Api.TextWithEntities, option: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollAnswer(let text, let option): - if boxed { - buffer.appendInt32(-15277366) - } - text.serialize(buffer, true) - serializeBytes(option, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pollAnswer(let text, let option): - return ("pollAnswer", [("text", text as Any), ("option", option as Any)]) - } - } - + public class Cons_pollAnswer { + public var text: Api.TextWithEntities + public var option: Buffer + public init(text: Api.TextWithEntities, option: Buffer) { + self.text = text + self.option = option + } + } + case pollAnswer(Cons_pollAnswer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollAnswer(let _data): + if boxed { + buffer.appendInt32(-15277366) + } + _data.text.serialize(buffer, true) + serializeBytes(_data.option, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pollAnswer(let _data): + return ("pollAnswer", [("text", _data.text as Any), ("option", _data.option as Any)]) + } + } + public static func parse_pollAnswer(_ reader: BufferReader) -> PollAnswer? { var _1: Api.TextWithEntities? if let signature = reader.readInt32() { @@ -615,39 +777,48 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PollAnswer.pollAnswer(text: _1!, option: _2!) + return Api.PollAnswer.pollAnswer(Cons_pollAnswer(text: _1!, option: _2!)) } else { return nil } } - } } public extension Api { enum PollAnswerVoters: TypeConstructorDescription { - case pollAnswerVoters(flags: Int32, option: Buffer, voters: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollAnswerVoters(let flags, let option, let voters): - if boxed { - buffer.appendInt32(997055186) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - serializeInt32(voters, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pollAnswerVoters(let flags, let option, let voters): - return ("pollAnswerVoters", [("flags", flags as Any), ("option", option as Any), ("voters", voters as Any)]) - } - } - + public class Cons_pollAnswerVoters { + public var flags: Int32 + public var option: Buffer + public var voters: Int32 + public init(flags: Int32, option: Buffer, voters: Int32) { + self.flags = flags + self.option = option + self.voters = voters + } + } + case pollAnswerVoters(Cons_pollAnswerVoters) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollAnswerVoters(let _data): + if boxed { + buffer.appendInt32(997055186) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeBytes(_data.option, buffer: buffer, boxed: false) + serializeInt32(_data.voters, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pollAnswerVoters(let _data): + return ("pollAnswerVoters", [("flags", _data.flags as Any), ("option", _data.option as Any), ("voters", _data.voters as Any)]) + } + } + public static func parse_pollAnswerVoters(_ reader: BufferReader) -> PollAnswerVoters? { var _1: Int32? _1 = reader.readInt32() @@ -659,73 +830,108 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PollAnswerVoters.pollAnswerVoters(flags: _1!, option: _2!, voters: _3!) + return Api.PollAnswerVoters.pollAnswerVoters(Cons_pollAnswerVoters(flags: _1!, option: _2!, voters: _3!)) } else { return nil } } - } } public extension Api { enum PollResults: TypeConstructorDescription { - case pollResults(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollResults(let flags, let results, let totalVoters, let recentVoters, let solution, let solutionEntities): - if boxed { - buffer.appendInt32(2061444128) + public class Cons_pollResults { + public var flags: Int32 + public var results: [Api.PollAnswerVoters]? + public var totalVoters: Int32? + public var recentVoters: [Api.Peer]? + public var solution: String? + public var solutionEntities: [Api.MessageEntity]? + public init(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?) { + self.flags = flags + self.results = results + self.totalVoters = totalVoters + self.recentVoters = recentVoters + self.solution = solution + self.solutionEntities = solutionEntities + } + } + case pollResults(Cons_pollResults) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollResults(let _data): + if boxed { + buffer.appendInt32(2061444128) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.results!.count)) + for item in _data.results! { + item.serialize(buffer, true) } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(results!.count)) - for item in results! { + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.totalVoters!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentVoters!.count)) + for item in _data.recentVoters! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(totalVoters!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentVoters!.count)) - for item in recentVoters! { + } + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.solution!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.solutionEntities!.count)) + for item in _data.solutionEntities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeString(solution!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(solutionEntities!.count)) - for item in solutionEntities! { - item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .pollResults(let flags, let results, let totalVoters, let recentVoters, let solution, let solutionEntities): - return ("pollResults", [("flags", flags as Any), ("results", results as Any), ("totalVoters", totalVoters as Any), ("recentVoters", recentVoters as Any), ("solution", solution as Any), ("solutionEntities", solutionEntities as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .pollResults(let _data): + return ("pollResults", [("flags", _data.flags as Any), ("results", _data.results as Any), ("totalVoters", _data.totalVoters as Any), ("recentVoters", _data.recentVoters as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any)]) + } + } + public static func parse_pollResults(_ reader: BufferReader) -> PollResults? { var _1: Int32? _1 = reader.readInt32() var _2: [Api.PollAnswerVoters]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswerVoters.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswerVoters.self) + } + } var _3: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } var _4: [Api.Peer]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + } var _5: String? - if Int(_1!) & Int(1 << 4) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = parseString(reader) + } var _6: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil @@ -733,38 +939,45 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.PollResults.pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6) + return Api.PollResults.pollResults(Cons_pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6)) } else { return nil } } - } } public extension Api { enum PopularContact: TypeConstructorDescription { - case popularContact(clientId: Int64, importers: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .popularContact(let clientId, let importers): - if boxed { - buffer.appendInt32(1558266229) - } - serializeInt64(clientId, buffer: buffer, boxed: false) - serializeInt32(importers, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .popularContact(let clientId, let importers): - return ("popularContact", [("clientId", clientId as Any), ("importers", importers as Any)]) - } - } - + public class Cons_popularContact { + public var clientId: Int64 + public var importers: Int32 + public init(clientId: Int64, importers: Int32) { + self.clientId = clientId + self.importers = importers + } + } + case popularContact(Cons_popularContact) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .popularContact(let _data): + if boxed { + buffer.appendInt32(1558266229) + } + serializeInt64(_data.clientId, buffer: buffer, boxed: false) + serializeInt32(_data.importers, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .popularContact(let _data): + return ("popularContact", [("clientId", _data.clientId as Any), ("importers", _data.importers as Any)]) + } + } + public static func parse_popularContact(_ reader: BufferReader) -> PopularContact? { var _1: Int64? _1 = reader.readInt64() @@ -773,42 +986,57 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PopularContact.popularContact(clientId: _1!, importers: _2!) + return Api.PopularContact.popularContact(Cons_popularContact(clientId: _1!, importers: _2!)) } else { return nil } } - } } public extension Api { enum PostAddress: TypeConstructorDescription { - case postAddress(streetLine1: String, streetLine2: String, city: String, state: String, countryIso2: String, postCode: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .postAddress(let streetLine1, let streetLine2, let city, let state, let countryIso2, let postCode): - if boxed { - buffer.appendInt32(512535275) - } - serializeString(streetLine1, buffer: buffer, boxed: false) - serializeString(streetLine2, buffer: buffer, boxed: false) - serializeString(city, buffer: buffer, boxed: false) - serializeString(state, buffer: buffer, boxed: false) - serializeString(countryIso2, buffer: buffer, boxed: false) - serializeString(postCode, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .postAddress(let streetLine1, let streetLine2, let city, let state, let countryIso2, let postCode): - return ("postAddress", [("streetLine1", streetLine1 as Any), ("streetLine2", streetLine2 as Any), ("city", city as Any), ("state", state as Any), ("countryIso2", countryIso2 as Any), ("postCode", postCode as Any)]) - } - } - + public class Cons_postAddress { + public var streetLine1: String + public var streetLine2: String + public var city: String + public var state: String + public var countryIso2: String + public var postCode: String + public init(streetLine1: String, streetLine2: String, city: String, state: String, countryIso2: String, postCode: String) { + self.streetLine1 = streetLine1 + self.streetLine2 = streetLine2 + self.city = city + self.state = state + self.countryIso2 = countryIso2 + self.postCode = postCode + } + } + case postAddress(Cons_postAddress) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .postAddress(let _data): + if boxed { + buffer.appendInt32(512535275) + } + serializeString(_data.streetLine1, buffer: buffer, boxed: false) + serializeString(_data.streetLine2, buffer: buffer, boxed: false) + serializeString(_data.city, buffer: buffer, boxed: false) + serializeString(_data.state, buffer: buffer, boxed: false) + serializeString(_data.countryIso2, buffer: buffer, boxed: false) + serializeString(_data.postCode, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .postAddress(let _data): + return ("postAddress", [("streetLine1", _data.streetLine1 as Any), ("streetLine2", _data.streetLine2 as Any), ("city", _data.city as Any), ("state", _data.state as Any), ("countryIso2", _data.countryIso2 as Any), ("postCode", _data.postCode as Any)]) + } + } + public static func parse_postAddress(_ reader: BufferReader) -> PostAddress? { var _1: String? _1 = parseString(reader) @@ -829,52 +1057,75 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.PostAddress.postAddress(streetLine1: _1!, streetLine2: _2!, city: _3!, state: _4!, countryIso2: _5!, postCode: _6!) + return Api.PostAddress.postAddress(Cons_postAddress(streetLine1: _1!, streetLine2: _2!, city: _3!, state: _4!, countryIso2: _5!, postCode: _6!)) } else { return nil } } - } } public extension Api { enum PostInteractionCounters: TypeConstructorDescription { - case postInteractionCountersMessage(msgId: Int32, views: Int32, forwards: Int32, reactions: Int32) - case postInteractionCountersStory(storyId: Int32, views: Int32, forwards: Int32, reactions: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .postInteractionCountersMessage(let msgId, let views, let forwards, let reactions): - if boxed { - buffer.appendInt32(-419066241) - } - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(views, buffer: buffer, boxed: false) - serializeInt32(forwards, buffer: buffer, boxed: false) - serializeInt32(reactions, buffer: buffer, boxed: false) - break - case .postInteractionCountersStory(let storyId, let views, let forwards, let reactions): - if boxed { - buffer.appendInt32(-1974989273) - } - serializeInt32(storyId, buffer: buffer, boxed: false) - serializeInt32(views, buffer: buffer, boxed: false) - serializeInt32(forwards, buffer: buffer, boxed: false) - serializeInt32(reactions, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .postInteractionCountersMessage(let msgId, let views, let forwards, let reactions): - return ("postInteractionCountersMessage", [("msgId", msgId as Any), ("views", views as Any), ("forwards", forwards as Any), ("reactions", reactions as Any)]) - case .postInteractionCountersStory(let storyId, let views, let forwards, let reactions): - return ("postInteractionCountersStory", [("storyId", storyId as Any), ("views", views as Any), ("forwards", forwards as Any), ("reactions", reactions as Any)]) - } - } - + public class Cons_postInteractionCountersMessage { + public var msgId: Int32 + public var views: Int32 + public var forwards: Int32 + public var reactions: Int32 + public init(msgId: Int32, views: Int32, forwards: Int32, reactions: Int32) { + self.msgId = msgId + self.views = views + self.forwards = forwards + self.reactions = reactions + } + } + public class Cons_postInteractionCountersStory { + public var storyId: Int32 + public var views: Int32 + public var forwards: Int32 + public var reactions: Int32 + public init(storyId: Int32, views: Int32, forwards: Int32, reactions: Int32) { + self.storyId = storyId + self.views = views + self.forwards = forwards + self.reactions = reactions + } + } + case postInteractionCountersMessage(Cons_postInteractionCountersMessage) + case postInteractionCountersStory(Cons_postInteractionCountersStory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .postInteractionCountersMessage(let _data): + if boxed { + buffer.appendInt32(-419066241) + } + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt32(_data.views, buffer: buffer, boxed: false) + serializeInt32(_data.forwards, buffer: buffer, boxed: false) + serializeInt32(_data.reactions, buffer: buffer, boxed: false) + break + case .postInteractionCountersStory(let _data): + if boxed { + buffer.appendInt32(-1974989273) + } + serializeInt32(_data.storyId, buffer: buffer, boxed: false) + serializeInt32(_data.views, buffer: buffer, boxed: false) + serializeInt32(_data.forwards, buffer: buffer, boxed: false) + serializeInt32(_data.reactions, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .postInteractionCountersMessage(let _data): + return ("postInteractionCountersMessage", [("msgId", _data.msgId as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("reactions", _data.reactions as Any)]) + case .postInteractionCountersStory(let _data): + return ("postInteractionCountersStory", [("storyId", _data.storyId as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("reactions", _data.reactions as Any)]) + } + } + public static func parse_postInteractionCountersMessage(_ reader: BufferReader) -> PostInteractionCounters? { var _1: Int32? _1 = reader.readInt32() @@ -889,7 +1140,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PostInteractionCounters.postInteractionCountersMessage(msgId: _1!, views: _2!, forwards: _3!, reactions: _4!) + return Api.PostInteractionCounters.postInteractionCountersMessage(Cons_postInteractionCountersMessage(msgId: _1!, views: _2!, forwards: _3!, reactions: _4!)) } else { return nil @@ -909,43 +1160,64 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PostInteractionCounters.postInteractionCountersStory(storyId: _1!, views: _2!, forwards: _3!, reactions: _4!) + return Api.PostInteractionCounters.postInteractionCountersStory(Cons_postInteractionCountersStory(storyId: _1!, views: _2!, forwards: _3!, reactions: _4!)) } else { return nil } } - } } public extension Api { enum PremiumGiftCodeOption: TypeConstructorDescription { - case premiumGiftCodeOption(flags: Int32, users: Int32, months: Int32, storeProduct: String?, storeQuantity: Int32?, currency: String, amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .premiumGiftCodeOption(let flags, let users, let months, let storeProduct, let storeQuantity, let currency, let amount): - if boxed { - buffer.appendInt32(629052971) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(users, buffer: buffer, boxed: false) - serializeInt32(months, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(storeProduct!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(storeQuantity!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .premiumGiftCodeOption(let flags, let users, let months, let storeProduct, let storeQuantity, let currency, let amount): - return ("premiumGiftCodeOption", [("flags", flags as Any), ("users", users as Any), ("months", months as Any), ("storeProduct", storeProduct as Any), ("storeQuantity", storeQuantity as Any), ("currency", currency as Any), ("amount", amount as Any)]) - } - } - + public class Cons_premiumGiftCodeOption { + public var flags: Int32 + public var users: Int32 + public var months: Int32 + public var storeProduct: String? + public var storeQuantity: Int32? + public var currency: String + public var amount: Int64 + public init(flags: Int32, users: Int32, months: Int32, storeProduct: String?, storeQuantity: Int32?, currency: String, amount: Int64) { + self.flags = flags + self.users = users + self.months = months + self.storeProduct = storeProduct + self.storeQuantity = storeQuantity + self.currency = currency + self.amount = amount + } + } + case premiumGiftCodeOption(Cons_premiumGiftCodeOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .premiumGiftCodeOption(let _data): + if boxed { + buffer.appendInt32(629052971) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.users, buffer: buffer, boxed: false) + serializeInt32(_data.months, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.storeProduct!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.storeQuantity!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .premiumGiftCodeOption(let _data): + return ("premiumGiftCodeOption", [("flags", _data.flags as Any), ("users", _data.users as Any), ("months", _data.months as Any), ("storeProduct", _data.storeProduct as Any), ("storeQuantity", _data.storeQuantity as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + } + } + public static func parse_premiumGiftCodeOption(_ reader: BufferReader) -> PremiumGiftCodeOption? { var _1: Int32? _1 = reader.readInt32() @@ -954,9 +1226,13 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } var _6: String? _6 = parseString(reader) var _7: Int64? @@ -969,48 +1245,71 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PremiumGiftCodeOption.premiumGiftCodeOption(flags: _1!, users: _2!, months: _3!, storeProduct: _4, storeQuantity: _5, currency: _6!, amount: _7!) + return Api.PremiumGiftCodeOption.premiumGiftCodeOption(Cons_premiumGiftCodeOption(flags: _1!, users: _2!, months: _3!, storeProduct: _4, storeQuantity: _5, currency: _6!, amount: _7!)) } else { return nil } } - } } public extension Api { enum PremiumSubscriptionOption: TypeConstructorDescription { - case premiumSubscriptionOption(flags: Int32, transaction: String?, months: Int32, currency: String, amount: Int64, botUrl: String, storeProduct: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .premiumSubscriptionOption(let flags, let transaction, let months, let currency, let amount, let botUrl, let storeProduct): - if boxed { - buffer.appendInt32(1596792306) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(transaction!, buffer: buffer, boxed: false)} - serializeInt32(months, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeString(botUrl, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(storeProduct!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .premiumSubscriptionOption(let flags, let transaction, let months, let currency, let amount, let botUrl, let storeProduct): - return ("premiumSubscriptionOption", [("flags", flags as Any), ("transaction", transaction as Any), ("months", months as Any), ("currency", currency as Any), ("amount", amount as Any), ("botUrl", botUrl as Any), ("storeProduct", storeProduct as Any)]) - } - } - + public class Cons_premiumSubscriptionOption { + public var flags: Int32 + public var transaction: String? + public var months: Int32 + public var currency: String + public var amount: Int64 + public var botUrl: String + public var storeProduct: String? + public init(flags: Int32, transaction: String?, months: Int32, currency: String, amount: Int64, botUrl: String, storeProduct: String?) { + self.flags = flags + self.transaction = transaction + self.months = months + self.currency = currency + self.amount = amount + self.botUrl = botUrl + self.storeProduct = storeProduct + } + } + case premiumSubscriptionOption(Cons_premiumSubscriptionOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .premiumSubscriptionOption(let _data): + if boxed { + buffer.appendInt32(1596792306) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.transaction!, buffer: buffer, boxed: false) + } + serializeInt32(_data.months, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeString(_data.botUrl, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.storeProduct!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .premiumSubscriptionOption(let _data): + return ("premiumSubscriptionOption", [("flags", _data.flags as Any), ("transaction", _data.transaction as Any), ("months", _data.months as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("botUrl", _data.botUrl as Any), ("storeProduct", _data.storeProduct as Any)]) + } + } + public static func parse_premiumSubscriptionOption(_ reader: BufferReader) -> PremiumSubscriptionOption? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 3) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _2 = parseString(reader) + } var _3: Int32? _3 = reader.readInt32() var _4: String? @@ -1020,7 +1319,9 @@ public extension Api { var _6: String? _6 = parseString(reader) var _7: String? - if Int(_1!) & Int(1 << 0) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil @@ -1029,53 +1330,78 @@ public extension Api { let _c6 = _6 != nil let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PremiumSubscriptionOption.premiumSubscriptionOption(flags: _1!, transaction: _2, months: _3!, currency: _4!, amount: _5!, botUrl: _6!, storeProduct: _7) + return Api.PremiumSubscriptionOption.premiumSubscriptionOption(Cons_premiumSubscriptionOption(flags: _1!, transaction: _2, months: _3!, currency: _4!, amount: _5!, botUrl: _6!, storeProduct: _7)) } else { return nil } } - } } public extension Api { enum PrepaidGiveaway: TypeConstructorDescription { - case prepaidGiveaway(id: Int64, months: Int32, quantity: Int32, date: Int32) - case prepaidStarsGiveaway(id: Int64, stars: Int64, quantity: Int32, boosts: Int32, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .prepaidGiveaway(let id, let months, let quantity, let date): - if boxed { - buffer.appendInt32(-1303143084) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(months, buffer: buffer, boxed: false) - serializeInt32(quantity, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .prepaidStarsGiveaway(let id, let stars, let quantity, let boosts, let date): - if boxed { - buffer.appendInt32(-1700956192) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - serializeInt32(quantity, buffer: buffer, boxed: false) - serializeInt32(boosts, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .prepaidGiveaway(let id, let months, let quantity, let date): - return ("prepaidGiveaway", [("id", id as Any), ("months", months as Any), ("quantity", quantity as Any), ("date", date as Any)]) - case .prepaidStarsGiveaway(let id, let stars, let quantity, let boosts, let date): - return ("prepaidStarsGiveaway", [("id", id as Any), ("stars", stars as Any), ("quantity", quantity as Any), ("boosts", boosts as Any), ("date", date as Any)]) - } - } - + public class Cons_prepaidGiveaway { + public var id: Int64 + public var months: Int32 + public var quantity: Int32 + public var date: Int32 + public init(id: Int64, months: Int32, quantity: Int32, date: Int32) { + self.id = id + self.months = months + self.quantity = quantity + self.date = date + } + } + public class Cons_prepaidStarsGiveaway { + public var id: Int64 + public var stars: Int64 + public var quantity: Int32 + public var boosts: Int32 + public var date: Int32 + public init(id: Int64, stars: Int64, quantity: Int32, boosts: Int32, date: Int32) { + self.id = id + self.stars = stars + self.quantity = quantity + self.boosts = boosts + self.date = date + } + } + case prepaidGiveaway(Cons_prepaidGiveaway) + case prepaidStarsGiveaway(Cons_prepaidStarsGiveaway) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .prepaidGiveaway(let _data): + if boxed { + buffer.appendInt32(-1303143084) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.months, buffer: buffer, boxed: false) + serializeInt32(_data.quantity, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .prepaidStarsGiveaway(let _data): + if boxed { + buffer.appendInt32(-1700956192) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + serializeInt32(_data.quantity, buffer: buffer, boxed: false) + serializeInt32(_data.boosts, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .prepaidGiveaway(let _data): + return ("prepaidGiveaway", [("id", _data.id as Any), ("months", _data.months as Any), ("quantity", _data.quantity as Any), ("date", _data.date as Any)]) + case .prepaidStarsGiveaway(let _data): + return ("prepaidStarsGiveaway", [("id", _data.id as Any), ("stars", _data.stars as Any), ("quantity", _data.quantity as Any), ("boosts", _data.boosts as Any), ("date", _data.date as Any)]) + } + } + public static func parse_prepaidGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { var _1: Int64? _1 = reader.readInt64() @@ -1090,7 +1416,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PrepaidGiveaway.prepaidGiveaway(id: _1!, months: _2!, quantity: _3!, date: _4!) + return Api.PrepaidGiveaway.prepaidGiveaway(Cons_prepaidGiveaway(id: _1!, months: _2!, quantity: _3!, date: _4!)) } else { return nil @@ -1113,13 +1439,12 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PrepaidGiveaway.prepaidStarsGiveaway(id: _1!, stars: _2!, quantity: _3!, boosts: _4!, date: _5!) + return Api.PrepaidGiveaway.prepaidStarsGiveaway(Cons_prepaidStarsGiveaway(id: _1!, stars: _2!, quantity: _3!, boosts: _4!, date: _5!)) } else { return nil } } - } } public extension Api { @@ -1138,129 +1463,115 @@ public extension Api { case privacyKeyStarGiftsAutoSave case privacyKeyStatusTimestamp case privacyKeyVoiceMessages - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .privacyKeyAbout: - if boxed { - buffer.appendInt32(-1534675103) - } - - break - case .privacyKeyAddedByPhone: - if boxed { - buffer.appendInt32(1124062251) - } - - break - case .privacyKeyBirthday: - if boxed { - buffer.appendInt32(536913176) - } - - break - case .privacyKeyChatInvite: - if boxed { - buffer.appendInt32(1343122938) - } - - break - case .privacyKeyForwards: - if boxed { - buffer.appendInt32(1777096355) - } - - break - case .privacyKeyNoPaidMessages: - if boxed { - buffer.appendInt32(399722706) - } - - break - case .privacyKeyPhoneCall: - if boxed { - buffer.appendInt32(1030105979) - } - - break - case .privacyKeyPhoneNumber: - if boxed { - buffer.appendInt32(-778378131) - } - - break - case .privacyKeyPhoneP2P: - if boxed { - buffer.appendInt32(961092808) - } - - break - case .privacyKeyProfilePhoto: - if boxed { - buffer.appendInt32(-1777000467) - } - - break - case .privacyKeySavedMusic: - if boxed { - buffer.appendInt32(-8759525) - } - - break - case .privacyKeyStarGiftsAutoSave: - if boxed { - buffer.appendInt32(749010424) - } - - break - case .privacyKeyStatusTimestamp: - if boxed { - buffer.appendInt32(-1137792208) - } - - break - case .privacyKeyVoiceMessages: - if boxed { - buffer.appendInt32(110621716) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .privacyKeyAbout: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .privacyKeyAbout: + if boxed { + buffer.appendInt32(-1534675103) + } + break + case .privacyKeyAddedByPhone: + if boxed { + buffer.appendInt32(1124062251) + } + break + case .privacyKeyBirthday: + if boxed { + buffer.appendInt32(536913176) + } + break + case .privacyKeyChatInvite: + if boxed { + buffer.appendInt32(1343122938) + } + break + case .privacyKeyForwards: + if boxed { + buffer.appendInt32(1777096355) + } + break + case .privacyKeyNoPaidMessages: + if boxed { + buffer.appendInt32(399722706) + } + break + case .privacyKeyPhoneCall: + if boxed { + buffer.appendInt32(1030105979) + } + break + case .privacyKeyPhoneNumber: + if boxed { + buffer.appendInt32(-778378131) + } + break + case .privacyKeyPhoneP2P: + if boxed { + buffer.appendInt32(961092808) + } + break + case .privacyKeyProfilePhoto: + if boxed { + buffer.appendInt32(-1777000467) + } + break + case .privacyKeySavedMusic: + if boxed { + buffer.appendInt32(-8759525) + } + break + case .privacyKeyStarGiftsAutoSave: + if boxed { + buffer.appendInt32(749010424) + } + break + case .privacyKeyStatusTimestamp: + if boxed { + buffer.appendInt32(-1137792208) + } + break + case .privacyKeyVoiceMessages: + if boxed { + buffer.appendInt32(110621716) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .privacyKeyAbout: return ("privacyKeyAbout", []) - case .privacyKeyAddedByPhone: + case .privacyKeyAddedByPhone: return ("privacyKeyAddedByPhone", []) - case .privacyKeyBirthday: + case .privacyKeyBirthday: return ("privacyKeyBirthday", []) - case .privacyKeyChatInvite: + case .privacyKeyChatInvite: return ("privacyKeyChatInvite", []) - case .privacyKeyForwards: + case .privacyKeyForwards: return ("privacyKeyForwards", []) - case .privacyKeyNoPaidMessages: + case .privacyKeyNoPaidMessages: return ("privacyKeyNoPaidMessages", []) - case .privacyKeyPhoneCall: + case .privacyKeyPhoneCall: return ("privacyKeyPhoneCall", []) - case .privacyKeyPhoneNumber: + case .privacyKeyPhoneNumber: return ("privacyKeyPhoneNumber", []) - case .privacyKeyPhoneP2P: + case .privacyKeyPhoneP2P: return ("privacyKeyPhoneP2P", []) - case .privacyKeyProfilePhoto: + case .privacyKeyProfilePhoto: return ("privacyKeyProfilePhoto", []) - case .privacyKeySavedMusic: + case .privacyKeySavedMusic: return ("privacyKeySavedMusic", []) - case .privacyKeyStarGiftsAutoSave: + case .privacyKeyStarGiftsAutoSave: return ("privacyKeyStarGiftsAutoSave", []) - case .privacyKeyStatusTimestamp: + case .privacyKeyStatusTimestamp: return ("privacyKeyStatusTimestamp", []) - case .privacyKeyVoiceMessages: + case .privacyKeyVoiceMessages: return ("privacyKeyVoiceMessages", []) - } - } - + } + } + public static func parse_privacyKeyAbout(_ reader: BufferReader) -> PrivacyKey? { return Api.PrivacyKey.privacyKeyAbout } @@ -1303,6 +1614,5 @@ public extension Api { public static func parse_privacyKeyVoiceMessages(_ reader: BufferReader) -> PrivacyKey? { return Api.PrivacyKey.privacyKeyVoiceMessages } - } } diff --git a/submodules/TelegramApi/Sources/Api21.swift b/submodules/TelegramApi/Sources/Api21.swift index 9d4e90606d..910a781ef4 100644 --- a/submodules/TelegramApi/Sources/Api21.swift +++ b/submodules/TelegramApi/Sources/Api21.swift @@ -1,140 +1,156 @@ public extension Api { enum PrivacyRule: TypeConstructorDescription { + public class Cons_privacyValueAllowChatParticipants { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + } + public class Cons_privacyValueAllowUsers { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + } + public class Cons_privacyValueDisallowChatParticipants { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + } + public class Cons_privacyValueDisallowUsers { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + } case privacyValueAllowAll case privacyValueAllowBots - case privacyValueAllowChatParticipants(chats: [Int64]) + case privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants) case privacyValueAllowCloseFriends case privacyValueAllowContacts case privacyValueAllowPremium - case privacyValueAllowUsers(users: [Int64]) + case privacyValueAllowUsers(Cons_privacyValueAllowUsers) case privacyValueDisallowAll case privacyValueDisallowBots - case privacyValueDisallowChatParticipants(chats: [Int64]) + case privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants) case privacyValueDisallowContacts - case privacyValueDisallowUsers(users: [Int64]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .privacyValueAllowAll: - if boxed { - buffer.appendInt32(1698855810) - } - - break - case .privacyValueAllowBots: - if boxed { - buffer.appendInt32(558242653) - } - - break - case .privacyValueAllowChatParticipants(let chats): - if boxed { - buffer.appendInt32(1796427406) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .privacyValueAllowCloseFriends: - if boxed { - buffer.appendInt32(-135735141) - } - - break - case .privacyValueAllowContacts: - if boxed { - buffer.appendInt32(-123988) - } - - break - case .privacyValueAllowPremium: - if boxed { - buffer.appendInt32(-320241333) - } - - break - case .privacyValueAllowUsers(let users): - if boxed { - buffer.appendInt32(-1198497870) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .privacyValueDisallowAll: - if boxed { - buffer.appendInt32(-1955338397) - } - - break - case .privacyValueDisallowBots: - if boxed { - buffer.appendInt32(-156895185) - } - - break - case .privacyValueDisallowChatParticipants(let chats): - if boxed { - buffer.appendInt32(1103656293) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .privacyValueDisallowContacts: - if boxed { - buffer.appendInt32(-125240806) - } - - break - case .privacyValueDisallowUsers(let users): - if boxed { - buffer.appendInt32(-463335103) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .privacyValueAllowAll: + case privacyValueDisallowUsers(Cons_privacyValueDisallowUsers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .privacyValueAllowAll: + if boxed { + buffer.appendInt32(1698855810) + } + break + case .privacyValueAllowBots: + if boxed { + buffer.appendInt32(558242653) + } + break + case .privacyValueAllowChatParticipants(let _data): + if boxed { + buffer.appendInt32(1796427406) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .privacyValueAllowCloseFriends: + if boxed { + buffer.appendInt32(-135735141) + } + break + case .privacyValueAllowContacts: + if boxed { + buffer.appendInt32(-123988) + } + break + case .privacyValueAllowPremium: + if boxed { + buffer.appendInt32(-320241333) + } + break + case .privacyValueAllowUsers(let _data): + if boxed { + buffer.appendInt32(-1198497870) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .privacyValueDisallowAll: + if boxed { + buffer.appendInt32(-1955338397) + } + break + case .privacyValueDisallowBots: + if boxed { + buffer.appendInt32(-156895185) + } + break + case .privacyValueDisallowChatParticipants(let _data): + if boxed { + buffer.appendInt32(1103656293) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .privacyValueDisallowContacts: + if boxed { + buffer.appendInt32(-125240806) + } + break + case .privacyValueDisallowUsers(let _data): + if boxed { + buffer.appendInt32(-463335103) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .privacyValueAllowAll: return ("privacyValueAllowAll", []) - case .privacyValueAllowBots: + case .privacyValueAllowBots: return ("privacyValueAllowBots", []) - case .privacyValueAllowChatParticipants(let chats): - return ("privacyValueAllowChatParticipants", [("chats", chats as Any)]) - case .privacyValueAllowCloseFriends: + case .privacyValueAllowChatParticipants(let _data): + return ("privacyValueAllowChatParticipants", [("chats", _data.chats as Any)]) + case .privacyValueAllowCloseFriends: return ("privacyValueAllowCloseFriends", []) - case .privacyValueAllowContacts: + case .privacyValueAllowContacts: return ("privacyValueAllowContacts", []) - case .privacyValueAllowPremium: + case .privacyValueAllowPremium: return ("privacyValueAllowPremium", []) - case .privacyValueAllowUsers(let users): - return ("privacyValueAllowUsers", [("users", users as Any)]) - case .privacyValueDisallowAll: + case .privacyValueAllowUsers(let _data): + return ("privacyValueAllowUsers", [("users", _data.users as Any)]) + case .privacyValueDisallowAll: return ("privacyValueDisallowAll", []) - case .privacyValueDisallowBots: + case .privacyValueDisallowBots: return ("privacyValueDisallowBots", []) - case .privacyValueDisallowChatParticipants(let chats): - return ("privacyValueDisallowChatParticipants", [("chats", chats as Any)]) - case .privacyValueDisallowContacts: + case .privacyValueDisallowChatParticipants(let _data): + return ("privacyValueDisallowChatParticipants", [("chats", _data.chats as Any)]) + case .privacyValueDisallowContacts: return ("privacyValueDisallowContacts", []) - case .privacyValueDisallowUsers(let users): - return ("privacyValueDisallowUsers", [("users", users as Any)]) - } - } - + case .privacyValueDisallowUsers(let _data): + return ("privacyValueDisallowUsers", [("users", _data.users as Any)]) + } + } + public static func parse_privacyValueAllowAll(_ reader: BufferReader) -> PrivacyRule? { return Api.PrivacyRule.privacyValueAllowAll } @@ -148,7 +164,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PrivacyRule.privacyValueAllowChatParticipants(chats: _1!) + return Api.PrivacyRule.privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants(chats: _1!)) } else { return nil @@ -170,7 +186,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PrivacyRule.privacyValueAllowUsers(users: _1!) + return Api.PrivacyRule.privacyValueAllowUsers(Cons_privacyValueAllowUsers(users: _1!)) } else { return nil @@ -189,7 +205,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PrivacyRule.privacyValueDisallowChatParticipants(chats: _1!) + return Api.PrivacyRule.privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants(chats: _1!)) } else { return nil @@ -205,13 +221,12 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PrivacyRule.privacyValueDisallowUsers(users: _1!) + return Api.PrivacyRule.privacyValueDisallowUsers(Cons_privacyValueDisallowUsers(users: _1!)) } else { return nil } } - } } public extension Api { @@ -224,81 +239,73 @@ public extension Api { case profileTabMusic case profileTabPosts case profileTabVoice - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .profileTabFiles: - if boxed { - buffer.appendInt32(-1422681088) - } - - break - case .profileTabGifs: - if boxed { - buffer.appendInt32(-1564412267) - } - - break - case .profileTabGifts: - if boxed { - buffer.appendInt32(1296815210) - } - - break - case .profileTabLinks: - if boxed { - buffer.appendInt32(-748329831) - } - - break - case .profileTabMedia: - if boxed { - buffer.appendInt32(1925597525) - } - - break - case .profileTabMusic: - if boxed { - buffer.appendInt32(-1624780178) - } - - break - case .profileTabPosts: - if boxed { - buffer.appendInt32(-1181952362) - } - - break - case .profileTabVoice: - if boxed { - buffer.appendInt32(-461960914) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .profileTabFiles: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .profileTabFiles: + if boxed { + buffer.appendInt32(-1422681088) + } + break + case .profileTabGifs: + if boxed { + buffer.appendInt32(-1564412267) + } + break + case .profileTabGifts: + if boxed { + buffer.appendInt32(1296815210) + } + break + case .profileTabLinks: + if boxed { + buffer.appendInt32(-748329831) + } + break + case .profileTabMedia: + if boxed { + buffer.appendInt32(1925597525) + } + break + case .profileTabMusic: + if boxed { + buffer.appendInt32(-1624780178) + } + break + case .profileTabPosts: + if boxed { + buffer.appendInt32(-1181952362) + } + break + case .profileTabVoice: + if boxed { + buffer.appendInt32(-461960914) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .profileTabFiles: return ("profileTabFiles", []) - case .profileTabGifs: + case .profileTabGifs: return ("profileTabGifs", []) - case .profileTabGifts: + case .profileTabGifts: return ("profileTabGifts", []) - case .profileTabLinks: + case .profileTabLinks: return ("profileTabLinks", []) - case .profileTabMedia: + case .profileTabMedia: return ("profileTabMedia", []) - case .profileTabMusic: + case .profileTabMusic: return ("profileTabMusic", []) - case .profileTabPosts: + case .profileTabPosts: return ("profileTabPosts", []) - case .profileTabVoice: + case .profileTabVoice: return ("profileTabVoice", []) - } - } - + } + } + public static func parse_profileTabFiles(_ reader: BufferReader) -> ProfileTab? { return Api.ProfileTab.profileTabFiles } @@ -323,41 +330,54 @@ public extension Api { public static func parse_profileTabVoice(_ reader: BufferReader) -> ProfileTab? { return Api.ProfileTab.profileTabVoice } - } } public extension Api { indirect enum PublicForward: TypeConstructorDescription { - case publicForwardMessage(message: Api.Message) - case publicForwardStory(peer: Api.Peer, story: Api.StoryItem) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .publicForwardMessage(let message): - if boxed { - buffer.appendInt32(32685898) - } - message.serialize(buffer, true) - break - case .publicForwardStory(let peer, let story): - if boxed { - buffer.appendInt32(-302797360) - } - peer.serialize(buffer, true) - story.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .publicForwardMessage(let message): - return ("publicForwardMessage", [("message", message as Any)]) - case .publicForwardStory(let peer, let story): - return ("publicForwardStory", [("peer", peer as Any), ("story", story as Any)]) - } - } - + public class Cons_publicForwardMessage { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_publicForwardStory { + public var peer: Api.Peer + public var story: Api.StoryItem + public init(peer: Api.Peer, story: Api.StoryItem) { + self.peer = peer + self.story = story + } + } + case publicForwardMessage(Cons_publicForwardMessage) + case publicForwardStory(Cons_publicForwardStory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .publicForwardMessage(let _data): + if boxed { + buffer.appendInt32(32685898) + } + _data.message.serialize(buffer, true) + break + case .publicForwardStory(let _data): + if boxed { + buffer.appendInt32(-302797360) + } + _data.peer.serialize(buffer, true) + _data.story.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .publicForwardMessage(let _data): + return ("publicForwardMessage", [("message", _data.message as Any)]) + case .publicForwardStory(let _data): + return ("publicForwardStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) + } + } + public static func parse_publicForwardMessage(_ reader: BufferReader) -> PublicForward? { var _1: Api.Message? if let signature = reader.readInt32() { @@ -365,7 +385,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.PublicForward.publicForwardMessage(message: _1!) + return Api.PublicForward.publicForwardMessage(Cons_publicForwardMessage(message: _1!)) } else { return nil @@ -383,40 +403,51 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PublicForward.publicForwardStory(peer: _1!, story: _2!) + return Api.PublicForward.publicForwardStory(Cons_publicForwardStory(peer: _1!, story: _2!)) } else { return nil } } - } } public extension Api { enum QuickReply: TypeConstructorDescription { - case quickReply(shortcutId: Int32, shortcut: String, topMessage: Int32, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .quickReply(let shortcutId, let shortcut, let topMessage, let count): - if boxed { - buffer.appendInt32(110563371) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - serializeString(shortcut, buffer: buffer, boxed: false) - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .quickReply(let shortcutId, let shortcut, let topMessage, let count): - return ("quickReply", [("shortcutId", shortcutId as Any), ("shortcut", shortcut as Any), ("topMessage", topMessage as Any), ("count", count as Any)]) - } - } - + public class Cons_quickReply { + public var shortcutId: Int32 + public var shortcut: String + public var topMessage: Int32 + public var count: Int32 + public init(shortcutId: Int32, shortcut: String, topMessage: Int32, count: Int32) { + self.shortcutId = shortcutId + self.shortcut = shortcut + self.topMessage = topMessage + self.count = count + } + } + case quickReply(Cons_quickReply) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .quickReply(let _data): + if boxed { + buffer.appendInt32(110563371) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + serializeString(_data.shortcut, buffer: buffer, boxed: false) + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .quickReply(let _data): + return ("quickReply", [("shortcutId", _data.shortcutId as Any), ("shortcut", _data.shortcut as Any), ("topMessage", _data.topMessage as Any), ("count", _data.count as Any)]) + } + } + public static func parse_quickReply(_ reader: BufferReader) -> QuickReply? { var _1: Int32? _1 = reader.readInt32() @@ -431,70 +462,79 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.QuickReply.quickReply(shortcutId: _1!, shortcut: _2!, topMessage: _3!, count: _4!) + return Api.QuickReply.quickReply(Cons_quickReply(shortcutId: _1!, shortcut: _2!, topMessage: _3!, count: _4!)) } else { return nil } } - } } public extension Api { enum Reaction: TypeConstructorDescription { - case reactionCustomEmoji(documentId: Int64) - case reactionEmoji(emoticon: String) + public class Cons_reactionCustomEmoji { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + } + public class Cons_reactionEmoji { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + case reactionCustomEmoji(Cons_reactionCustomEmoji) + case reactionEmoji(Cons_reactionEmoji) case reactionEmpty case reactionPaid - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactionCustomEmoji(let documentId): - if boxed { - buffer.appendInt32(-1992950669) - } - serializeInt64(documentId, buffer: buffer, boxed: false) - break - case .reactionEmoji(let emoticon): - if boxed { - buffer.appendInt32(455247544) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .reactionEmpty: - if boxed { - buffer.appendInt32(2046153753) - } - - break - case .reactionPaid: - if boxed { - buffer.appendInt32(1379771627) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactionCustomEmoji(let documentId): - return ("reactionCustomEmoji", [("documentId", documentId as Any)]) - case .reactionEmoji(let emoticon): - return ("reactionEmoji", [("emoticon", emoticon as Any)]) - case .reactionEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactionCustomEmoji(let _data): + if boxed { + buffer.appendInt32(-1992950669) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + break + case .reactionEmoji(let _data): + if boxed { + buffer.appendInt32(455247544) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .reactionEmpty: + if boxed { + buffer.appendInt32(2046153753) + } + break + case .reactionPaid: + if boxed { + buffer.appendInt32(1379771627) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reactionCustomEmoji(let _data): + return ("reactionCustomEmoji", [("documentId", _data.documentId as Any)]) + case .reactionEmoji(let _data): + return ("reactionEmoji", [("emoticon", _data.emoticon as Any)]) + case .reactionEmpty: return ("reactionEmpty", []) - case .reactionPaid: + case .reactionPaid: return ("reactionPaid", []) - } - } - + } + } + public static func parse_reactionCustomEmoji(_ reader: BufferReader) -> Reaction? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Reaction.reactionCustomEmoji(documentId: _1!) + return Api.Reaction.reactionCustomEmoji(Cons_reactionCustomEmoji(documentId: _1!)) } else { return nil @@ -505,7 +545,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Reaction.reactionEmoji(emoticon: _1!) + return Api.Reaction.reactionEmoji(Cons_reactionEmoji(emoticon: _1!)) } else { return nil @@ -517,39 +557,54 @@ public extension Api { public static func parse_reactionPaid(_ reader: BufferReader) -> Reaction? { return Api.Reaction.reactionPaid } - } } public extension Api { enum ReactionCount: TypeConstructorDescription { - case reactionCount(flags: Int32, chosenOrder: Int32?, reaction: Api.Reaction, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactionCount(let flags, let chosenOrder, let reaction, let count): - if boxed { - buffer.appendInt32(-1546531968) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(chosenOrder!, buffer: buffer, boxed: false)} - reaction.serialize(buffer, true) - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactionCount(let flags, let chosenOrder, let reaction, let count): - return ("reactionCount", [("flags", flags as Any), ("chosenOrder", chosenOrder as Any), ("reaction", reaction as Any), ("count", count as Any)]) - } - } - + public class Cons_reactionCount { + public var flags: Int32 + public var chosenOrder: Int32? + public var reaction: Api.Reaction + public var count: Int32 + public init(flags: Int32, chosenOrder: Int32?, reaction: Api.Reaction, count: Int32) { + self.flags = flags + self.chosenOrder = chosenOrder + self.reaction = reaction + self.count = count + } + } + case reactionCount(Cons_reactionCount) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactionCount(let _data): + if boxed { + buffer.appendInt32(-1546531968) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.chosenOrder!, buffer: buffer, boxed: false) + } + _data.reaction.serialize(buffer, true) + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reactionCount(let _data): + return ("reactionCount", [("flags", _data.flags as Any), ("chosenOrder", _data.chosenOrder as Any), ("reaction", _data.reaction as Any), ("count", _data.count as Any)]) + } + } + public static func parse_reactionCount(_ reader: BufferReader) -> ReactionCount? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Api.Reaction? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.Reaction @@ -561,92 +616,110 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ReactionCount.reactionCount(flags: _1!, chosenOrder: _2, reaction: _3!, count: _4!) + return Api.ReactionCount.reactionCount(Cons_reactionCount(flags: _1!, chosenOrder: _2, reaction: _3!, count: _4!)) } else { return nil } } - } } public extension Api { enum ReactionNotificationsFrom: TypeConstructorDescription { case reactionNotificationsFromAll case reactionNotificationsFromContacts - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactionNotificationsFromAll: - if boxed { - buffer.appendInt32(1268654752) - } - - break - case .reactionNotificationsFromContacts: - if boxed { - buffer.appendInt32(-1161583078) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactionNotificationsFromAll: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactionNotificationsFromAll: + if boxed { + buffer.appendInt32(1268654752) + } + break + case .reactionNotificationsFromContacts: + if boxed { + buffer.appendInt32(-1161583078) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reactionNotificationsFromAll: return ("reactionNotificationsFromAll", []) - case .reactionNotificationsFromContacts: + case .reactionNotificationsFromContacts: return ("reactionNotificationsFromContacts", []) - } - } - + } + } + public static func parse_reactionNotificationsFromAll(_ reader: BufferReader) -> ReactionNotificationsFrom? { return Api.ReactionNotificationsFrom.reactionNotificationsFromAll } public static func parse_reactionNotificationsFromContacts(_ reader: BufferReader) -> ReactionNotificationsFrom? { return Api.ReactionNotificationsFrom.reactionNotificationsFromContacts } - } } public extension Api { enum ReactionsNotifySettings: TypeConstructorDescription { - case reactionsNotifySettings(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactionsNotifySettings(let flags, let messagesNotifyFrom, let storiesNotifyFrom, let sound, let showPreviews): - if boxed { - buffer.appendInt32(1457736048) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {messagesNotifyFrom!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {storiesNotifyFrom!.serialize(buffer, true)} - sound.serialize(buffer, true) - showPreviews.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactionsNotifySettings(let flags, let messagesNotifyFrom, let storiesNotifyFrom, let sound, let showPreviews): - return ("reactionsNotifySettings", [("flags", flags as Any), ("messagesNotifyFrom", messagesNotifyFrom as Any), ("storiesNotifyFrom", storiesNotifyFrom as Any), ("sound", sound as Any), ("showPreviews", showPreviews as Any)]) - } - } - + public class Cons_reactionsNotifySettings { + public var flags: Int32 + public var messagesNotifyFrom: Api.ReactionNotificationsFrom? + public var storiesNotifyFrom: Api.ReactionNotificationsFrom? + public var sound: Api.NotificationSound + public var showPreviews: Api.Bool + public init(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) { + self.flags = flags + self.messagesNotifyFrom = messagesNotifyFrom + self.storiesNotifyFrom = storiesNotifyFrom + self.sound = sound + self.showPreviews = showPreviews + } + } + case reactionsNotifySettings(Cons_reactionsNotifySettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactionsNotifySettings(let _data): + if boxed { + buffer.appendInt32(1457736048) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.messagesNotifyFrom!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.storiesNotifyFrom!.serialize(buffer, true) + } + _data.sound.serialize(buffer, true) + _data.showPreviews.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reactionsNotifySettings(let _data): + return ("reactionsNotifySettings", [("flags", _data.flags as Any), ("messagesNotifyFrom", _data.messagesNotifyFrom as Any), ("storiesNotifyFrom", _data.storiesNotifyFrom as Any), ("sound", _data.sound as Any), ("showPreviews", _data.showPreviews as Any)]) + } + } + public static func parse_reactionsNotifySettings(_ reader: BufferReader) -> ReactionsNotifySettings? { var _1: Int32? _1 = reader.readInt32() var _2: Api.ReactionNotificationsFrom? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } var _3: Api.ReactionNotificationsFrom? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } var _4: Api.NotificationSound? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.NotificationSound @@ -661,38 +734,45 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.ReactionsNotifySettings.reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, sound: _4!, showPreviews: _5!) + return Api.ReactionsNotifySettings.reactionsNotifySettings(Cons_reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, sound: _4!, showPreviews: _5!)) } else { return nil } } - } } public extension Api { enum ReadParticipantDate: TypeConstructorDescription { - case readParticipantDate(userId: Int64, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .readParticipantDate(let userId, let date): - if boxed { - buffer.appendInt32(1246753138) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .readParticipantDate(let userId, let date): - return ("readParticipantDate", [("userId", userId as Any), ("date", date as Any)]) - } - } - + public class Cons_readParticipantDate { + public var userId: Int64 + public var date: Int32 + public init(userId: Int64, date: Int32) { + self.userId = userId + self.date = date + } + } + case readParticipantDate(Cons_readParticipantDate) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .readParticipantDate(let _data): + if boxed { + buffer.appendInt32(1246753138) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .readParticipantDate(let _data): + return ("readParticipantDate", [("userId", _data.userId as Any), ("date", _data.date as Any)]) + } + } + public static func parse_readParticipantDate(_ reader: BufferReader) -> ReadParticipantDate? { var _1: Int64? _1 = reader.readInt64() @@ -701,12 +781,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReadParticipantDate.readParticipantDate(userId: _1!, date: _2!) + return Api.ReadParticipantDate.readParticipantDate(Cons_readParticipantDate(userId: _1!, date: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api22.swift b/submodules/TelegramApi/Sources/Api22.swift index db61ed1819..d00a29c4e6 100644 --- a/submodules/TelegramApi/Sources/Api22.swift +++ b/submodules/TelegramApi/Sources/Api22.swift @@ -1,26 +1,34 @@ public extension Api { enum ReceivedNotifyMessage: TypeConstructorDescription { - case receivedNotifyMessage(id: Int32, flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .receivedNotifyMessage(let id, let flags): - if boxed { - buffer.appendInt32(-1551583367) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .receivedNotifyMessage(let id, let flags): - return ("receivedNotifyMessage", [("id", id as Any), ("flags", flags as Any)]) - } - } - + public class Cons_receivedNotifyMessage { + public var id: Int32 + public var flags: Int32 + public init(id: Int32, flags: Int32) { + self.id = id + self.flags = flags + } + } + case receivedNotifyMessage(Cons_receivedNotifyMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .receivedNotifyMessage(let _data): + if boxed { + buffer.appendInt32(-1551583367) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .receivedNotifyMessage(let _data): + return ("receivedNotifyMessage", [("id", _data.id as Any), ("flags", _data.flags as Any)]) + } + } + public static func parse_receivedNotifyMessage(_ reader: BufferReader) -> ReceivedNotifyMessage? { var _1: Int32? _1 = reader.readInt32() @@ -29,77 +37,114 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReceivedNotifyMessage.receivedNotifyMessage(id: _1!, flags: _2!) + return Api.ReceivedNotifyMessage.receivedNotifyMessage(Cons_receivedNotifyMessage(id: _1!, flags: _2!)) } else { return nil } } - } } public extension Api { indirect enum RecentMeUrl: TypeConstructorDescription { - case recentMeUrlChat(url: String, chatId: Int64) - case recentMeUrlChatInvite(url: String, chatInvite: Api.ChatInvite) - case recentMeUrlStickerSet(url: String, set: Api.StickerSetCovered) - case recentMeUrlUnknown(url: String) - case recentMeUrlUser(url: String, userId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .recentMeUrlChat(let url, let chatId): - if boxed { - buffer.appendInt32(-1294306862) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - break - case .recentMeUrlChatInvite(let url, let chatInvite): - if boxed { - buffer.appendInt32(-347535331) - } - serializeString(url, buffer: buffer, boxed: false) - chatInvite.serialize(buffer, true) - break - case .recentMeUrlStickerSet(let url, let set): - if boxed { - buffer.appendInt32(-1140172836) - } - serializeString(url, buffer: buffer, boxed: false) - set.serialize(buffer, true) - break - case .recentMeUrlUnknown(let url): - if boxed { - buffer.appendInt32(1189204285) - } - serializeString(url, buffer: buffer, boxed: false) - break - case .recentMeUrlUser(let url, let userId): - if boxed { - buffer.appendInt32(-1188296222) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .recentMeUrlChat(let url, let chatId): - return ("recentMeUrlChat", [("url", url as Any), ("chatId", chatId as Any)]) - case .recentMeUrlChatInvite(let url, let chatInvite): - return ("recentMeUrlChatInvite", [("url", url as Any), ("chatInvite", chatInvite as Any)]) - case .recentMeUrlStickerSet(let url, let set): - return ("recentMeUrlStickerSet", [("url", url as Any), ("set", set as Any)]) - case .recentMeUrlUnknown(let url): - return ("recentMeUrlUnknown", [("url", url as Any)]) - case .recentMeUrlUser(let url, let userId): - return ("recentMeUrlUser", [("url", url as Any), ("userId", userId as Any)]) - } - } - + public class Cons_recentMeUrlChat { + public var url: String + public var chatId: Int64 + public init(url: String, chatId: Int64) { + self.url = url + self.chatId = chatId + } + } + public class Cons_recentMeUrlChatInvite { + public var url: String + public var chatInvite: Api.ChatInvite + public init(url: String, chatInvite: Api.ChatInvite) { + self.url = url + self.chatInvite = chatInvite + } + } + public class Cons_recentMeUrlStickerSet { + public var url: String + public var set: Api.StickerSetCovered + public init(url: String, set: Api.StickerSetCovered) { + self.url = url + self.set = set + } + } + public class Cons_recentMeUrlUnknown { + public var url: String + public init(url: String) { + self.url = url + } + } + public class Cons_recentMeUrlUser { + public var url: String + public var userId: Int64 + public init(url: String, userId: Int64) { + self.url = url + self.userId = userId + } + } + case recentMeUrlChat(Cons_recentMeUrlChat) + case recentMeUrlChatInvite(Cons_recentMeUrlChatInvite) + case recentMeUrlStickerSet(Cons_recentMeUrlStickerSet) + case recentMeUrlUnknown(Cons_recentMeUrlUnknown) + case recentMeUrlUser(Cons_recentMeUrlUser) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .recentMeUrlChat(let _data): + if boxed { + buffer.appendInt32(-1294306862) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + break + case .recentMeUrlChatInvite(let _data): + if boxed { + buffer.appendInt32(-347535331) + } + serializeString(_data.url, buffer: buffer, boxed: false) + _data.chatInvite.serialize(buffer, true) + break + case .recentMeUrlStickerSet(let _data): + if boxed { + buffer.appendInt32(-1140172836) + } + serializeString(_data.url, buffer: buffer, boxed: false) + _data.set.serialize(buffer, true) + break + case .recentMeUrlUnknown(let _data): + if boxed { + buffer.appendInt32(1189204285) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .recentMeUrlUser(let _data): + if boxed { + buffer.appendInt32(-1188296222) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .recentMeUrlChat(let _data): + return ("recentMeUrlChat", [("url", _data.url as Any), ("chatId", _data.chatId as Any)]) + case .recentMeUrlChatInvite(let _data): + return ("recentMeUrlChatInvite", [("url", _data.url as Any), ("chatInvite", _data.chatInvite as Any)]) + case .recentMeUrlStickerSet(let _data): + return ("recentMeUrlStickerSet", [("url", _data.url as Any), ("set", _data.set as Any)]) + case .recentMeUrlUnknown(let _data): + return ("recentMeUrlUnknown", [("url", _data.url as Any)]) + case .recentMeUrlUser(let _data): + return ("recentMeUrlUser", [("url", _data.url as Any), ("userId", _data.userId as Any)]) + } + } + public static func parse_recentMeUrlChat(_ reader: BufferReader) -> RecentMeUrl? { var _1: String? _1 = parseString(reader) @@ -108,7 +153,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlChat(url: _1!, chatId: _2!) + return Api.RecentMeUrl.recentMeUrlChat(Cons_recentMeUrlChat(url: _1!, chatId: _2!)) } else { return nil @@ -124,7 +169,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlChatInvite(url: _1!, chatInvite: _2!) + return Api.RecentMeUrl.recentMeUrlChatInvite(Cons_recentMeUrlChatInvite(url: _1!, chatInvite: _2!)) } else { return nil @@ -140,7 +185,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlStickerSet(url: _1!, set: _2!) + return Api.RecentMeUrl.recentMeUrlStickerSet(Cons_recentMeUrlStickerSet(url: _1!, set: _2!)) } else { return nil @@ -151,7 +196,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.RecentMeUrl.recentMeUrlUnknown(url: _1!) + return Api.RecentMeUrl.recentMeUrlUnknown(Cons_recentMeUrlUnknown(url: _1!)) } else { return nil @@ -165,115 +210,159 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlUser(url: _1!, userId: _2!) + return Api.RecentMeUrl.recentMeUrlUser(Cons_recentMeUrlUser(url: _1!, userId: _2!)) } else { return nil } } - } } public extension Api { enum RecentStory: TypeConstructorDescription { - case recentStory(flags: Int32, maxId: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .recentStory(let flags, let maxId): - if boxed { - buffer.appendInt32(1897752877) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(maxId!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .recentStory(let flags, let maxId): - return ("recentStory", [("flags", flags as Any), ("maxId", maxId as Any)]) - } - } - + public class Cons_recentStory { + public var flags: Int32 + public var maxId: Int32? + public init(flags: Int32, maxId: Int32?) { + self.flags = flags + self.maxId = maxId + } + } + case recentStory(Cons_recentStory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .recentStory(let _data): + if boxed { + buffer.appendInt32(1897752877) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.maxId!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .recentStory(let _data): + return ("recentStory", [("flags", _data.flags as Any), ("maxId", _data.maxId as Any)]) + } + } + public static func parse_recentStory(_ reader: BufferReader) -> RecentStory? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil if _c1 && _c2 { - return Api.RecentStory.recentStory(flags: _1!, maxId: _2) + return Api.RecentStory.recentStory(Cons_recentStory(flags: _1!, maxId: _2)) } else { return nil } } - } } public extension Api { enum ReplyMarkup: TypeConstructorDescription { - case replyInlineMarkup(rows: [Api.KeyboardButtonRow]) - case replyKeyboardForceReply(flags: Int32, placeholder: String?) - case replyKeyboardHide(flags: Int32) - case replyKeyboardMarkup(flags: Int32, rows: [Api.KeyboardButtonRow], placeholder: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .replyInlineMarkup(let rows): - if boxed { - buffer.appendInt32(1218642516) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rows.count)) - for item in rows { - item.serialize(buffer, true) - } - break - case .replyKeyboardForceReply(let flags, let placeholder): - if boxed { - buffer.appendInt32(-2035021048) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(placeholder!, buffer: buffer, boxed: false)} - break - case .replyKeyboardHide(let flags): - if boxed { - buffer.appendInt32(-1606526075) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .replyKeyboardMarkup(let flags, let rows, let placeholder): - if boxed { - buffer.appendInt32(-2049074735) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rows.count)) - for item in rows { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 3) != 0 {serializeString(placeholder!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .replyInlineMarkup(let rows): - return ("replyInlineMarkup", [("rows", rows as Any)]) - case .replyKeyboardForceReply(let flags, let placeholder): - return ("replyKeyboardForceReply", [("flags", flags as Any), ("placeholder", placeholder as Any)]) - case .replyKeyboardHide(let flags): - return ("replyKeyboardHide", [("flags", flags as Any)]) - case .replyKeyboardMarkup(let flags, let rows, let placeholder): - return ("replyKeyboardMarkup", [("flags", flags as Any), ("rows", rows as Any), ("placeholder", placeholder as Any)]) - } - } - + public class Cons_replyInlineMarkup { + public var rows: [Api.KeyboardButtonRow] + public init(rows: [Api.KeyboardButtonRow]) { + self.rows = rows + } + } + public class Cons_replyKeyboardForceReply { + public var flags: Int32 + public var placeholder: String? + public init(flags: Int32, placeholder: String?) { + self.flags = flags + self.placeholder = placeholder + } + } + public class Cons_replyKeyboardHide { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_replyKeyboardMarkup { + public var flags: Int32 + public var rows: [Api.KeyboardButtonRow] + public var placeholder: String? + public init(flags: Int32, rows: [Api.KeyboardButtonRow], placeholder: String?) { + self.flags = flags + self.rows = rows + self.placeholder = placeholder + } + } + case replyInlineMarkup(Cons_replyInlineMarkup) + case replyKeyboardForceReply(Cons_replyKeyboardForceReply) + case replyKeyboardHide(Cons_replyKeyboardHide) + case replyKeyboardMarkup(Cons_replyKeyboardMarkup) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .replyInlineMarkup(let _data): + if boxed { + buffer.appendInt32(1218642516) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rows.count)) + for item in _data.rows { + item.serialize(buffer, true) + } + break + case .replyKeyboardForceReply(let _data): + if boxed { + buffer.appendInt32(-2035021048) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.placeholder!, buffer: buffer, boxed: false) + } + break + case .replyKeyboardHide(let _data): + if boxed { + buffer.appendInt32(-1606526075) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .replyKeyboardMarkup(let _data): + if boxed { + buffer.appendInt32(-2049074735) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rows.count)) + for item in _data.rows { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.placeholder!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .replyInlineMarkup(let _data): + return ("replyInlineMarkup", [("rows", _data.rows as Any)]) + case .replyKeyboardForceReply(let _data): + return ("replyKeyboardForceReply", [("flags", _data.flags as Any), ("placeholder", _data.placeholder as Any)]) + case .replyKeyboardHide(let _data): + return ("replyKeyboardHide", [("flags", _data.flags as Any)]) + case .replyKeyboardMarkup(let _data): + return ("replyKeyboardMarkup", [("flags", _data.flags as Any), ("rows", _data.rows as Any), ("placeholder", _data.placeholder as Any)]) + } + } + public static func parse_replyInlineMarkup(_ reader: BufferReader) -> ReplyMarkup? { var _1: [Api.KeyboardButtonRow]? if let _ = reader.readInt32() { @@ -281,7 +370,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ReplyMarkup.replyInlineMarkup(rows: _1!) + return Api.ReplyMarkup.replyInlineMarkup(Cons_replyInlineMarkup(rows: _1!)) } else { return nil @@ -291,11 +380,13 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 3) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _2 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil if _c1 && _c2 { - return Api.ReplyMarkup.replyKeyboardForceReply(flags: _1!, placeholder: _2) + return Api.ReplyMarkup.replyKeyboardForceReply(Cons_replyKeyboardForceReply(flags: _1!, placeholder: _2)) } else { return nil @@ -306,7 +397,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ReplyMarkup.replyKeyboardHide(flags: _1!) + return Api.ReplyMarkup.replyKeyboardHide(Cons_replyKeyboardHide(flags: _1!)) } else { return nil @@ -320,18 +411,19 @@ public extension Api { _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.KeyboardButtonRow.self) } var _3: String? - if Int(_1!) & Int(1 << 3) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.ReplyMarkup.replyKeyboardMarkup(flags: _1!, rows: _2!, placeholder: _3) + return Api.ReplyMarkup.replyKeyboardMarkup(Cons_replyKeyboardMarkup(flags: _1!, rows: _2!, placeholder: _3)) } else { return nil } } - } } public extension Api { @@ -346,97 +438,87 @@ public extension Api { case inputReportReasonPornography case inputReportReasonSpam case inputReportReasonViolence - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputReportReasonChildAbuse: - if boxed { - buffer.appendInt32(-1376497949) - } - - break - case .inputReportReasonCopyright: - if boxed { - buffer.appendInt32(-1685456582) - } - - break - case .inputReportReasonFake: - if boxed { - buffer.appendInt32(-170010905) - } - - break - case .inputReportReasonGeoIrrelevant: - if boxed { - buffer.appendInt32(-606798099) - } - - break - case .inputReportReasonIllegalDrugs: - if boxed { - buffer.appendInt32(177124030) - } - - break - case .inputReportReasonOther: - if boxed { - buffer.appendInt32(-1041980751) - } - - break - case .inputReportReasonPersonalDetails: - if boxed { - buffer.appendInt32(-1631091139) - } - - break - case .inputReportReasonPornography: - if boxed { - buffer.appendInt32(777640226) - } - - break - case .inputReportReasonSpam: - if boxed { - buffer.appendInt32(1490799288) - } - - break - case .inputReportReasonViolence: - if boxed { - buffer.appendInt32(505595789) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputReportReasonChildAbuse: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputReportReasonChildAbuse: + if boxed { + buffer.appendInt32(-1376497949) + } + break + case .inputReportReasonCopyright: + if boxed { + buffer.appendInt32(-1685456582) + } + break + case .inputReportReasonFake: + if boxed { + buffer.appendInt32(-170010905) + } + break + case .inputReportReasonGeoIrrelevant: + if boxed { + buffer.appendInt32(-606798099) + } + break + case .inputReportReasonIllegalDrugs: + if boxed { + buffer.appendInt32(177124030) + } + break + case .inputReportReasonOther: + if boxed { + buffer.appendInt32(-1041980751) + } + break + case .inputReportReasonPersonalDetails: + if boxed { + buffer.appendInt32(-1631091139) + } + break + case .inputReportReasonPornography: + if boxed { + buffer.appendInt32(777640226) + } + break + case .inputReportReasonSpam: + if boxed { + buffer.appendInt32(1490799288) + } + break + case .inputReportReasonViolence: + if boxed { + buffer.appendInt32(505595789) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputReportReasonChildAbuse: return ("inputReportReasonChildAbuse", []) - case .inputReportReasonCopyright: + case .inputReportReasonCopyright: return ("inputReportReasonCopyright", []) - case .inputReportReasonFake: + case .inputReportReasonFake: return ("inputReportReasonFake", []) - case .inputReportReasonGeoIrrelevant: + case .inputReportReasonGeoIrrelevant: return ("inputReportReasonGeoIrrelevant", []) - case .inputReportReasonIllegalDrugs: + case .inputReportReasonIllegalDrugs: return ("inputReportReasonIllegalDrugs", []) - case .inputReportReasonOther: + case .inputReportReasonOther: return ("inputReportReasonOther", []) - case .inputReportReasonPersonalDetails: + case .inputReportReasonPersonalDetails: return ("inputReportReasonPersonalDetails", []) - case .inputReportReasonPornography: + case .inputReportReasonPornography: return ("inputReportReasonPornography", []) - case .inputReportReasonSpam: + case .inputReportReasonSpam: return ("inputReportReasonSpam", []) - case .inputReportReasonViolence: + case .inputReportReasonViolence: return ("inputReportReasonViolence", []) - } - } - + } + } + public static func parse_inputReportReasonChildAbuse(_ reader: BufferReader) -> ReportReason? { return Api.ReportReason.inputReportReasonChildAbuse } @@ -467,55 +549,69 @@ public extension Api { public static func parse_inputReportReasonViolence(_ reader: BufferReader) -> ReportReason? { return Api.ReportReason.inputReportReasonViolence } - } } public extension Api { enum ReportResult: TypeConstructorDescription { - case reportResultAddComment(flags: Int32, option: Buffer) - case reportResultChooseOption(title: String, options: [Api.MessageReportOption]) + public class Cons_reportResultAddComment { + public var flags: Int32 + public var option: Buffer + public init(flags: Int32, option: Buffer) { + self.flags = flags + self.option = option + } + } + public class Cons_reportResultChooseOption { + public var title: String + public var options: [Api.MessageReportOption] + public init(title: String, options: [Api.MessageReportOption]) { + self.title = title + self.options = options + } + } + case reportResultAddComment(Cons_reportResultAddComment) + case reportResultChooseOption(Cons_reportResultChooseOption) case reportResultReported - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reportResultAddComment(let flags, let option): - if boxed { - buffer.appendInt32(1862904881) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - break - case .reportResultChooseOption(let title, let options): - if boxed { - buffer.appendInt32(-253435722) - } - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(options.count)) - for item in options { - item.serialize(buffer, true) - } - break - case .reportResultReported: - if boxed { - buffer.appendInt32(-1917633461) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reportResultAddComment(let flags, let option): - return ("reportResultAddComment", [("flags", flags as Any), ("option", option as Any)]) - case .reportResultChooseOption(let title, let options): - return ("reportResultChooseOption", [("title", title as Any), ("options", options as Any)]) - case .reportResultReported: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reportResultAddComment(let _data): + if boxed { + buffer.appendInt32(1862904881) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeBytes(_data.option, buffer: buffer, boxed: false) + break + case .reportResultChooseOption(let _data): + if boxed { + buffer.appendInt32(-253435722) + } + serializeString(_data.title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.options.count)) + for item in _data.options { + item.serialize(buffer, true) + } + break + case .reportResultReported: + if boxed { + buffer.appendInt32(-1917633461) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reportResultAddComment(let _data): + return ("reportResultAddComment", [("flags", _data.flags as Any), ("option", _data.option as Any)]) + case .reportResultChooseOption(let _data): + return ("reportResultChooseOption", [("title", _data.title as Any), ("options", _data.options as Any)]) + case .reportResultReported: return ("reportResultReported", []) - } - } - + } + } + public static func parse_reportResultAddComment(_ reader: BufferReader) -> ReportResult? { var _1: Int32? _1 = reader.readInt32() @@ -524,7 +620,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReportResult.reportResultAddComment(flags: _1!, option: _2!) + return Api.ReportResult.reportResultAddComment(Cons_reportResultAddComment(flags: _1!, option: _2!)) } else { return nil @@ -540,7 +636,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReportResult.reportResultChooseOption(title: _1!, options: _2!) + return Api.ReportResult.reportResultChooseOption(Cons_reportResultChooseOption(title: _1!, options: _2!)) } else { return nil @@ -549,79 +645,138 @@ public extension Api { public static func parse_reportResultReported(_ reader: BufferReader) -> ReportResult? { return Api.ReportResult.reportResultReported } - } } public extension Api { enum RequestPeerType: TypeConstructorDescription { - case requestPeerTypeBroadcast(flags: Int32, hasUsername: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?) - case requestPeerTypeChat(flags: Int32, hasUsername: Api.Bool?, forum: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?) - case requestPeerTypeUser(flags: Int32, bot: Api.Bool?, premium: Api.Bool?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .requestPeerTypeBroadcast(let flags, let hasUsername, let userAdminRights, let botAdminRights): - if boxed { - buffer.appendInt32(865857388) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {hasUsername!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {userAdminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {botAdminRights!.serialize(buffer, true)} - break - case .requestPeerTypeChat(let flags, let hasUsername, let forum, let userAdminRights, let botAdminRights): - if boxed { - buffer.appendInt32(-906990053) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {hasUsername!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {forum!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {userAdminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {botAdminRights!.serialize(buffer, true)} - break - case .requestPeerTypeUser(let flags, let bot, let premium): - if boxed { - buffer.appendInt32(1597737472) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {bot!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {premium!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .requestPeerTypeBroadcast(let flags, let hasUsername, let userAdminRights, let botAdminRights): - return ("requestPeerTypeBroadcast", [("flags", flags as Any), ("hasUsername", hasUsername as Any), ("userAdminRights", userAdminRights as Any), ("botAdminRights", botAdminRights as Any)]) - case .requestPeerTypeChat(let flags, let hasUsername, let forum, let userAdminRights, let botAdminRights): - return ("requestPeerTypeChat", [("flags", flags as Any), ("hasUsername", hasUsername as Any), ("forum", forum as Any), ("userAdminRights", userAdminRights as Any), ("botAdminRights", botAdminRights as Any)]) - case .requestPeerTypeUser(let flags, let bot, let premium): - return ("requestPeerTypeUser", [("flags", flags as Any), ("bot", bot as Any), ("premium", premium as Any)]) - } - } - + public class Cons_requestPeerTypeBroadcast { + public var flags: Int32 + public var hasUsername: Api.Bool? + public var userAdminRights: Api.ChatAdminRights? + public var botAdminRights: Api.ChatAdminRights? + public init(flags: Int32, hasUsername: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?) { + self.flags = flags + self.hasUsername = hasUsername + self.userAdminRights = userAdminRights + self.botAdminRights = botAdminRights + } + } + public class Cons_requestPeerTypeChat { + public var flags: Int32 + public var hasUsername: Api.Bool? + public var forum: Api.Bool? + public var userAdminRights: Api.ChatAdminRights? + public var botAdminRights: Api.ChatAdminRights? + public init(flags: Int32, hasUsername: Api.Bool?, forum: Api.Bool?, userAdminRights: Api.ChatAdminRights?, botAdminRights: Api.ChatAdminRights?) { + self.flags = flags + self.hasUsername = hasUsername + self.forum = forum + self.userAdminRights = userAdminRights + self.botAdminRights = botAdminRights + } + } + public class Cons_requestPeerTypeUser { + public var flags: Int32 + public var bot: Api.Bool? + public var premium: Api.Bool? + public init(flags: Int32, bot: Api.Bool?, premium: Api.Bool?) { + self.flags = flags + self.bot = bot + self.premium = premium + } + } + case requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast) + case requestPeerTypeChat(Cons_requestPeerTypeChat) + case requestPeerTypeUser(Cons_requestPeerTypeUser) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .requestPeerTypeBroadcast(let _data): + if boxed { + buffer.appendInt32(865857388) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.hasUsername!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.userAdminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.botAdminRights!.serialize(buffer, true) + } + break + case .requestPeerTypeChat(let _data): + if boxed { + buffer.appendInt32(-906990053) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.hasUsername!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.forum!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.userAdminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.botAdminRights!.serialize(buffer, true) + } + break + case .requestPeerTypeUser(let _data): + if boxed { + buffer.appendInt32(1597737472) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.bot!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.premium!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .requestPeerTypeBroadcast(let _data): + return ("requestPeerTypeBroadcast", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) + case .requestPeerTypeChat(let _data): + return ("requestPeerTypeChat", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("forum", _data.forum as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) + case .requestPeerTypeUser(let _data): + return ("requestPeerTypeUser", [("flags", _data.flags as Any), ("bot", _data.bot as Any), ("premium", _data.premium as Any)]) + } + } + public static func parse_requestPeerTypeBroadcast(_ reader: BufferReader) -> RequestPeerType? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _4: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.RequestPeerType.requestPeerTypeBroadcast(flags: _1!, hasUsername: _2, userAdminRights: _3, botAdminRights: _4) + return Api.RequestPeerType.requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast(flags: _1!, hasUsername: _2, userAdminRights: _3, botAdminRights: _4)) } else { return nil @@ -631,28 +786,36 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: Api.Bool? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _4: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _5: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 4) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestPeerType.requestPeerTypeChat(flags: _1!, hasUsername: _2, forum: _3, userAdminRights: _4, botAdminRights: _5) + return Api.RequestPeerType.requestPeerTypeChat(Cons_requestPeerTypeChat(flags: _1!, hasUsername: _2, forum: _3, userAdminRights: _4, botAdminRights: _5)) } else { return nil @@ -662,98 +825,167 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Bool? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _3: Api.Bool? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.RequestPeerType.requestPeerTypeUser(flags: _1!, bot: _2, premium: _3) + return Api.RequestPeerType.requestPeerTypeUser(Cons_requestPeerTypeUser(flags: _1!, bot: _2, premium: _3)) } else { return nil } } - } } public extension Api { enum RequestedPeer: TypeConstructorDescription { - case requestedPeerChannel(flags: Int32, channelId: Int64, title: String?, username: String?, photo: Api.Photo?) - case requestedPeerChat(flags: Int32, chatId: Int64, title: String?, photo: Api.Photo?) - case requestedPeerUser(flags: Int32, userId: Int64, firstName: String?, lastName: String?, username: String?, photo: Api.Photo?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .requestedPeerChannel(let flags, let channelId, let title, let username, let photo): - if boxed { - buffer.appendInt32(-1952185372) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(username!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - break - case .requestedPeerChat(let flags, let chatId, let title, let photo): - if boxed { - buffer.appendInt32(1929860175) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - break - case .requestedPeerUser(let flags, let userId, let firstName, let lastName, let username, let photo): - if boxed { - buffer.appendInt32(-701500310) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(firstName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(lastName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(username!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .requestedPeerChannel(let flags, let channelId, let title, let username, let photo): - return ("requestedPeerChannel", [("flags", flags as Any), ("channelId", channelId as Any), ("title", title as Any), ("username", username as Any), ("photo", photo as Any)]) - case .requestedPeerChat(let flags, let chatId, let title, let photo): - return ("requestedPeerChat", [("flags", flags as Any), ("chatId", chatId as Any), ("title", title as Any), ("photo", photo as Any)]) - case .requestedPeerUser(let flags, let userId, let firstName, let lastName, let username, let photo): - return ("requestedPeerUser", [("flags", flags as Any), ("userId", userId as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("username", username as Any), ("photo", photo as Any)]) - } - } - + public class Cons_requestedPeerChannel { + public var flags: Int32 + public var channelId: Int64 + public var title: String? + public var username: String? + public var photo: Api.Photo? + public init(flags: Int32, channelId: Int64, title: String?, username: String?, photo: Api.Photo?) { + self.flags = flags + self.channelId = channelId + self.title = title + self.username = username + self.photo = photo + } + } + public class Cons_requestedPeerChat { + public var flags: Int32 + public var chatId: Int64 + public var title: String? + public var photo: Api.Photo? + public init(flags: Int32, chatId: Int64, title: String?, photo: Api.Photo?) { + self.flags = flags + self.chatId = chatId + self.title = title + self.photo = photo + } + } + public class Cons_requestedPeerUser { + public var flags: Int32 + public var userId: Int64 + public var firstName: String? + public var lastName: String? + public var username: String? + public var photo: Api.Photo? + public init(flags: Int32, userId: Int64, firstName: String?, lastName: String?, username: String?, photo: Api.Photo?) { + self.flags = flags + self.userId = userId + self.firstName = firstName + self.lastName = lastName + self.username = username + self.photo = photo + } + } + case requestedPeerChannel(Cons_requestedPeerChannel) + case requestedPeerChat(Cons_requestedPeerChat) + case requestedPeerUser(Cons_requestedPeerUser) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .requestedPeerChannel(let _data): + if boxed { + buffer.appendInt32(-1952185372) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.username!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + break + case .requestedPeerChat(let _data): + if boxed { + buffer.appendInt32(1929860175) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + break + case .requestedPeerUser(let _data): + if boxed { + buffer.appendInt32(-701500310) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.firstName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.lastName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.username!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .requestedPeerChannel(let _data): + return ("requestedPeerChannel", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("title", _data.title as Any), ("username", _data.username as Any), ("photo", _data.photo as Any)]) + case .requestedPeerChat(let _data): + return ("requestedPeerChat", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("title", _data.title as Any), ("photo", _data.photo as Any)]) + case .requestedPeerUser(let _data): + return ("requestedPeerUser", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("username", _data.username as Any), ("photo", _data.photo as Any)]) + } + } + public static func parse_requestedPeerChannel(_ reader: BufferReader) -> RequestedPeer? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Photo + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestedPeer.requestedPeerChannel(flags: _1!, channelId: _2!, title: _3, username: _4, photo: _5) + return Api.RequestedPeer.requestedPeerChannel(Cons_requestedPeerChannel(flags: _1!, channelId: _2!, title: _3, username: _4, photo: _5)) } else { return nil @@ -765,17 +997,21 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.RequestedPeer.requestedPeerChat(flags: _1!, chatId: _2!, title: _3, photo: _4) + return Api.RequestedPeer.requestedPeerChat(Cons_requestedPeerChat(flags: _1!, chatId: _2!, title: _3, photo: _4)) } else { return nil @@ -787,15 +1023,23 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Photo + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -803,55 +1047,58 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.RequestedPeer.requestedPeerUser(flags: _1!, userId: _2!, firstName: _3, lastName: _4, username: _5, photo: _6) + return Api.RequestedPeer.requestedPeerUser(Cons_requestedPeerUser(flags: _1!, userId: _2!, firstName: _3, lastName: _4, username: _5, photo: _6)) } else { return nil } } - } } public extension Api { enum RequirementToContact: TypeConstructorDescription { + public class Cons_requirementToContactPaidMessages { + public var starsAmount: Int64 + public init(starsAmount: Int64) { + self.starsAmount = starsAmount + } + } case requirementToContactEmpty - case requirementToContactPaidMessages(starsAmount: Int64) + case requirementToContactPaidMessages(Cons_requirementToContactPaidMessages) case requirementToContactPremium - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .requirementToContactEmpty: - if boxed { - buffer.appendInt32(84580409) - } - - break - case .requirementToContactPaidMessages(let starsAmount): - if boxed { - buffer.appendInt32(-1258914157) - } - serializeInt64(starsAmount, buffer: buffer, boxed: false) - break - case .requirementToContactPremium: - if boxed { - buffer.appendInt32(-444472087) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .requirementToContactEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .requirementToContactEmpty: + if boxed { + buffer.appendInt32(84580409) + } + break + case .requirementToContactPaidMessages(let _data): + if boxed { + buffer.appendInt32(-1258914157) + } + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + break + case .requirementToContactPremium: + if boxed { + buffer.appendInt32(-444472087) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .requirementToContactEmpty: return ("requirementToContactEmpty", []) - case .requirementToContactPaidMessages(let starsAmount): - return ("requirementToContactPaidMessages", [("starsAmount", starsAmount as Any)]) - case .requirementToContactPremium: + case .requirementToContactPaidMessages(let _data): + return ("requirementToContactPaidMessages", [("starsAmount", _data.starsAmount as Any)]) + case .requirementToContactPremium: return ("requirementToContactPremium", []) - } - } - + } + } + public static func parse_requirementToContactEmpty(_ reader: BufferReader) -> RequirementToContact? { return Api.RequirementToContact.requirementToContactEmpty } @@ -860,7 +1107,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.RequirementToContact.requirementToContactPaidMessages(starsAmount: _1!) + return Api.RequirementToContact.requirementToContactPaidMessages(Cons_requirementToContactPaidMessages(starsAmount: _1!)) } else { return nil @@ -869,6 +1116,5 @@ public extension Api { public static func parse_requirementToContactPremium(_ reader: BufferReader) -> RequirementToContact? { return Api.RequirementToContact.requirementToContactPremium } - } } diff --git a/submodules/TelegramApi/Sources/Api23.swift b/submodules/TelegramApi/Sources/Api23.swift index 4a5a28dd6c..fd232331e7 100644 --- a/submodules/TelegramApi/Sources/Api23.swift +++ b/submodules/TelegramApi/Sources/Api23.swift @@ -1,27 +1,37 @@ public extension Api { enum RestrictionReason: TypeConstructorDescription { - case restrictionReason(platform: String, reason: String, text: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .restrictionReason(let platform, let reason, let text): - if boxed { - buffer.appendInt32(-797791052) - } - serializeString(platform, buffer: buffer, boxed: false) - serializeString(reason, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .restrictionReason(let platform, let reason, let text): - return ("restrictionReason", [("platform", platform as Any), ("reason", reason as Any), ("text", text as Any)]) - } - } - + public class Cons_restrictionReason { + public var platform: String + public var reason: String + public var text: String + public init(platform: String, reason: String, text: String) { + self.platform = platform + self.reason = reason + self.text = text + } + } + case restrictionReason(Cons_restrictionReason) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .restrictionReason(let _data): + if boxed { + buffer.appendInt32(-797791052) + } + serializeString(_data.platform, buffer: buffer, boxed: false) + serializeString(_data.reason, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .restrictionReason(let _data): + return ("restrictionReason", [("platform", _data.platform as Any), ("reason", _data.reason as Any), ("text", _data.text as Any)]) + } + } + public static func parse_restrictionReason(_ reader: BufferReader) -> RestrictionReason? { var _1: String? _1 = parseString(reader) @@ -33,183 +43,285 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.RestrictionReason.restrictionReason(platform: _1!, reason: _2!, text: _3!) + return Api.RestrictionReason.restrictionReason(Cons_restrictionReason(platform: _1!, reason: _2!, text: _3!)) } else { return nil } } - } } public extension Api { indirect enum RichText: TypeConstructorDescription { - case textAnchor(text: Api.RichText, name: String) - case textBold(text: Api.RichText) - case textConcat(texts: [Api.RichText]) - case textEmail(text: Api.RichText, email: String) + public class Cons_textAnchor { + public var text: Api.RichText + public var name: String + public init(text: Api.RichText, name: String) { + self.text = text + self.name = name + } + } + public class Cons_textBold { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textConcat { + public var texts: [Api.RichText] + public init(texts: [Api.RichText]) { + self.texts = texts + } + } + public class Cons_textEmail { + public var text: Api.RichText + public var email: String + public init(text: Api.RichText, email: String) { + self.text = text + self.email = email + } + } + public class Cons_textFixed { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textImage { + public var documentId: Int64 + public var w: Int32 + public var h: Int32 + public init(documentId: Int64, w: Int32, h: Int32) { + self.documentId = documentId + self.w = w + self.h = h + } + } + public class Cons_textItalic { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textMarked { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textPhone { + public var text: Api.RichText + public var phone: String + public init(text: Api.RichText, phone: String) { + self.text = text + self.phone = phone + } + } + public class Cons_textPlain { + public var text: String + public init(text: String) { + self.text = text + } + } + public class Cons_textStrike { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textSubscript { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textSuperscript { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textUnderline { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + } + public class Cons_textUrl { + public var text: Api.RichText + public var url: String + public var webpageId: Int64 + public init(text: Api.RichText, url: String, webpageId: Int64) { + self.text = text + self.url = url + self.webpageId = webpageId + } + } + case textAnchor(Cons_textAnchor) + case textBold(Cons_textBold) + case textConcat(Cons_textConcat) + case textEmail(Cons_textEmail) case textEmpty - case textFixed(text: Api.RichText) - case textImage(documentId: Int64, w: Int32, h: Int32) - case textItalic(text: Api.RichText) - case textMarked(text: Api.RichText) - case textPhone(text: Api.RichText, phone: String) - case textPlain(text: String) - case textStrike(text: Api.RichText) - case textSubscript(text: Api.RichText) - case textSuperscript(text: Api.RichText) - case textUnderline(text: Api.RichText) - case textUrl(text: Api.RichText, url: String, webpageId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .textAnchor(let text, let name): - if boxed { - buffer.appendInt32(894777186) - } - text.serialize(buffer, true) - serializeString(name, buffer: buffer, boxed: false) - break - case .textBold(let text): - if boxed { - buffer.appendInt32(1730456516) - } - text.serialize(buffer, true) - break - case .textConcat(let texts): - if boxed { - buffer.appendInt32(2120376535) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(texts.count)) - for item in texts { - item.serialize(buffer, true) - } - break - case .textEmail(let text, let email): - if boxed { - buffer.appendInt32(-564523562) - } - text.serialize(buffer, true) - serializeString(email, buffer: buffer, boxed: false) - break - case .textEmpty: - if boxed { - buffer.appendInt32(-599948721) - } - - break - case .textFixed(let text): - if boxed { - buffer.appendInt32(1816074681) - } - text.serialize(buffer, true) - break - case .textImage(let documentId, let w, let h): - if boxed { - buffer.appendInt32(136105807) - } - serializeInt64(documentId, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - break - case .textItalic(let text): - if boxed { - buffer.appendInt32(-653089380) - } - text.serialize(buffer, true) - break - case .textMarked(let text): - if boxed { - buffer.appendInt32(55281185) - } - text.serialize(buffer, true) - break - case .textPhone(let text, let phone): - if boxed { - buffer.appendInt32(483104362) - } - text.serialize(buffer, true) - serializeString(phone, buffer: buffer, boxed: false) - break - case .textPlain(let text): - if boxed { - buffer.appendInt32(1950782688) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .textStrike(let text): - if boxed { - buffer.appendInt32(-1678197867) - } - text.serialize(buffer, true) - break - case .textSubscript(let text): - if boxed { - buffer.appendInt32(-311786236) - } - text.serialize(buffer, true) - break - case .textSuperscript(let text): - if boxed { - buffer.appendInt32(-939827711) - } - text.serialize(buffer, true) - break - case .textUnderline(let text): - if boxed { - buffer.appendInt32(-1054465340) - } - text.serialize(buffer, true) - break - case .textUrl(let text, let url, let webpageId): - if boxed { - buffer.appendInt32(1009288385) - } - text.serialize(buffer, true) - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(webpageId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .textAnchor(let text, let name): - return ("textAnchor", [("text", text as Any), ("name", name as Any)]) - case .textBold(let text): - return ("textBold", [("text", text as Any)]) - case .textConcat(let texts): - return ("textConcat", [("texts", texts as Any)]) - case .textEmail(let text, let email): - return ("textEmail", [("text", text as Any), ("email", email as Any)]) - case .textEmpty: + case textFixed(Cons_textFixed) + case textImage(Cons_textImage) + case textItalic(Cons_textItalic) + case textMarked(Cons_textMarked) + case textPhone(Cons_textPhone) + case textPlain(Cons_textPlain) + case textStrike(Cons_textStrike) + case textSubscript(Cons_textSubscript) + case textSuperscript(Cons_textSuperscript) + case textUnderline(Cons_textUnderline) + case textUrl(Cons_textUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .textAnchor(let _data): + if boxed { + buffer.appendInt32(894777186) + } + _data.text.serialize(buffer, true) + serializeString(_data.name, buffer: buffer, boxed: false) + break + case .textBold(let _data): + if boxed { + buffer.appendInt32(1730456516) + } + _data.text.serialize(buffer, true) + break + case .textConcat(let _data): + if boxed { + buffer.appendInt32(2120376535) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.texts.count)) + for item in _data.texts { + item.serialize(buffer, true) + } + break + case .textEmail(let _data): + if boxed { + buffer.appendInt32(-564523562) + } + _data.text.serialize(buffer, true) + serializeString(_data.email, buffer: buffer, boxed: false) + break + case .textEmpty: + if boxed { + buffer.appendInt32(-599948721) + } + break + case .textFixed(let _data): + if boxed { + buffer.appendInt32(1816074681) + } + _data.text.serialize(buffer, true) + break + case .textImage(let _data): + if boxed { + buffer.appendInt32(136105807) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + break + case .textItalic(let _data): + if boxed { + buffer.appendInt32(-653089380) + } + _data.text.serialize(buffer, true) + break + case .textMarked(let _data): + if boxed { + buffer.appendInt32(55281185) + } + _data.text.serialize(buffer, true) + break + case .textPhone(let _data): + if boxed { + buffer.appendInt32(483104362) + } + _data.text.serialize(buffer, true) + serializeString(_data.phone, buffer: buffer, boxed: false) + break + case .textPlain(let _data): + if boxed { + buffer.appendInt32(1950782688) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .textStrike(let _data): + if boxed { + buffer.appendInt32(-1678197867) + } + _data.text.serialize(buffer, true) + break + case .textSubscript(let _data): + if boxed { + buffer.appendInt32(-311786236) + } + _data.text.serialize(buffer, true) + break + case .textSuperscript(let _data): + if boxed { + buffer.appendInt32(-939827711) + } + _data.text.serialize(buffer, true) + break + case .textUnderline(let _data): + if boxed { + buffer.appendInt32(-1054465340) + } + _data.text.serialize(buffer, true) + break + case .textUrl(let _data): + if boxed { + buffer.appendInt32(1009288385) + } + _data.text.serialize(buffer, true) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.webpageId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .textAnchor(let _data): + return ("textAnchor", [("text", _data.text as Any), ("name", _data.name as Any)]) + case .textBold(let _data): + return ("textBold", [("text", _data.text as Any)]) + case .textConcat(let _data): + return ("textConcat", [("texts", _data.texts as Any)]) + case .textEmail(let _data): + return ("textEmail", [("text", _data.text as Any), ("email", _data.email as Any)]) + case .textEmpty: return ("textEmpty", []) - case .textFixed(let text): - return ("textFixed", [("text", text as Any)]) - case .textImage(let documentId, let w, let h): - return ("textImage", [("documentId", documentId as Any), ("w", w as Any), ("h", h as Any)]) - case .textItalic(let text): - return ("textItalic", [("text", text as Any)]) - case .textMarked(let text): - return ("textMarked", [("text", text as Any)]) - case .textPhone(let text, let phone): - return ("textPhone", [("text", text as Any), ("phone", phone as Any)]) - case .textPlain(let text): - return ("textPlain", [("text", text as Any)]) - case .textStrike(let text): - return ("textStrike", [("text", text as Any)]) - case .textSubscript(let text): - return ("textSubscript", [("text", text as Any)]) - case .textSuperscript(let text): - return ("textSuperscript", [("text", text as Any)]) - case .textUnderline(let text): - return ("textUnderline", [("text", text as Any)]) - case .textUrl(let text, let url, let webpageId): - return ("textUrl", [("text", text as Any), ("url", url as Any), ("webpageId", webpageId as Any)]) - } - } - + case .textFixed(let _data): + return ("textFixed", [("text", _data.text as Any)]) + case .textImage(let _data): + return ("textImage", [("documentId", _data.documentId as Any), ("w", _data.w as Any), ("h", _data.h as Any)]) + case .textItalic(let _data): + return ("textItalic", [("text", _data.text as Any)]) + case .textMarked(let _data): + return ("textMarked", [("text", _data.text as Any)]) + case .textPhone(let _data): + return ("textPhone", [("text", _data.text as Any), ("phone", _data.phone as Any)]) + case .textPlain(let _data): + return ("textPlain", [("text", _data.text as Any)]) + case .textStrike(let _data): + return ("textStrike", [("text", _data.text as Any)]) + case .textSubscript(let _data): + return ("textSubscript", [("text", _data.text as Any)]) + case .textSuperscript(let _data): + return ("textSuperscript", [("text", _data.text as Any)]) + case .textUnderline(let _data): + return ("textUnderline", [("text", _data.text as Any)]) + case .textUrl(let _data): + return ("textUrl", [("text", _data.text as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any)]) + } + } + public static func parse_textAnchor(_ reader: BufferReader) -> RichText? { var _1: Api.RichText? if let signature = reader.readInt32() { @@ -220,7 +332,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RichText.textAnchor(text: _1!, name: _2!) + return Api.RichText.textAnchor(Cons_textAnchor(text: _1!, name: _2!)) } else { return nil @@ -233,7 +345,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textBold(text: _1!) + return Api.RichText.textBold(Cons_textBold(text: _1!)) } else { return nil @@ -246,7 +358,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textConcat(texts: _1!) + return Api.RichText.textConcat(Cons_textConcat(texts: _1!)) } else { return nil @@ -262,7 +374,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RichText.textEmail(text: _1!, email: _2!) + return Api.RichText.textEmail(Cons_textEmail(text: _1!, email: _2!)) } else { return nil @@ -278,7 +390,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textFixed(text: _1!) + return Api.RichText.textFixed(Cons_textFixed(text: _1!)) } else { return nil @@ -295,7 +407,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.RichText.textImage(documentId: _1!, w: _2!, h: _3!) + return Api.RichText.textImage(Cons_textImage(documentId: _1!, w: _2!, h: _3!)) } else { return nil @@ -308,7 +420,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textItalic(text: _1!) + return Api.RichText.textItalic(Cons_textItalic(text: _1!)) } else { return nil @@ -321,7 +433,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textMarked(text: _1!) + return Api.RichText.textMarked(Cons_textMarked(text: _1!)) } else { return nil @@ -337,7 +449,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.RichText.textPhone(text: _1!, phone: _2!) + return Api.RichText.textPhone(Cons_textPhone(text: _1!, phone: _2!)) } else { return nil @@ -348,7 +460,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.RichText.textPlain(text: _1!) + return Api.RichText.textPlain(Cons_textPlain(text: _1!)) } else { return nil @@ -361,7 +473,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textStrike(text: _1!) + return Api.RichText.textStrike(Cons_textStrike(text: _1!)) } else { return nil @@ -374,7 +486,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textSubscript(text: _1!) + return Api.RichText.textSubscript(Cons_textSubscript(text: _1!)) } else { return nil @@ -387,7 +499,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textSuperscript(text: _1!) + return Api.RichText.textSuperscript(Cons_textSuperscript(text: _1!)) } else { return nil @@ -400,7 +512,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.RichText.textUnderline(text: _1!) + return Api.RichText.textUnderline(Cons_textUnderline(text: _1!)) } else { return nil @@ -419,40 +531,51 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.RichText.textUrl(text: _1!, url: _2!, webpageId: _3!) + return Api.RichText.textUrl(Cons_textUrl(text: _1!, url: _2!, webpageId: _3!)) } else { return nil } } - } } public extension Api { enum SavedContact: TypeConstructorDescription { - case savedPhoneContact(phone: String, firstName: String, lastName: String, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedPhoneContact(let phone, let firstName, let lastName, let date): - if boxed { - buffer.appendInt32(289586518) - } - serializeString(phone, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedPhoneContact(let phone, let firstName, let lastName, let date): - return ("savedPhoneContact", [("phone", phone as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("date", date as Any)]) - } - } - + public class Cons_savedPhoneContact { + public var phone: String + public var firstName: String + public var lastName: String + public var date: Int32 + public init(phone: String, firstName: String, lastName: String, date: Int32) { + self.phone = phone + self.firstName = firstName + self.lastName = lastName + self.date = date + } + } + case savedPhoneContact(Cons_savedPhoneContact) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedPhoneContact(let _data): + if boxed { + buffer.appendInt32(289586518) + } + serializeString(_data.phone, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedPhoneContact(let _data): + return ("savedPhoneContact", [("phone", _data.phone as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("date", _data.date as Any)]) + } + } + public static func parse_savedPhoneContact(_ reader: BufferReader) -> SavedContact? { var _1: String? _1 = parseString(reader) @@ -467,55 +590,86 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.SavedContact.savedPhoneContact(phone: _1!, firstName: _2!, lastName: _3!, date: _4!) + return Api.SavedContact.savedPhoneContact(Cons_savedPhoneContact(phone: _1!, firstName: _2!, lastName: _3!, date: _4!)) } else { return nil } } - } } public extension Api { indirect enum SavedDialog: TypeConstructorDescription { - case monoForumDialog(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadReactionsCount: Int32, draft: Api.DraftMessage?) - case savedDialog(flags: Int32, peer: Api.Peer, topMessage: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .monoForumDialog(let flags, let peer, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadReactionsCount, let draft): - if boxed { - buffer.appendInt32(1681948327) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(readInboxMaxId, buffer: buffer, boxed: false) - serializeInt32(readOutboxMaxId, buffer: buffer, boxed: false) - serializeInt32(unreadCount, buffer: buffer, boxed: false) - serializeInt32(unreadReactionsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {draft!.serialize(buffer, true)} - break - case .savedDialog(let flags, let peer, let topMessage): - if boxed { - buffer.appendInt32(-1115174036) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topMessage, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .monoForumDialog(let flags, let peer, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadReactionsCount, let draft): - return ("monoForumDialog", [("flags", flags as Any), ("peer", peer as Any), ("topMessage", topMessage as Any), ("readInboxMaxId", readInboxMaxId as Any), ("readOutboxMaxId", readOutboxMaxId as Any), ("unreadCount", unreadCount as Any), ("unreadReactionsCount", unreadReactionsCount as Any), ("draft", draft as Any)]) - case .savedDialog(let flags, let peer, let topMessage): - return ("savedDialog", [("flags", flags as Any), ("peer", peer as Any), ("topMessage", topMessage as Any)]) - } - } - + public class Cons_monoForumDialog { + public var flags: Int32 + public var peer: Api.Peer + public var topMessage: Int32 + public var readInboxMaxId: Int32 + public var readOutboxMaxId: Int32 + public var unreadCount: Int32 + public var unreadReactionsCount: Int32 + public var draft: Api.DraftMessage? + public init(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadReactionsCount: Int32, draft: Api.DraftMessage?) { + self.flags = flags + self.peer = peer + self.topMessage = topMessage + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount + self.unreadReactionsCount = unreadReactionsCount + self.draft = draft + } + } + public class Cons_savedDialog { + public var flags: Int32 + public var peer: Api.Peer + public var topMessage: Int32 + public init(flags: Int32, peer: Api.Peer, topMessage: Int32) { + self.flags = flags + self.peer = peer + self.topMessage = topMessage + } + } + case monoForumDialog(Cons_monoForumDialog) + case savedDialog(Cons_savedDialog) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .monoForumDialog(let _data): + if boxed { + buffer.appendInt32(1681948327) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + serializeInt32(_data.readInboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.readOutboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadReactionsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.draft!.serialize(buffer, true) + } + break + case .savedDialog(let _data): + if boxed { + buffer.appendInt32(-1115174036) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .monoForumDialog(let _data): + return ("monoForumDialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("draft", _data.draft as Any)]) + case .savedDialog(let _data): + return ("savedDialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any)]) + } + } + public static func parse_monoForumDialog(_ reader: BufferReader) -> SavedDialog? { var _1: Int32? _1 = reader.readInt32() @@ -534,9 +688,11 @@ public extension Api { var _7: Int32? _7 = reader.readInt32() var _8: Api.DraftMessage? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.DraftMessage - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.DraftMessage + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -546,7 +702,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 1) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.SavedDialog.monoForumDialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadReactionsCount: _7!, draft: _8) + return Api.SavedDialog.monoForumDialog(Cons_monoForumDialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadReactionsCount: _7!, draft: _8)) } else { return nil @@ -565,40 +721,53 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SavedDialog.savedDialog(flags: _1!, peer: _2!, topMessage: _3!) + return Api.SavedDialog.savedDialog(Cons_savedDialog(flags: _1!, peer: _2!, topMessage: _3!)) } else { return nil } } - } } public extension Api { enum SavedReactionTag: TypeConstructorDescription { - case savedReactionTag(flags: Int32, reaction: Api.Reaction, title: String?, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedReactionTag(let flags, let reaction, let title, let count): - if boxed { - buffer.appendInt32(-881854424) - } - serializeInt32(flags, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedReactionTag(let flags, let reaction, let title, let count): - return ("savedReactionTag", [("flags", flags as Any), ("reaction", reaction as Any), ("title", title as Any), ("count", count as Any)]) - } - } - + public class Cons_savedReactionTag { + public var flags: Int32 + public var reaction: Api.Reaction + public var title: String? + public var count: Int32 + public init(flags: Int32, reaction: Api.Reaction, title: String?, count: Int32) { + self.flags = flags + self.reaction = reaction + self.title = title + self.count = count + } + } + case savedReactionTag(Cons_savedReactionTag) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedReactionTag(let _data): + if boxed { + buffer.appendInt32(-881854424) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.reaction.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedReactionTag(let _data): + return ("savedReactionTag", [("flags", _data.flags as Any), ("reaction", _data.reaction as Any), ("title", _data.title as Any), ("count", _data.count as Any)]) + } + } + public static func parse_savedReactionTag(_ reader: BufferReader) -> SavedReactionTag? { var _1: Int32? _1 = reader.readInt32() @@ -607,7 +776,9 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Reaction } var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: Int32? _4 = reader.readInt32() let _c1 = _1 != nil @@ -615,65 +786,136 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.SavedReactionTag.savedReactionTag(flags: _1!, reaction: _2!, title: _3, count: _4!) + return Api.SavedReactionTag.savedReactionTag(Cons_savedReactionTag(flags: _1!, reaction: _2!, title: _3, count: _4!)) } else { return nil } } - } } public extension Api { enum SavedStarGift: TypeConstructorDescription { - case savedStarGift(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?, collectionId: [Int32]?, prepaidUpgradeHash: String?, dropOriginalDetailsStars: Int64?, giftNum: Int32?, canCraftAt: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt, let collectionId, let prepaidUpgradeHash, let dropOriginalDetailsStars, let giftNum, let canCraftAt): - if boxed { - buffer.appendInt32(1105150972) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {fromId!.serialize(buffer, true)} - serializeInt32(date, buffer: buffer, boxed: false) - gift.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {message!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(msgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(convertStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt64(upgradeStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(canExportAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(transferStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(collectionId!.count)) - for item in collectionId! { + public class Cons_savedStarGift { + public var flags: Int32 + public var fromId: Api.Peer? + public var date: Int32 + public var gift: Api.StarGift + public var message: Api.TextWithEntities? + public var msgId: Int32? + public var savedId: Int64? + public var convertStars: Int64? + public var upgradeStars: Int64? + public var canExportAt: Int32? + public var transferStars: Int64? + public var canTransferAt: Int32? + public var canResellAt: Int32? + public var collectionId: [Int32]? + public var prepaidUpgradeHash: String? + public var dropOriginalDetailsStars: Int64? + public var giftNum: Int32? + public var canCraftAt: Int32? + public init(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?, collectionId: [Int32]?, prepaidUpgradeHash: String?, dropOriginalDetailsStars: Int64?, giftNum: Int32?, canCraftAt: Int32?) { + self.flags = flags + self.fromId = fromId + self.date = date + self.gift = gift + self.message = message + self.msgId = msgId + self.savedId = savedId + self.convertStars = convertStars + self.upgradeStars = upgradeStars + self.canExportAt = canExportAt + self.transferStars = transferStars + self.canTransferAt = canTransferAt + self.canResellAt = canResellAt + self.collectionId = collectionId + self.prepaidUpgradeHash = prepaidUpgradeHash + self.dropOriginalDetailsStars = dropOriginalDetailsStars + self.giftNum = giftNum + self.canCraftAt = canCraftAt + } + } + case savedStarGift(Cons_savedStarGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedStarGift(let _data): + if boxed { + buffer.appendInt32(1105150972) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.fromId!.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.gift.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.message!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.msgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.savedId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.convertStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt64(_data.upgradeStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.canExportAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.transferStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt32(_data.canTransferAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt32(_data.canResellAt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.collectionId!.count)) + for item in _data.collectionId! { serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 16) != 0 {serializeString(prepaidUpgradeHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt64(dropOriginalDetailsStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 19) != 0 {serializeInt32(giftNum!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 20) != 0 {serializeInt32(canCraftAt!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt, let collectionId, let prepaidUpgradeHash, let dropOriginalDetailsStars, let giftNum, let canCraftAt): - return ("savedStarGift", [("flags", flags as Any), ("fromId", fromId as Any), ("date", date as Any), ("gift", gift as Any), ("message", message as Any), ("msgId", msgId as Any), ("savedId", savedId as Any), ("convertStars", convertStars as Any), ("upgradeStars", upgradeStars as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any), ("collectionId", collectionId as Any), ("prepaidUpgradeHash", prepaidUpgradeHash as Any), ("dropOriginalDetailsStars", dropOriginalDetailsStars as Any), ("giftNum", giftNum as Any), ("canCraftAt", canCraftAt as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.prepaidUpgradeHash!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + serializeInt64(_data.dropOriginalDetailsStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 19) != 0 { + serializeInt32(_data.giftNum!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 20) != 0 { + serializeInt32(_data.canCraftAt!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedStarGift(let _data): + return ("savedStarGift", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("date", _data.date as Any), ("gift", _data.gift as Any), ("message", _data.message as Any), ("msgId", _data.msgId as Any), ("savedId", _data.savedId as Any), ("convertStars", _data.convertStars as Any), ("upgradeStars", _data.upgradeStars as Any), ("canExportAt", _data.canExportAt as Any), ("transferStars", _data.transferStars as Any), ("canTransferAt", _data.canTransferAt as Any), ("canResellAt", _data.canResellAt as Any), ("collectionId", _data.collectionId as Any), ("prepaidUpgradeHash", _data.prepaidUpgradeHash as Any), ("dropOriginalDetailsStars", _data.dropOriginalDetailsStars as Any), ("giftNum", _data.giftNum as Any), ("canCraftAt", _data.canCraftAt as Any)]) + } + } + public static func parse_savedStarGift(_ reader: BufferReader) -> SavedStarGift? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Int32? _3 = reader.readInt32() var _4: Api.StarGift? @@ -681,37 +923,65 @@ public extension Api { _4 = Api.parse(reader, signature: signature) as? Api.StarGift } var _5: Api.TextWithEntities? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } var _6: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } var _7: Int64? - if Int(_1!) & Int(1 << 11) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 11) != 0 { + _7 = reader.readInt64() + } var _8: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt64() + } var _9: Int64? - if Int(_1!) & Int(1 << 6) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 6) != 0 { + _9 = reader.readInt64() + } var _10: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _10 = reader.readInt32() + } var _11: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_11 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _11 = reader.readInt64() + } var _12: Int32? - if Int(_1!) & Int(1 << 13) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 13) != 0 { + _12 = reader.readInt32() + } var _13: Int32? - if Int(_1!) & Int(1 << 14) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 14) != 0 { + _13 = reader.readInt32() + } var _14: [Int32]? - if Int(_1!) & Int(1 << 15) != 0 {if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } var _15: String? - if Int(_1!) & Int(1 << 16) != 0 {_15 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _15 = parseString(reader) + } var _16: Int64? - if Int(_1!) & Int(1 << 18) != 0 {_16 = reader.readInt64() } + if Int(_1!) & Int(1 << 18) != 0 { + _16 = reader.readInt64() + } var _17: Int32? - if Int(_1!) & Int(1 << 19) != 0 {_17 = reader.readInt32() } + if Int(_1!) & Int(1 << 19) != 0 { + _17 = reader.readInt32() + } var _18: Int32? - if Int(_1!) & Int(1 << 20) != 0 {_18 = reader.readInt32() } + if Int(_1!) & Int(1 << 20) != 0 { + _18 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = _3 != nil @@ -731,41 +1001,56 @@ public extension Api { let _c17 = (Int(_1!) & Int(1 << 19) == 0) || _17 != nil let _c18 = (Int(_1!) & Int(1 << 20) == 0) || _18 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 { - return Api.SavedStarGift.savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13, collectionId: _14, prepaidUpgradeHash: _15, dropOriginalDetailsStars: _16, giftNum: _17, canCraftAt: _18) + return Api.SavedStarGift.savedStarGift(Cons_savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13, collectionId: _14, prepaidUpgradeHash: _15, dropOriginalDetailsStars: _16, giftNum: _17, canCraftAt: _18)) } else { return nil } } - } } public extension Api { enum SearchPostsFlood: TypeConstructorDescription { - case searchPostsFlood(flags: Int32, totalDaily: Int32, remains: Int32, waitTill: Int32?, starsAmount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchPostsFlood(let flags, let totalDaily, let remains, let waitTill, let starsAmount): - if boxed { - buffer.appendInt32(1040931690) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(totalDaily, buffer: buffer, boxed: false) - serializeInt32(remains, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(waitTill!, buffer: buffer, boxed: false)} - serializeInt64(starsAmount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchPostsFlood(let flags, let totalDaily, let remains, let waitTill, let starsAmount): - return ("searchPostsFlood", [("flags", flags as Any), ("totalDaily", totalDaily as Any), ("remains", remains as Any), ("waitTill", waitTill as Any), ("starsAmount", starsAmount as Any)]) - } - } - + public class Cons_searchPostsFlood { + public var flags: Int32 + public var totalDaily: Int32 + public var remains: Int32 + public var waitTill: Int32? + public var starsAmount: Int64 + public init(flags: Int32, totalDaily: Int32, remains: Int32, waitTill: Int32?, starsAmount: Int64) { + self.flags = flags + self.totalDaily = totalDaily + self.remains = remains + self.waitTill = waitTill + self.starsAmount = starsAmount + } + } + case searchPostsFlood(Cons_searchPostsFlood) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchPostsFlood(let _data): + if boxed { + buffer.appendInt32(1040931690) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.totalDaily, buffer: buffer, boxed: false) + serializeInt32(_data.remains, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.waitTill!, buffer: buffer, boxed: false) + } + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchPostsFlood(let _data): + return ("searchPostsFlood", [("flags", _data.flags as Any), ("totalDaily", _data.totalDaily as Any), ("remains", _data.remains as Any), ("waitTill", _data.waitTill as Any), ("starsAmount", _data.starsAmount as Any)]) + } + } + public static func parse_searchPostsFlood(_ reader: BufferReader) -> SearchPostsFlood? { var _1: Int32? _1 = reader.readInt32() @@ -774,7 +1059,9 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int64? _5 = reader.readInt64() let _c1 = _1 != nil @@ -783,40 +1070,51 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.SearchPostsFlood.searchPostsFlood(flags: _1!, totalDaily: _2!, remains: _3!, waitTill: _4, starsAmount: _5!) + return Api.SearchPostsFlood.searchPostsFlood(Cons_searchPostsFlood(flags: _1!, totalDaily: _2!, remains: _3!, waitTill: _4, starsAmount: _5!)) } else { return nil } } - } } public extension Api { enum SearchResultsCalendarPeriod: TypeConstructorDescription { - case searchResultsCalendarPeriod(date: Int32, minMsgId: Int32, maxMsgId: Int32, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultsCalendarPeriod(let date, let minMsgId, let maxMsgId, let count): - if boxed { - buffer.appendInt32(-911191137) - } - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(minMsgId, buffer: buffer, boxed: false) - serializeInt32(maxMsgId, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultsCalendarPeriod(let date, let minMsgId, let maxMsgId, let count): - return ("searchResultsCalendarPeriod", [("date", date as Any), ("minMsgId", minMsgId as Any), ("maxMsgId", maxMsgId as Any), ("count", count as Any)]) - } - } - + public class Cons_searchResultsCalendarPeriod { + public var date: Int32 + public var minMsgId: Int32 + public var maxMsgId: Int32 + public var count: Int32 + public init(date: Int32, minMsgId: Int32, maxMsgId: Int32, count: Int32) { + self.date = date + self.minMsgId = minMsgId + self.maxMsgId = maxMsgId + self.count = count + } + } + case searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchResultsCalendarPeriod(let _data): + if boxed { + buffer.appendInt32(-911191137) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.minMsgId, buffer: buffer, boxed: false) + serializeInt32(_data.maxMsgId, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchResultsCalendarPeriod(let _data): + return ("searchResultsCalendarPeriod", [("date", _data.date as Any), ("minMsgId", _data.minMsgId as Any), ("maxMsgId", _data.maxMsgId as Any), ("count", _data.count as Any)]) + } + } + public static func parse_searchResultsCalendarPeriod(_ reader: BufferReader) -> SearchResultsCalendarPeriod? { var _1: Int32? _1 = reader.readInt32() @@ -831,39 +1129,48 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.SearchResultsCalendarPeriod.searchResultsCalendarPeriod(date: _1!, minMsgId: _2!, maxMsgId: _3!, count: _4!) + return Api.SearchResultsCalendarPeriod.searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod(date: _1!, minMsgId: _2!, maxMsgId: _3!, count: _4!)) } else { return nil } } - } } public extension Api { enum SearchResultsPosition: TypeConstructorDescription { - case searchResultPosition(msgId: Int32, date: Int32, offset: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultPosition(let msgId, let date, let offset): - if boxed { - buffer.appendInt32(2137295719) - } - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultPosition(let msgId, let date, let offset): - return ("searchResultPosition", [("msgId", msgId as Any), ("date", date as Any), ("offset", offset as Any)]) - } - } - + public class Cons_searchResultPosition { + public var msgId: Int32 + public var date: Int32 + public var offset: Int32 + public init(msgId: Int32, date: Int32, offset: Int32) { + self.msgId = msgId + self.date = date + self.offset = offset + } + } + case searchResultPosition(Cons_searchResultPosition) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchResultPosition(let _data): + if boxed { + buffer.appendInt32(2137295719) + } + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchResultPosition(let _data): + return ("searchResultPosition", [("msgId", _data.msgId as Any), ("date", _data.date as Any), ("offset", _data.offset as Any)]) + } + } + public static func parse_searchResultPosition(_ reader: BufferReader) -> SearchResultsPosition? { var _1: Int32? _1 = reader.readInt32() @@ -875,39 +1182,48 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SearchResultsPosition.searchResultPosition(msgId: _1!, date: _2!, offset: _3!) + return Api.SearchResultsPosition.searchResultPosition(Cons_searchResultPosition(msgId: _1!, date: _2!, offset: _3!)) } else { return nil } } - } } public extension Api { enum SecureCredentialsEncrypted: TypeConstructorDescription { - case secureCredentialsEncrypted(data: Buffer, hash: Buffer, secret: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureCredentialsEncrypted(let data, let hash, let secret): - if boxed { - buffer.appendInt32(871426631) - } - serializeBytes(data, buffer: buffer, boxed: false) - serializeBytes(hash, buffer: buffer, boxed: false) - serializeBytes(secret, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureCredentialsEncrypted(let data, let hash, let secret): - return ("secureCredentialsEncrypted", [("data", data as Any), ("hash", hash as Any), ("secret", secret as Any)]) - } - } - + public class Cons_secureCredentialsEncrypted { + public var data: Buffer + public var hash: Buffer + public var secret: Buffer + public init(data: Buffer, hash: Buffer, secret: Buffer) { + self.data = data + self.hash = hash + self.secret = secret + } + } + case secureCredentialsEncrypted(Cons_secureCredentialsEncrypted) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureCredentialsEncrypted(let _data): + if boxed { + buffer.appendInt32(871426631) + } + serializeBytes(_data.data, buffer: buffer, boxed: false) + serializeBytes(_data.hash, buffer: buffer, boxed: false) + serializeBytes(_data.secret, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureCredentialsEncrypted(let _data): + return ("secureCredentialsEncrypted", [("data", _data.data as Any), ("hash", _data.hash as Any), ("secret", _data.secret as Any)]) + } + } + public static func parse_secureCredentialsEncrypted(_ reader: BufferReader) -> SecureCredentialsEncrypted? { var _1: Buffer? _1 = parseBytes(reader) @@ -919,39 +1235,48 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureCredentialsEncrypted.secureCredentialsEncrypted(data: _1!, hash: _2!, secret: _3!) + return Api.SecureCredentialsEncrypted.secureCredentialsEncrypted(Cons_secureCredentialsEncrypted(data: _1!, hash: _2!, secret: _3!)) } else { return nil } } - } } public extension Api { enum SecureData: TypeConstructorDescription { - case secureData(data: Buffer, dataHash: Buffer, secret: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureData(let data, let dataHash, let secret): - if boxed { - buffer.appendInt32(-1964327229) - } - serializeBytes(data, buffer: buffer, boxed: false) - serializeBytes(dataHash, buffer: buffer, boxed: false) - serializeBytes(secret, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureData(let data, let dataHash, let secret): - return ("secureData", [("data", data as Any), ("dataHash", dataHash as Any), ("secret", secret as Any)]) - } - } - + public class Cons_secureData { + public var data: Buffer + public var dataHash: Buffer + public var secret: Buffer + public init(data: Buffer, dataHash: Buffer, secret: Buffer) { + self.data = data + self.dataHash = dataHash + self.secret = secret + } + } + case secureData(Cons_secureData) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureData(let _data): + if boxed { + buffer.appendInt32(-1964327229) + } + serializeBytes(_data.data, buffer: buffer, boxed: false) + serializeBytes(_data.dataHash, buffer: buffer, boxed: false) + serializeBytes(_data.secret, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureData(let _data): + return ("secureData", [("data", _data.data as Any), ("dataHash", _data.dataHash as Any), ("secret", _data.secret as Any)]) + } + } + public static func parse_secureData(_ reader: BufferReader) -> SecureData? { var _1: Buffer? _1 = parseBytes(reader) @@ -963,52 +1288,68 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureData.secureData(data: _1!, dataHash: _2!, secret: _3!) + return Api.SecureData.secureData(Cons_secureData(data: _1!, dataHash: _2!, secret: _3!)) } else { return nil } } - } } public extension Api { enum SecureFile: TypeConstructorDescription { - case secureFile(id: Int64, accessHash: Int64, size: Int64, dcId: Int32, date: Int32, fileHash: Buffer, secret: Buffer) + public class Cons_secureFile { + public var id: Int64 + public var accessHash: Int64 + public var size: Int64 + public var dcId: Int32 + public var date: Int32 + public var fileHash: Buffer + public var secret: Buffer + public init(id: Int64, accessHash: Int64, size: Int64, dcId: Int32, date: Int32, fileHash: Buffer, secret: Buffer) { + self.id = id + self.accessHash = accessHash + self.size = size + self.dcId = dcId + self.date = date + self.fileHash = fileHash + self.secret = secret + } + } + case secureFile(Cons_secureFile) case secureFileEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureFile(let id, let accessHash, let size, let dcId, let date, let fileHash, let secret): - if boxed { - buffer.appendInt32(2097791614) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt64(size, buffer: buffer, boxed: false) - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeBytes(secret, buffer: buffer, boxed: false) - break - case .secureFileEmpty: - if boxed { - buffer.appendInt32(1679398724) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureFile(let id, let accessHash, let size, let dcId, let date, let fileHash, let secret): - return ("secureFile", [("id", id as Any), ("accessHash", accessHash as Any), ("size", size as Any), ("dcId", dcId as Any), ("date", date as Any), ("fileHash", fileHash as Any), ("secret", secret as Any)]) - case .secureFileEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureFile(let _data): + if boxed { + buffer.appendInt32(2097791614) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt64(_data.size, buffer: buffer, boxed: false) + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeBytes(_data.secret, buffer: buffer, boxed: false) + break + case .secureFileEmpty: + if boxed { + buffer.appendInt32(1679398724) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureFile(let _data): + return ("secureFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("dcId", _data.dcId as Any), ("date", _data.date as Any), ("fileHash", _data.fileHash as Any), ("secret", _data.secret as Any)]) + case .secureFileEmpty: return ("secureFileEmpty", []) - } - } - + } + } + public static func parse_secureFile(_ reader: BufferReader) -> SecureFile? { var _1: Int64? _1 = reader.readInt64() @@ -1032,7 +1373,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.SecureFile.secureFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, date: _5!, fileHash: _6!, secret: _7!) + return Api.SecureFile.secureFile(Cons_secureFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, date: _5!, fileHash: _6!, secret: _7!)) } else { return nil @@ -1041,55 +1382,65 @@ public extension Api { public static func parse_secureFileEmpty(_ reader: BufferReader) -> SecureFile? { return Api.SecureFile.secureFileEmpty } - } } public extension Api { enum SecurePasswordKdfAlgo: TypeConstructorDescription { - case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: Buffer) - case securePasswordKdfAlgoSHA512(salt: Buffer) + public class Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000 { + public var salt: Buffer + public init(salt: Buffer) { + self.salt = salt + } + } + public class Cons_securePasswordKdfAlgoSHA512 { + public var salt: Buffer + public init(salt: Buffer) { + self.salt = salt + } + } + case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000) + case securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512) case securePasswordKdfAlgoUnknown - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt): - if boxed { - buffer.appendInt32(-1141711456) - } - serializeBytes(salt, buffer: buffer, boxed: false) - break - case .securePasswordKdfAlgoSHA512(let salt): - if boxed { - buffer.appendInt32(-2042159726) - } - serializeBytes(salt, buffer: buffer, boxed: false) - break - case .securePasswordKdfAlgoUnknown: - if boxed { - buffer.appendInt32(4883767) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let salt): - return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", salt as Any)]) - case .securePasswordKdfAlgoSHA512(let salt): - return ("securePasswordKdfAlgoSHA512", [("salt", salt as Any)]) - case .securePasswordKdfAlgoUnknown: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): + if boxed { + buffer.appendInt32(-1141711456) + } + serializeBytes(_data.salt, buffer: buffer, boxed: false) + break + case .securePasswordKdfAlgoSHA512(let _data): + if boxed { + buffer.appendInt32(-2042159726) + } + serializeBytes(_data.salt, buffer: buffer, boxed: false) + break + case .securePasswordKdfAlgoUnknown: + if boxed { + buffer.appendInt32(4883767) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): + return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", _data.salt as Any)]) + case .securePasswordKdfAlgoSHA512(let _data): + return ("securePasswordKdfAlgoSHA512", [("salt", _data.salt as Any)]) + case .securePasswordKdfAlgoUnknown: return ("securePasswordKdfAlgoUnknown", []) - } - } - + } + } + public static func parse_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { var _1: Buffer? _1 = parseBytes(reader) let _c1 = _1 != nil if _c1 { - return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!) + return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!)) } else { return nil @@ -1100,7 +1451,7 @@ public extension Api { _1 = parseBytes(reader) let _c1 = _1 != nil if _c1 { - return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(salt: _1!) + return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512(salt: _1!)) } else { return nil @@ -1109,6 +1460,5 @@ public extension Api { public static func parse_securePasswordKdfAlgoUnknown(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoUnknown } - } } diff --git a/submodules/TelegramApi/Sources/Api24.swift b/submodules/TelegramApi/Sources/Api24.swift index 22a2ae9947..ca98335e25 100644 --- a/submodules/TelegramApi/Sources/Api24.swift +++ b/submodules/TelegramApi/Sources/Api24.swift @@ -1,40 +1,52 @@ public extension Api { enum SecurePlainData: TypeConstructorDescription { - case securePlainEmail(email: String) - case securePlainPhone(phone: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .securePlainEmail(let email): - if boxed { - buffer.appendInt32(569137759) - } - serializeString(email, buffer: buffer, boxed: false) - break - case .securePlainPhone(let phone): - if boxed { - buffer.appendInt32(2103482845) - } - serializeString(phone, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .securePlainEmail(let email): - return ("securePlainEmail", [("email", email as Any)]) - case .securePlainPhone(let phone): - return ("securePlainPhone", [("phone", phone as Any)]) - } - } - + public class Cons_securePlainEmail { + public var email: String + public init(email: String) { + self.email = email + } + } + public class Cons_securePlainPhone { + public var phone: String + public init(phone: String) { + self.phone = phone + } + } + case securePlainEmail(Cons_securePlainEmail) + case securePlainPhone(Cons_securePlainPhone) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .securePlainEmail(let _data): + if boxed { + buffer.appendInt32(569137759) + } + serializeString(_data.email, buffer: buffer, boxed: false) + break + case .securePlainPhone(let _data): + if boxed { + buffer.appendInt32(2103482845) + } + serializeString(_data.phone, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .securePlainEmail(let _data): + return ("securePlainEmail", [("email", _data.email as Any)]) + case .securePlainPhone(let _data): + return ("securePlainPhone", [("phone", _data.phone as Any)]) + } + } + public static func parse_securePlainEmail(_ reader: BufferReader) -> SecurePlainData? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.SecurePlainData.securePlainEmail(email: _1!) + return Api.SecurePlainData.securePlainEmail(Cons_securePlainEmail(email: _1!)) } else { return nil @@ -45,51 +57,64 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.SecurePlainData.securePlainPhone(phone: _1!) + return Api.SecurePlainData.securePlainPhone(Cons_securePlainPhone(phone: _1!)) } else { return nil } } - } } public extension Api { enum SecureRequiredType: TypeConstructorDescription { - case secureRequiredType(flags: Int32, type: Api.SecureValueType) - case secureRequiredTypeOneOf(types: [Api.SecureRequiredType]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureRequiredType(let flags, let type): - if boxed { - buffer.appendInt32(-2103600678) - } - serializeInt32(flags, buffer: buffer, boxed: false) - type.serialize(buffer, true) - break - case .secureRequiredTypeOneOf(let types): - if boxed { - buffer.appendInt32(41187252) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(types.count)) - for item in types { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureRequiredType(let flags, let type): - return ("secureRequiredType", [("flags", flags as Any), ("type", type as Any)]) - case .secureRequiredTypeOneOf(let types): - return ("secureRequiredTypeOneOf", [("types", types as Any)]) - } - } - + public class Cons_secureRequiredType { + public var flags: Int32 + public var type: Api.SecureValueType + public init(flags: Int32, type: Api.SecureValueType) { + self.flags = flags + self.type = type + } + } + public class Cons_secureRequiredTypeOneOf { + public var types: [Api.SecureRequiredType] + public init(types: [Api.SecureRequiredType]) { + self.types = types + } + } + case secureRequiredType(Cons_secureRequiredType) + case secureRequiredTypeOneOf(Cons_secureRequiredTypeOneOf) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureRequiredType(let _data): + if boxed { + buffer.appendInt32(-2103600678) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.type.serialize(buffer, true) + break + case .secureRequiredTypeOneOf(let _data): + if boxed { + buffer.appendInt32(41187252) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.types.count)) + for item in _data.types { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureRequiredType(let _data): + return ("secureRequiredType", [("flags", _data.flags as Any), ("type", _data.type as Any)]) + case .secureRequiredTypeOneOf(let _data): + return ("secureRequiredTypeOneOf", [("types", _data.types as Any)]) + } + } + public static func parse_secureRequiredType(_ reader: BufferReader) -> SecureRequiredType? { var _1: Int32? _1 = reader.readInt32() @@ -100,7 +125,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SecureRequiredType.secureRequiredType(flags: _1!, type: _2!) + return Api.SecureRequiredType.secureRequiredType(Cons_secureRequiredType(flags: _1!, type: _2!)) } else { return nil @@ -113,39 +138,48 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.SecureRequiredType.secureRequiredTypeOneOf(types: _1!) + return Api.SecureRequiredType.secureRequiredTypeOneOf(Cons_secureRequiredTypeOneOf(types: _1!)) } else { return nil } } - } } public extension Api { enum SecureSecretSettings: TypeConstructorDescription { - case secureSecretSettings(secureAlgo: Api.SecurePasswordKdfAlgo, secureSecret: Buffer, secureSecretId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureSecretSettings(let secureAlgo, let secureSecret, let secureSecretId): - if boxed { - buffer.appendInt32(354925740) - } - secureAlgo.serialize(buffer, true) - serializeBytes(secureSecret, buffer: buffer, boxed: false) - serializeInt64(secureSecretId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureSecretSettings(let secureAlgo, let secureSecret, let secureSecretId): - return ("secureSecretSettings", [("secureAlgo", secureAlgo as Any), ("secureSecret", secureSecret as Any), ("secureSecretId", secureSecretId as Any)]) - } - } - + public class Cons_secureSecretSettings { + public var secureAlgo: Api.SecurePasswordKdfAlgo + public var secureSecret: Buffer + public var secureSecretId: Int64 + public init(secureAlgo: Api.SecurePasswordKdfAlgo, secureSecret: Buffer, secureSecretId: Int64) { + self.secureAlgo = secureAlgo + self.secureSecret = secureSecret + self.secureSecretId = secureSecretId + } + } + case secureSecretSettings(Cons_secureSecretSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureSecretSettings(let _data): + if boxed { + buffer.appendInt32(354925740) + } + _data.secureAlgo.serialize(buffer, true) + serializeBytes(_data.secureSecret, buffer: buffer, boxed: false) + serializeInt64(_data.secureSecretId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureSecretSettings(let _data): + return ("secureSecretSettings", [("secureAlgo", _data.secureAlgo as Any), ("secureSecret", _data.secureSecret as Any), ("secureSecretId", _data.secureSecretId as Any)]) + } + } + public static func parse_secureSecretSettings(_ reader: BufferReader) -> SecureSecretSettings? { var _1: Api.SecurePasswordKdfAlgo? if let signature = reader.readInt32() { @@ -159,54 +193,91 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureSecretSettings.secureSecretSettings(secureAlgo: _1!, secureSecret: _2!, secureSecretId: _3!) + return Api.SecureSecretSettings.secureSecretSettings(Cons_secureSecretSettings(secureAlgo: _1!, secureSecret: _2!, secureSecretId: _3!)) } else { return nil } } - } } public extension Api { enum SecureValue: TypeConstructorDescription { - case secureValue(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.SecureFile?, reverseSide: Api.SecureFile?, selfie: Api.SecureFile?, translation: [Api.SecureFile]?, files: [Api.SecureFile]?, plainData: Api.SecurePlainData?, hash: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData, let hash): - if boxed { - buffer.appendInt32(411017418) + public class Cons_secureValue { + public var flags: Int32 + public var type: Api.SecureValueType + public var data: Api.SecureData? + public var frontSide: Api.SecureFile? + public var reverseSide: Api.SecureFile? + public var selfie: Api.SecureFile? + public var translation: [Api.SecureFile]? + public var files: [Api.SecureFile]? + public var plainData: Api.SecurePlainData? + public var hash: Buffer + public init(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.SecureFile?, reverseSide: Api.SecureFile?, selfie: Api.SecureFile?, translation: [Api.SecureFile]?, files: [Api.SecureFile]?, plainData: Api.SecurePlainData?, hash: Buffer) { + self.flags = flags + self.type = type + self.data = data + self.frontSide = frontSide + self.reverseSide = reverseSide + self.selfie = selfie + self.translation = translation + self.files = files + self.plainData = plainData + self.hash = hash + } + } + case secureValue(Cons_secureValue) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureValue(let _data): + if boxed { + buffer.appendInt32(411017418) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.type.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.data!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.frontSide!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.reverseSide!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.selfie!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.translation!.count)) + for item in _data.translation! { + item.serialize(buffer, true) } - serializeInt32(flags, buffer: buffer, boxed: false) - type.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {data!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {frontSide!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {reverseSide!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {selfie!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(translation!.count)) - for item in translation! { + } + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.files!.count)) + for item in _data.files! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(files!.count)) - for item in files! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 5) != 0 {plainData!.serialize(buffer, true)} - serializeBytes(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData, let hash): - return ("secureValue", [("flags", flags as Any), ("type", type as Any), ("data", data as Any), ("frontSide", frontSide as Any), ("reverseSide", reverseSide as Any), ("selfie", selfie as Any), ("translation", translation as Any), ("files", files as Any), ("plainData", plainData as Any), ("hash", hash as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.plainData!.serialize(buffer, true) + } + serializeBytes(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureValue(let _data): + return ("secureValue", [("flags", _data.flags as Any), ("type", _data.type as Any), ("data", _data.data as Any), ("frontSide", _data.frontSide as Any), ("reverseSide", _data.reverseSide as Any), ("selfie", _data.selfie as Any), ("translation", _data.translation as Any), ("files", _data.files as Any), ("plainData", _data.plainData as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_secureValue(_ reader: BufferReader) -> SecureValue? { var _1: Int32? _1 = reader.readInt32() @@ -215,33 +286,47 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType } var _3: Api.SecureData? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.SecureData - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.SecureData + } + } var _4: Api.SecureFile? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.SecureFile - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.SecureFile + } + } var _5: Api.SecureFile? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.SecureFile - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.SecureFile + } + } var _6: Api.SecureFile? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.SecureFile - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.SecureFile + } + } var _7: [Api.SecureFile]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureFile.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureFile.self) + } + } var _8: [Api.SecureFile]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureFile.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureFile.self) + } + } var _9: Api.SecurePlainData? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.SecurePlainData - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.SecurePlainData + } + } var _10: Buffer? _10 = parseBytes(reader) let _c1 = _1 != nil @@ -255,136 +340,227 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 5) == 0) || _9 != nil let _c10 = _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.SecureValue.secureValue(flags: _1!, type: _2!, data: _3, frontSide: _4, reverseSide: _5, selfie: _6, translation: _7, files: _8, plainData: _9, hash: _10!) + return Api.SecureValue.secureValue(Cons_secureValue(flags: _1!, type: _2!, data: _3, frontSide: _4, reverseSide: _5, selfie: _6, translation: _7, files: _8, plainData: _9, hash: _10!)) } else { return nil } } - } } public extension Api { enum SecureValueError: TypeConstructorDescription { - case secureValueError(type: Api.SecureValueType, hash: Buffer, text: String) - case secureValueErrorData(type: Api.SecureValueType, dataHash: Buffer, field: String, text: String) - case secureValueErrorFile(type: Api.SecureValueType, fileHash: Buffer, text: String) - case secureValueErrorFiles(type: Api.SecureValueType, fileHash: [Buffer], text: String) - case secureValueErrorFrontSide(type: Api.SecureValueType, fileHash: Buffer, text: String) - case secureValueErrorReverseSide(type: Api.SecureValueType, fileHash: Buffer, text: String) - case secureValueErrorSelfie(type: Api.SecureValueType, fileHash: Buffer, text: String) - case secureValueErrorTranslationFile(type: Api.SecureValueType, fileHash: Buffer, text: String) - case secureValueErrorTranslationFiles(type: Api.SecureValueType, fileHash: [Buffer], text: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureValueError(let type, let hash, let text): - if boxed { - buffer.appendInt32(-2036501105) - } - type.serialize(buffer, true) - serializeBytes(hash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorData(let type, let dataHash, let field, let text): - if boxed { - buffer.appendInt32(-391902247) - } - type.serialize(buffer, true) - serializeBytes(dataHash, buffer: buffer, boxed: false) - serializeString(field, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorFile(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(2054162547) - } - type.serialize(buffer, true) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorFiles(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(1717706985) - } - type.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(fileHash.count)) - for item in fileHash { - serializeBytes(item, buffer: buffer, boxed: false) - } - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorFrontSide(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(12467706) - } - type.serialize(buffer, true) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorReverseSide(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(-2037765467) - } - type.serialize(buffer, true) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorSelfie(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(-449327402) - } - type.serialize(buffer, true) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorTranslationFile(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(-1592506512) - } - type.serialize(buffer, true) - serializeBytes(fileHash, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .secureValueErrorTranslationFiles(let type, let fileHash, let text): - if boxed { - buffer.appendInt32(878931416) - } - type.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(fileHash.count)) - for item in fileHash { - serializeBytes(item, buffer: buffer, boxed: false) - } - serializeString(text, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureValueError(let type, let hash, let text): - return ("secureValueError", [("type", type as Any), ("hash", hash as Any), ("text", text as Any)]) - case .secureValueErrorData(let type, let dataHash, let field, let text): - return ("secureValueErrorData", [("type", type as Any), ("dataHash", dataHash as Any), ("field", field as Any), ("text", text as Any)]) - case .secureValueErrorFile(let type, let fileHash, let text): - return ("secureValueErrorFile", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorFiles(let type, let fileHash, let text): - return ("secureValueErrorFiles", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorFrontSide(let type, let fileHash, let text): - return ("secureValueErrorFrontSide", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorReverseSide(let type, let fileHash, let text): - return ("secureValueErrorReverseSide", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorSelfie(let type, let fileHash, let text): - return ("secureValueErrorSelfie", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorTranslationFile(let type, let fileHash, let text): - return ("secureValueErrorTranslationFile", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - case .secureValueErrorTranslationFiles(let type, let fileHash, let text): - return ("secureValueErrorTranslationFiles", [("type", type as Any), ("fileHash", fileHash as Any), ("text", text as Any)]) - } - } - + public class Cons_secureValueError { + public var type: Api.SecureValueType + public var hash: Buffer + public var text: String + public init(type: Api.SecureValueType, hash: Buffer, text: String) { + self.type = type + self.hash = hash + self.text = text + } + } + public class Cons_secureValueErrorData { + public var type: Api.SecureValueType + public var dataHash: Buffer + public var field: String + public var text: String + public init(type: Api.SecureValueType, dataHash: Buffer, field: String, text: String) { + self.type = type + self.dataHash = dataHash + self.field = field + self.text = text + } + } + public class Cons_secureValueErrorFile { + public var type: Api.SecureValueType + public var fileHash: Buffer + public var text: String + public init(type: Api.SecureValueType, fileHash: Buffer, text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorFiles { + public var type: Api.SecureValueType + public var fileHash: [Buffer] + public var text: String + public init(type: Api.SecureValueType, fileHash: [Buffer], text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorFrontSide { + public var type: Api.SecureValueType + public var fileHash: Buffer + public var text: String + public init(type: Api.SecureValueType, fileHash: Buffer, text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorReverseSide { + public var type: Api.SecureValueType + public var fileHash: Buffer + public var text: String + public init(type: Api.SecureValueType, fileHash: Buffer, text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorSelfie { + public var type: Api.SecureValueType + public var fileHash: Buffer + public var text: String + public init(type: Api.SecureValueType, fileHash: Buffer, text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorTranslationFile { + public var type: Api.SecureValueType + public var fileHash: Buffer + public var text: String + public init(type: Api.SecureValueType, fileHash: Buffer, text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + public class Cons_secureValueErrorTranslationFiles { + public var type: Api.SecureValueType + public var fileHash: [Buffer] + public var text: String + public init(type: Api.SecureValueType, fileHash: [Buffer], text: String) { + self.type = type + self.fileHash = fileHash + self.text = text + } + } + case secureValueError(Cons_secureValueError) + case secureValueErrorData(Cons_secureValueErrorData) + case secureValueErrorFile(Cons_secureValueErrorFile) + case secureValueErrorFiles(Cons_secureValueErrorFiles) + case secureValueErrorFrontSide(Cons_secureValueErrorFrontSide) + case secureValueErrorReverseSide(Cons_secureValueErrorReverseSide) + case secureValueErrorSelfie(Cons_secureValueErrorSelfie) + case secureValueErrorTranslationFile(Cons_secureValueErrorTranslationFile) + case secureValueErrorTranslationFiles(Cons_secureValueErrorTranslationFiles) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureValueError(let _data): + if boxed { + buffer.appendInt32(-2036501105) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.hash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorData(let _data): + if boxed { + buffer.appendInt32(-391902247) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.dataHash, buffer: buffer, boxed: false) + serializeString(_data.field, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorFile(let _data): + if boxed { + buffer.appendInt32(2054162547) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorFiles(let _data): + if boxed { + buffer.appendInt32(1717706985) + } + _data.type.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.fileHash.count)) + for item in _data.fileHash { + serializeBytes(item, buffer: buffer, boxed: false) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorFrontSide(let _data): + if boxed { + buffer.appendInt32(12467706) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorReverseSide(let _data): + if boxed { + buffer.appendInt32(-2037765467) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorSelfie(let _data): + if boxed { + buffer.appendInt32(-449327402) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorTranslationFile(let _data): + if boxed { + buffer.appendInt32(-1592506512) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.fileHash, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .secureValueErrorTranslationFiles(let _data): + if boxed { + buffer.appendInt32(878931416) + } + _data.type.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.fileHash.count)) + for item in _data.fileHash { + serializeBytes(item, buffer: buffer, boxed: false) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureValueError(let _data): + return ("secureValueError", [("type", _data.type as Any), ("hash", _data.hash as Any), ("text", _data.text as Any)]) + case .secureValueErrorData(let _data): + return ("secureValueErrorData", [("type", _data.type as Any), ("dataHash", _data.dataHash as Any), ("field", _data.field as Any), ("text", _data.text as Any)]) + case .secureValueErrorFile(let _data): + return ("secureValueErrorFile", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorFiles(let _data): + return ("secureValueErrorFiles", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorFrontSide(let _data): + return ("secureValueErrorFrontSide", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorReverseSide(let _data): + return ("secureValueErrorReverseSide", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorSelfie(let _data): + return ("secureValueErrorSelfie", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorTranslationFile(let _data): + return ("secureValueErrorTranslationFile", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + case .secureValueErrorTranslationFiles(let _data): + return ("secureValueErrorTranslationFiles", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + } + } + public static func parse_secureValueError(_ reader: BufferReader) -> SecureValueError? { var _1: Api.SecureValueType? if let signature = reader.readInt32() { @@ -398,7 +574,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueError(type: _1!, hash: _2!, text: _3!) + return Api.SecureValueError.secureValueError(Cons_secureValueError(type: _1!, hash: _2!, text: _3!)) } else { return nil @@ -420,7 +596,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.SecureValueError.secureValueErrorData(type: _1!, dataHash: _2!, field: _3!, text: _4!) + return Api.SecureValueError.secureValueErrorData(Cons_secureValueErrorData(type: _1!, dataHash: _2!, field: _3!, text: _4!)) } else { return nil @@ -439,7 +615,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFile(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorFile(Cons_secureValueErrorFile(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -460,7 +636,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFiles(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorFiles(Cons_secureValueErrorFiles(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -479,7 +655,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFrontSide(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorFrontSide(Cons_secureValueErrorFrontSide(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -498,7 +674,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorReverseSide(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorReverseSide(Cons_secureValueErrorReverseSide(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -517,7 +693,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorSelfie(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorSelfie(Cons_secureValueErrorSelfie(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -536,7 +712,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorTranslationFile(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorTranslationFile(Cons_secureValueErrorTranslationFile(type: _1!, fileHash: _2!, text: _3!)) } else { return nil @@ -557,38 +733,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorTranslationFiles(type: _1!, fileHash: _2!, text: _3!) + return Api.SecureValueError.secureValueErrorTranslationFiles(Cons_secureValueErrorTranslationFiles(type: _1!, fileHash: _2!, text: _3!)) } else { return nil } } - } } public extension Api { enum SecureValueHash: TypeConstructorDescription { - case secureValueHash(type: Api.SecureValueType, hash: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureValueHash(let type, let hash): - if boxed { - buffer.appendInt32(-316748368) - } - type.serialize(buffer, true) - serializeBytes(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureValueHash(let type, let hash): - return ("secureValueHash", [("type", type as Any), ("hash", hash as Any)]) - } - } - + public class Cons_secureValueHash { + public var type: Api.SecureValueType + public var hash: Buffer + public init(type: Api.SecureValueType, hash: Buffer) { + self.type = type + self.hash = hash + } + } + case secureValueHash(Cons_secureValueHash) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureValueHash(let _data): + if boxed { + buffer.appendInt32(-316748368) + } + _data.type.serialize(buffer, true) + serializeBytes(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureValueHash(let _data): + return ("secureValueHash", [("type", _data.type as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_secureValueHash(_ reader: BufferReader) -> SecureValueHash? { var _1: Api.SecureValueType? if let signature = reader.readInt32() { @@ -599,13 +782,12 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SecureValueHash.secureValueHash(type: _1!, hash: _2!) + return Api.SecureValueHash.secureValueHash(Cons_secureValueHash(type: _1!, hash: _2!)) } else { return nil } } - } } public extension Api { @@ -623,121 +805,108 @@ public extension Api { case secureValueTypeRentalAgreement case secureValueTypeTemporaryRegistration case secureValueTypeUtilityBill - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureValueTypeAddress: - if boxed { - buffer.appendInt32(-874308058) - } - - break - case .secureValueTypeBankStatement: - if boxed { - buffer.appendInt32(-1995211763) - } - - break - case .secureValueTypeDriverLicense: - if boxed { - buffer.appendInt32(115615172) - } - - break - case .secureValueTypeEmail: - if boxed { - buffer.appendInt32(-1908627474) - } - - break - case .secureValueTypeIdentityCard: - if boxed { - buffer.appendInt32(-1596951477) - } - - break - case .secureValueTypeInternalPassport: - if boxed { - buffer.appendInt32(-1717268701) - } - - break - case .secureValueTypePassport: - if boxed { - buffer.appendInt32(1034709504) - } - - break - case .secureValueTypePassportRegistration: - if boxed { - buffer.appendInt32(-1713143702) - } - - break - case .secureValueTypePersonalDetails: - if boxed { - buffer.appendInt32(-1658158621) - } - - break - case .secureValueTypePhone: - if boxed { - buffer.appendInt32(-1289704741) - } - - break - case .secureValueTypeRentalAgreement: - if boxed { - buffer.appendInt32(-1954007928) - } - - break - case .secureValueTypeTemporaryRegistration: - if boxed { - buffer.appendInt32(-368907213) - } - - break - case .secureValueTypeUtilityBill: - if boxed { - buffer.appendInt32(-63531698) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureValueTypeAddress: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .secureValueTypeAddress: + if boxed { + buffer.appendInt32(-874308058) + } + break + case .secureValueTypeBankStatement: + if boxed { + buffer.appendInt32(-1995211763) + } + break + case .secureValueTypeDriverLicense: + if boxed { + buffer.appendInt32(115615172) + } + break + case .secureValueTypeEmail: + if boxed { + buffer.appendInt32(-1908627474) + } + break + case .secureValueTypeIdentityCard: + if boxed { + buffer.appendInt32(-1596951477) + } + break + case .secureValueTypeInternalPassport: + if boxed { + buffer.appendInt32(-1717268701) + } + break + case .secureValueTypePassport: + if boxed { + buffer.appendInt32(1034709504) + } + break + case .secureValueTypePassportRegistration: + if boxed { + buffer.appendInt32(-1713143702) + } + break + case .secureValueTypePersonalDetails: + if boxed { + buffer.appendInt32(-1658158621) + } + break + case .secureValueTypePhone: + if boxed { + buffer.appendInt32(-1289704741) + } + break + case .secureValueTypeRentalAgreement: + if boxed { + buffer.appendInt32(-1954007928) + } + break + case .secureValueTypeTemporaryRegistration: + if boxed { + buffer.appendInt32(-368907213) + } + break + case .secureValueTypeUtilityBill: + if boxed { + buffer.appendInt32(-63531698) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .secureValueTypeAddress: return ("secureValueTypeAddress", []) - case .secureValueTypeBankStatement: + case .secureValueTypeBankStatement: return ("secureValueTypeBankStatement", []) - case .secureValueTypeDriverLicense: + case .secureValueTypeDriverLicense: return ("secureValueTypeDriverLicense", []) - case .secureValueTypeEmail: + case .secureValueTypeEmail: return ("secureValueTypeEmail", []) - case .secureValueTypeIdentityCard: + case .secureValueTypeIdentityCard: return ("secureValueTypeIdentityCard", []) - case .secureValueTypeInternalPassport: + case .secureValueTypeInternalPassport: return ("secureValueTypeInternalPassport", []) - case .secureValueTypePassport: + case .secureValueTypePassport: return ("secureValueTypePassport", []) - case .secureValueTypePassportRegistration: + case .secureValueTypePassportRegistration: return ("secureValueTypePassportRegistration", []) - case .secureValueTypePersonalDetails: + case .secureValueTypePersonalDetails: return ("secureValueTypePersonalDetails", []) - case .secureValueTypePhone: + case .secureValueTypePhone: return ("secureValueTypePhone", []) - case .secureValueTypeRentalAgreement: + case .secureValueTypeRentalAgreement: return ("secureValueTypeRentalAgreement", []) - case .secureValueTypeTemporaryRegistration: + case .secureValueTypeTemporaryRegistration: return ("secureValueTypeTemporaryRegistration", []) - case .secureValueTypeUtilityBill: + case .secureValueTypeUtilityBill: return ("secureValueTypeUtilityBill", []) - } - } - + } + } + public static func parse_secureValueTypeAddress(_ reader: BufferReader) -> SecureValueType? { return Api.SecureValueType.secureValueTypeAddress } @@ -777,32 +946,39 @@ public extension Api { public static func parse_secureValueTypeUtilityBill(_ reader: BufferReader) -> SecureValueType? { return Api.SecureValueType.secureValueTypeUtilityBill } - } } public extension Api { enum SendAsPeer: TypeConstructorDescription { - case sendAsPeer(flags: Int32, peer: Api.Peer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sendAsPeer(let flags, let peer): - if boxed { - buffer.appendInt32(-1206095820) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sendAsPeer(let flags, let peer): - return ("sendAsPeer", [("flags", flags as Any), ("peer", peer as Any)]) - } - } - + public class Cons_sendAsPeer { + public var flags: Int32 + public var peer: Api.Peer + public init(flags: Int32, peer: Api.Peer) { + self.flags = flags + self.peer = peer + } + } + case sendAsPeer(Cons_sendAsPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sendAsPeer(let _data): + if boxed { + buffer.appendInt32(-1206095820) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sendAsPeer(let _data): + return ("sendAsPeer", [("flags", _data.flags as Any), ("peer", _data.peer as Any)]) + } + } + public static func parse_sendAsPeer(_ reader: BufferReader) -> SendAsPeer? { var _1: Int32? _1 = reader.readInt32() @@ -813,202 +989,251 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SendAsPeer.sendAsPeer(flags: _1!, peer: _2!) + return Api.SendAsPeer.sendAsPeer(Cons_sendAsPeer(flags: _1!, peer: _2!)) } else { return nil } } - } } public extension Api { enum SendMessageAction: TypeConstructorDescription { + public class Cons_sendMessageEmojiInteraction { + public var emoticon: String + public var msgId: Int32 + public var interaction: Api.DataJSON + public init(emoticon: String, msgId: Int32, interaction: Api.DataJSON) { + self.emoticon = emoticon + self.msgId = msgId + self.interaction = interaction + } + } + public class Cons_sendMessageEmojiInteractionSeen { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + public class Cons_sendMessageHistoryImportAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } + public class Cons_sendMessageTextDraftAction { + public var randomId: Int64 + public var text: Api.TextWithEntities + public init(randomId: Int64, text: Api.TextWithEntities) { + self.randomId = randomId + self.text = text + } + } + public class Cons_sendMessageUploadAudioAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } + public class Cons_sendMessageUploadDocumentAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } + public class Cons_sendMessageUploadPhotoAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } + public class Cons_sendMessageUploadRoundAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } + public class Cons_sendMessageUploadVideoAction { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + } case sendMessageCancelAction case sendMessageChooseContactAction case sendMessageChooseStickerAction - case sendMessageEmojiInteraction(emoticon: String, msgId: Int32, interaction: Api.DataJSON) - case sendMessageEmojiInteractionSeen(emoticon: String) + case sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction) + case sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen) case sendMessageGamePlayAction case sendMessageGeoLocationAction - case sendMessageHistoryImportAction(progress: Int32) + case sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction) case sendMessageRecordAudioAction case sendMessageRecordRoundAction case sendMessageRecordVideoAction - case sendMessageTextDraftAction(randomId: Int64, text: Api.TextWithEntities) + case sendMessageTextDraftAction(Cons_sendMessageTextDraftAction) case sendMessageTypingAction - case sendMessageUploadAudioAction(progress: Int32) - case sendMessageUploadDocumentAction(progress: Int32) - case sendMessageUploadPhotoAction(progress: Int32) - case sendMessageUploadRoundAction(progress: Int32) - case sendMessageUploadVideoAction(progress: Int32) + case sendMessageUploadAudioAction(Cons_sendMessageUploadAudioAction) + case sendMessageUploadDocumentAction(Cons_sendMessageUploadDocumentAction) + case sendMessageUploadPhotoAction(Cons_sendMessageUploadPhotoAction) + case sendMessageUploadRoundAction(Cons_sendMessageUploadRoundAction) + case sendMessageUploadVideoAction(Cons_sendMessageUploadVideoAction) case speakingInGroupCallAction - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sendMessageCancelAction: - if boxed { - buffer.appendInt32(-44119819) - } - - break - case .sendMessageChooseContactAction: - if boxed { - buffer.appendInt32(1653390447) - } - - break - case .sendMessageChooseStickerAction: - if boxed { - buffer.appendInt32(-1336228175) - } - - break - case .sendMessageEmojiInteraction(let emoticon, let msgId, let interaction): - if boxed { - buffer.appendInt32(630664139) - } - serializeString(emoticon, buffer: buffer, boxed: false) - serializeInt32(msgId, buffer: buffer, boxed: false) - interaction.serialize(buffer, true) - break - case .sendMessageEmojiInteractionSeen(let emoticon): - if boxed { - buffer.appendInt32(-1234857938) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .sendMessageGamePlayAction: - if boxed { - buffer.appendInt32(-580219064) - } - - break - case .sendMessageGeoLocationAction: - if boxed { - buffer.appendInt32(393186209) - } - - break - case .sendMessageHistoryImportAction(let progress): - if boxed { - buffer.appendInt32(-606432698) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .sendMessageRecordAudioAction: - if boxed { - buffer.appendInt32(-718310409) - } - - break - case .sendMessageRecordRoundAction: - if boxed { - buffer.appendInt32(-1997373508) - } - - break - case .sendMessageRecordVideoAction: - if boxed { - buffer.appendInt32(-1584933265) - } - - break - case .sendMessageTextDraftAction(let randomId, let text): - if boxed { - buffer.appendInt32(929929052) - } - serializeInt64(randomId, buffer: buffer, boxed: false) - text.serialize(buffer, true) - break - case .sendMessageTypingAction: - if boxed { - buffer.appendInt32(381645902) - } - - break - case .sendMessageUploadAudioAction(let progress): - if boxed { - buffer.appendInt32(-212740181) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadDocumentAction(let progress): - if boxed { - buffer.appendInt32(-1441998364) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadPhotoAction(let progress): - if boxed { - buffer.appendInt32(-774682074) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadRoundAction(let progress): - if boxed { - buffer.appendInt32(608050278) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadVideoAction(let progress): - if boxed { - buffer.appendInt32(-378127636) - } - serializeInt32(progress, buffer: buffer, boxed: false) - break - case .speakingInGroupCallAction: - if boxed { - buffer.appendInt32(-651419003) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sendMessageCancelAction: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sendMessageCancelAction: + if boxed { + buffer.appendInt32(-44119819) + } + break + case .sendMessageChooseContactAction: + if boxed { + buffer.appendInt32(1653390447) + } + break + case .sendMessageChooseStickerAction: + if boxed { + buffer.appendInt32(-1336228175) + } + break + case .sendMessageEmojiInteraction(let _data): + if boxed { + buffer.appendInt32(630664139) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + _data.interaction.serialize(buffer, true) + break + case .sendMessageEmojiInteractionSeen(let _data): + if boxed { + buffer.appendInt32(-1234857938) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .sendMessageGamePlayAction: + if boxed { + buffer.appendInt32(-580219064) + } + break + case .sendMessageGeoLocationAction: + if boxed { + buffer.appendInt32(393186209) + } + break + case .sendMessageHistoryImportAction(let _data): + if boxed { + buffer.appendInt32(-606432698) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageRecordAudioAction: + if boxed { + buffer.appendInt32(-718310409) + } + break + case .sendMessageRecordRoundAction: + if boxed { + buffer.appendInt32(-1997373508) + } + break + case .sendMessageRecordVideoAction: + if boxed { + buffer.appendInt32(-1584933265) + } + break + case .sendMessageTextDraftAction(let _data): + if boxed { + buffer.appendInt32(929929052) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + break + case .sendMessageTypingAction: + if boxed { + buffer.appendInt32(381645902) + } + break + case .sendMessageUploadAudioAction(let _data): + if boxed { + buffer.appendInt32(-212740181) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadDocumentAction(let _data): + if boxed { + buffer.appendInt32(-1441998364) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadPhotoAction(let _data): + if boxed { + buffer.appendInt32(-774682074) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadRoundAction(let _data): + if boxed { + buffer.appendInt32(608050278) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadVideoAction(let _data): + if boxed { + buffer.appendInt32(-378127636) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .speakingInGroupCallAction: + if boxed { + buffer.appendInt32(-651419003) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sendMessageCancelAction: return ("sendMessageCancelAction", []) - case .sendMessageChooseContactAction: + case .sendMessageChooseContactAction: return ("sendMessageChooseContactAction", []) - case .sendMessageChooseStickerAction: + case .sendMessageChooseStickerAction: return ("sendMessageChooseStickerAction", []) - case .sendMessageEmojiInteraction(let emoticon, let msgId, let interaction): - return ("sendMessageEmojiInteraction", [("emoticon", emoticon as Any), ("msgId", msgId as Any), ("interaction", interaction as Any)]) - case .sendMessageEmojiInteractionSeen(let emoticon): - return ("sendMessageEmojiInteractionSeen", [("emoticon", emoticon as Any)]) - case .sendMessageGamePlayAction: + case .sendMessageEmojiInteraction(let _data): + return ("sendMessageEmojiInteraction", [("emoticon", _data.emoticon as Any), ("msgId", _data.msgId as Any), ("interaction", _data.interaction as Any)]) + case .sendMessageEmojiInteractionSeen(let _data): + return ("sendMessageEmojiInteractionSeen", [("emoticon", _data.emoticon as Any)]) + case .sendMessageGamePlayAction: return ("sendMessageGamePlayAction", []) - case .sendMessageGeoLocationAction: + case .sendMessageGeoLocationAction: return ("sendMessageGeoLocationAction", []) - case .sendMessageHistoryImportAction(let progress): - return ("sendMessageHistoryImportAction", [("progress", progress as Any)]) - case .sendMessageRecordAudioAction: + case .sendMessageHistoryImportAction(let _data): + return ("sendMessageHistoryImportAction", [("progress", _data.progress as Any)]) + case .sendMessageRecordAudioAction: return ("sendMessageRecordAudioAction", []) - case .sendMessageRecordRoundAction: + case .sendMessageRecordRoundAction: return ("sendMessageRecordRoundAction", []) - case .sendMessageRecordVideoAction: + case .sendMessageRecordVideoAction: return ("sendMessageRecordVideoAction", []) - case .sendMessageTextDraftAction(let randomId, let text): - return ("sendMessageTextDraftAction", [("randomId", randomId as Any), ("text", text as Any)]) - case .sendMessageTypingAction: + case .sendMessageTextDraftAction(let _data): + return ("sendMessageTextDraftAction", [("randomId", _data.randomId as Any), ("text", _data.text as Any)]) + case .sendMessageTypingAction: return ("sendMessageTypingAction", []) - case .sendMessageUploadAudioAction(let progress): - return ("sendMessageUploadAudioAction", [("progress", progress as Any)]) - case .sendMessageUploadDocumentAction(let progress): - return ("sendMessageUploadDocumentAction", [("progress", progress as Any)]) - case .sendMessageUploadPhotoAction(let progress): - return ("sendMessageUploadPhotoAction", [("progress", progress as Any)]) - case .sendMessageUploadRoundAction(let progress): - return ("sendMessageUploadRoundAction", [("progress", progress as Any)]) - case .sendMessageUploadVideoAction(let progress): - return ("sendMessageUploadVideoAction", [("progress", progress as Any)]) - case .speakingInGroupCallAction: + case .sendMessageUploadAudioAction(let _data): + return ("sendMessageUploadAudioAction", [("progress", _data.progress as Any)]) + case .sendMessageUploadDocumentAction(let _data): + return ("sendMessageUploadDocumentAction", [("progress", _data.progress as Any)]) + case .sendMessageUploadPhotoAction(let _data): + return ("sendMessageUploadPhotoAction", [("progress", _data.progress as Any)]) + case .sendMessageUploadRoundAction(let _data): + return ("sendMessageUploadRoundAction", [("progress", _data.progress as Any)]) + case .sendMessageUploadVideoAction(let _data): + return ("sendMessageUploadVideoAction", [("progress", _data.progress as Any)]) + case .speakingInGroupCallAction: return ("speakingInGroupCallAction", []) - } - } - + } + } + public static func parse_sendMessageCancelAction(_ reader: BufferReader) -> SendMessageAction? { return Api.SendMessageAction.sendMessageCancelAction } @@ -1031,7 +1256,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SendMessageAction.sendMessageEmojiInteraction(emoticon: _1!, msgId: _2!, interaction: _3!) + return Api.SendMessageAction.sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction(emoticon: _1!, msgId: _2!, interaction: _3!)) } else { return nil @@ -1042,7 +1267,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageEmojiInteractionSeen(emoticon: _1!) + return Api.SendMessageAction.sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen(emoticon: _1!)) } else { return nil @@ -1059,7 +1284,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageHistoryImportAction(progress: _1!) + return Api.SendMessageAction.sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction(progress: _1!)) } else { return nil @@ -1084,7 +1309,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SendMessageAction.sendMessageTextDraftAction(randomId: _1!, text: _2!) + return Api.SendMessageAction.sendMessageTextDraftAction(Cons_sendMessageTextDraftAction(randomId: _1!, text: _2!)) } else { return nil @@ -1098,7 +1323,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageUploadAudioAction(progress: _1!) + return Api.SendMessageAction.sendMessageUploadAudioAction(Cons_sendMessageUploadAudioAction(progress: _1!)) } else { return nil @@ -1109,7 +1334,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageUploadDocumentAction(progress: _1!) + return Api.SendMessageAction.sendMessageUploadDocumentAction(Cons_sendMessageUploadDocumentAction(progress: _1!)) } else { return nil @@ -1120,7 +1345,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageUploadPhotoAction(progress: _1!) + return Api.SendMessageAction.sendMessageUploadPhotoAction(Cons_sendMessageUploadPhotoAction(progress: _1!)) } else { return nil @@ -1131,7 +1356,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageUploadRoundAction(progress: _1!) + return Api.SendMessageAction.sendMessageUploadRoundAction(Cons_sendMessageUploadRoundAction(progress: _1!)) } else { return nil @@ -1142,7 +1367,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.SendMessageAction.sendMessageUploadVideoAction(progress: _1!) + return Api.SendMessageAction.sendMessageUploadVideoAction(Cons_sendMessageUploadVideoAction(progress: _1!)) } else { return nil @@ -1151,6 +1376,5 @@ public extension Api { public static func parse_speakingInGroupCallAction(_ reader: BufferReader) -> SendMessageAction? { return Api.SendMessageAction.speakingInGroupCallAction } - } } diff --git a/submodules/TelegramApi/Sources/Api25.swift b/submodules/TelegramApi/Sources/Api25.swift index 1c46f8dc4c..db083b22fe 100644 --- a/submodules/TelegramApi/Sources/Api25.swift +++ b/submodules/TelegramApi/Sources/Api25.swift @@ -1,31 +1,41 @@ public extension Api { enum ShippingOption: TypeConstructorDescription { - case shippingOption(id: String, title: String, prices: [Api.LabeledPrice]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .shippingOption(let id, let title, let prices): - if boxed { - buffer.appendInt32(-1239335713) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prices.count)) - for item in prices { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .shippingOption(let id, let title, let prices): - return ("shippingOption", [("id", id as Any), ("title", title as Any), ("prices", prices as Any)]) - } - } - + public class Cons_shippingOption { + public var id: String + public var title: String + public var prices: [Api.LabeledPrice] + public init(id: String, title: String, prices: [Api.LabeledPrice]) { + self.id = id + self.title = title + self.prices = prices + } + } + case shippingOption(Cons_shippingOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .shippingOption(let _data): + if boxed { + buffer.appendInt32(-1239335713) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prices.count)) + for item in _data.prices { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .shippingOption(let _data): + return ("shippingOption", [("id", _data.id as Any), ("title", _data.title as Any), ("prices", _data.prices as Any)]) + } + } + public static func parse_shippingOption(_ reader: BufferReader) -> ShippingOption? { var _1: String? _1 = parseString(reader) @@ -39,39 +49,48 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.ShippingOption.shippingOption(id: _1!, title: _2!, prices: _3!) + return Api.ShippingOption.shippingOption(Cons_shippingOption(id: _1!, title: _2!, prices: _3!)) } else { return nil } } - } } public extension Api { enum SmsJob: TypeConstructorDescription { - case smsJob(jobId: String, phoneNumber: String, text: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .smsJob(let jobId, let phoneNumber, let text): - if boxed { - buffer.appendInt32(-425595208) - } - serializeString(jobId, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .smsJob(let jobId, let phoneNumber, let text): - return ("smsJob", [("jobId", jobId as Any), ("phoneNumber", phoneNumber as Any), ("text", text as Any)]) - } - } - + public class Cons_smsJob { + public var jobId: String + public var phoneNumber: String + public var text: String + public init(jobId: String, phoneNumber: String, text: String) { + self.jobId = jobId + self.phoneNumber = phoneNumber + self.text = text + } + } + case smsJob(Cons_smsJob) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .smsJob(let _data): + if boxed { + buffer.appendInt32(-425595208) + } + serializeString(_data.jobId, buffer: buffer, boxed: false) + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .smsJob(let _data): + return ("smsJob", [("jobId", _data.jobId as Any), ("phoneNumber", _data.phoneNumber as Any), ("text", _data.text as Any)]) + } + } + public static func parse_smsJob(_ reader: BufferReader) -> SmsJob? { var _1: String? _1 = parseString(reader) @@ -83,54 +102,101 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SmsJob.smsJob(jobId: _1!, phoneNumber: _2!, text: _3!) + return Api.SmsJob.smsJob(Cons_smsJob(jobId: _1!, phoneNumber: _2!, text: _3!)) } else { return nil } } - } } public extension Api { indirect enum SponsoredMessage: TypeConstructorDescription { - case sponsoredMessage(flags: Int32, randomId: Buffer, url: String, title: String, message: String, entities: [Api.MessageEntity]?, photo: Api.Photo?, media: Api.MessageMedia?, color: Api.PeerColor?, buttonText: String, sponsorInfo: String?, additionalInfo: String?, minDisplayDuration: Int32?, maxDisplayDuration: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredMessage(let flags, let randomId, let url, let title, let message, let entities, let photo, let media, let color, let buttonText, let sponsorInfo, let additionalInfo, let minDisplayDuration, let maxDisplayDuration): - if boxed { - buffer.appendInt32(2109703795) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeBytes(randomId, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_sponsoredMessage { + public var flags: Int32 + public var randomId: Buffer + public var url: String + public var title: String + public var message: String + public var entities: [Api.MessageEntity]? + public var photo: Api.Photo? + public var media: Api.MessageMedia? + public var color: Api.PeerColor? + public var buttonText: String + public var sponsorInfo: String? + public var additionalInfo: String? + public var minDisplayDuration: Int32? + public var maxDisplayDuration: Int32? + public init(flags: Int32, randomId: Buffer, url: String, title: String, message: String, entities: [Api.MessageEntity]?, photo: Api.Photo?, media: Api.MessageMedia?, color: Api.PeerColor?, buttonText: String, sponsorInfo: String?, additionalInfo: String?, minDisplayDuration: Int32?, maxDisplayDuration: Int32?) { + self.flags = flags + self.randomId = randomId + self.url = url + self.title = title + self.message = message + self.entities = entities + self.photo = photo + self.media = media + self.color = color + self.buttonText = buttonText + self.sponsorInfo = sponsorInfo + self.additionalInfo = additionalInfo + self.minDisplayDuration = minDisplayDuration + self.maxDisplayDuration = maxDisplayDuration + } + } + case sponsoredMessage(Cons_sponsoredMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredMessage(let _data): + if boxed { + buffer.appendInt32(2109703795) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeBytes(_data.randomId, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 6) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 13) != 0 {color!.serialize(buffer, true)} - serializeString(buttonText, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {serializeString(sponsorInfo!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeString(additionalInfo!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(minDisplayDuration!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(maxDisplayDuration!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredMessage(let flags, let randomId, let url, let title, let message, let entities, let photo, let media, let color, let buttonText, let sponsorInfo, let additionalInfo, let minDisplayDuration, let maxDisplayDuration): - return ("sponsoredMessage", [("flags", flags as Any), ("randomId", randomId as Any), ("url", url as Any), ("title", title as Any), ("message", message as Any), ("entities", entities as Any), ("photo", photo as Any), ("media", media as Any), ("color", color as Any), ("buttonText", buttonText as Any), ("sponsorInfo", sponsorInfo as Any), ("additionalInfo", additionalInfo as Any), ("minDisplayDuration", minDisplayDuration as Any), ("maxDisplayDuration", maxDisplayDuration as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + _data.media!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + _data.color!.serialize(buffer, true) + } + serializeString(_data.buttonText, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeString(_data.sponsorInfo!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeString(_data.additionalInfo!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.minDisplayDuration!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.maxDisplayDuration!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredMessage(let _data): + return ("sponsoredMessage", [("flags", _data.flags as Any), ("randomId", _data.randomId as Any), ("url", _data.url as Any), ("title", _data.title as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("photo", _data.photo as Any), ("media", _data.media as Any), ("color", _data.color as Any), ("buttonText", _data.buttonText as Any), ("sponsorInfo", _data.sponsorInfo as Any), ("additionalInfo", _data.additionalInfo as Any), ("minDisplayDuration", _data.minDisplayDuration as Any), ("maxDisplayDuration", _data.maxDisplayDuration as Any)]) + } + } + public static func parse_sponsoredMessage(_ reader: BufferReader) -> SponsoredMessage? { var _1: Int32? _1 = reader.readInt32() @@ -143,31 +209,47 @@ public extension Api { var _5: String? _5 = parseString(reader) var _6: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _7: Api.Photo? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _8: Api.MessageMedia? - if Int(_1!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } var _9: Api.PeerColor? - if Int(_1!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_1!) & Int(1 << 13) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _10: String? _10 = parseString(reader) var _11: String? - if Int(_1!) & Int(1 << 7) != 0 {_11 = parseString(reader) } + if Int(_1!) & Int(1 << 7) != 0 { + _11 = parseString(reader) + } var _12: String? - if Int(_1!) & Int(1 << 8) != 0 {_12 = parseString(reader) } + if Int(_1!) & Int(1 << 8) != 0 { + _12 = parseString(reader) + } var _13: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _13 = reader.readInt32() + } var _14: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_14 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _14 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -183,38 +265,45 @@ public extension Api { let _c13 = (Int(_1!) & Int(1 << 15) == 0) || _13 != nil let _c14 = (Int(_1!) & Int(1 << 15) == 0) || _14 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 { - return Api.SponsoredMessage.sponsoredMessage(flags: _1!, randomId: _2!, url: _3!, title: _4!, message: _5!, entities: _6, photo: _7, media: _8, color: _9, buttonText: _10!, sponsorInfo: _11, additionalInfo: _12, minDisplayDuration: _13, maxDisplayDuration: _14) + return Api.SponsoredMessage.sponsoredMessage(Cons_sponsoredMessage(flags: _1!, randomId: _2!, url: _3!, title: _4!, message: _5!, entities: _6, photo: _7, media: _8, color: _9, buttonText: _10!, sponsorInfo: _11, additionalInfo: _12, minDisplayDuration: _13, maxDisplayDuration: _14)) } else { return nil } } - } } public extension Api { enum SponsoredMessageReportOption: TypeConstructorDescription { - case sponsoredMessageReportOption(text: String, option: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredMessageReportOption(let text, let option): - if boxed { - buffer.appendInt32(1124938064) - } - serializeString(text, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredMessageReportOption(let text, let option): - return ("sponsoredMessageReportOption", [("text", text as Any), ("option", option as Any)]) - } - } - + public class Cons_sponsoredMessageReportOption { + public var text: String + public var option: Buffer + public init(text: String, option: Buffer) { + self.text = text + self.option = option + } + } + case sponsoredMessageReportOption(Cons_sponsoredMessageReportOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredMessageReportOption(let _data): + if boxed { + buffer.appendInt32(1124938064) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeBytes(_data.option, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredMessageReportOption(let _data): + return ("sponsoredMessageReportOption", [("text", _data.text as Any), ("option", _data.option as Any)]) + } + } + public static func parse_sponsoredMessageReportOption(_ reader: BufferReader) -> SponsoredMessageReportOption? { var _1: String? _1 = parseString(reader) @@ -223,41 +312,58 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SponsoredMessageReportOption.sponsoredMessageReportOption(text: _1!, option: _2!) + return Api.SponsoredMessageReportOption.sponsoredMessageReportOption(Cons_sponsoredMessageReportOption(text: _1!, option: _2!)) } else { return nil } } - } } public extension Api { enum SponsoredPeer: TypeConstructorDescription { - case sponsoredPeer(flags: Int32, randomId: Buffer, peer: Api.Peer, sponsorInfo: String?, additionalInfo: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredPeer(let flags, let randomId, let peer, let sponsorInfo, let additionalInfo): - if boxed { - buffer.appendInt32(-963180333) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeBytes(randomId, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(sponsorInfo!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(additionalInfo!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredPeer(let flags, let randomId, let peer, let sponsorInfo, let additionalInfo): - return ("sponsoredPeer", [("flags", flags as Any), ("randomId", randomId as Any), ("peer", peer as Any), ("sponsorInfo", sponsorInfo as Any), ("additionalInfo", additionalInfo as Any)]) - } - } - + public class Cons_sponsoredPeer { + public var flags: Int32 + public var randomId: Buffer + public var peer: Api.Peer + public var sponsorInfo: String? + public var additionalInfo: String? + public init(flags: Int32, randomId: Buffer, peer: Api.Peer, sponsorInfo: String?, additionalInfo: String?) { + self.flags = flags + self.randomId = randomId + self.peer = peer + self.sponsorInfo = sponsorInfo + self.additionalInfo = additionalInfo + } + } + case sponsoredPeer(Cons_sponsoredPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredPeer(let _data): + if boxed { + buffer.appendInt32(-963180333) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeBytes(_data.randomId, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.sponsorInfo!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.additionalInfo!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredPeer(let _data): + return ("sponsoredPeer", [("flags", _data.flags as Any), ("randomId", _data.randomId as Any), ("peer", _data.peer as Any), ("sponsorInfo", _data.sponsorInfo as Any), ("additionalInfo", _data.additionalInfo as Any)]) + } + } + public static func parse_sponsoredPeer(_ reader: BufferReader) -> SponsoredPeer? { var _1: Int32? _1 = reader.readInt32() @@ -268,106 +374,269 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.Peer } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.SponsoredPeer.sponsoredPeer(flags: _1!, randomId: _2!, peer: _3!, sponsorInfo: _4, additionalInfo: _5) + return Api.SponsoredPeer.sponsoredPeer(Cons_sponsoredPeer(flags: _1!, randomId: _2!, peer: _3!, sponsorInfo: _4, additionalInfo: _5)) } else { return nil } } - } } public extension Api { enum StarGift: TypeConstructorDescription { - case starGift(flags: Int32, id: Int64, sticker: Api.Document, stars: Int64, availabilityRemains: Int32?, availabilityTotal: Int32?, availabilityResale: Int64?, convertStars: Int64, firstSaleDate: Int32?, lastSaleDate: Int32?, upgradeStars: Int64?, resellMinStars: Int64?, title: String?, releasedBy: Api.Peer?, perUserTotal: Int32?, perUserRemains: Int32?, lockedUntilDate: Int32?, auctionSlug: String?, giftsPerRound: Int32?, auctionStartDate: Int32?, upgradeVariants: Int32?, background: Api.StarGiftBackground?) - case starGiftUnique(flags: Int32, id: Int64, giftId: Int64, title: String, slug: String, num: Int32, ownerId: Api.Peer?, ownerName: String?, ownerAddress: String?, attributes: [Api.StarGiftAttribute], availabilityIssued: Int32, availabilityTotal: Int32, giftAddress: String?, resellAmount: [Api.StarsAmount]?, releasedBy: Api.Peer?, valueAmount: Int64?, valueCurrency: String?, valueUsdAmount: Int64?, themePeer: Api.Peer?, peerColor: Api.PeerColor?, hostId: Api.Peer?, offerMinStars: Int32?, craftChancePermille: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGift(let flags, let id, let sticker, let stars, let availabilityRemains, let availabilityTotal, let availabilityResale, let convertStars, let firstSaleDate, let lastSaleDate, let upgradeStars, let resellMinStars, let title, let releasedBy, let perUserTotal, let perUserRemains, let lockedUntilDate, let auctionSlug, let giftsPerRound, let auctionStartDate, let upgradeVariants, let background): - if boxed { - buffer.appendInt32(825922887) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - sticker.serialize(buffer, true) - serializeInt64(stars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(availabilityRemains!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(availabilityTotal!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(availabilityResale!, buffer: buffer, boxed: false)} - serializeInt64(convertStars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(firstSaleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(lastSaleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(upgradeStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(resellMinStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {releasedBy!.serialize(buffer, true)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt32(perUserTotal!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt32(perUserRemains!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {serializeInt32(lockedUntilDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeString(auctionSlug!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(giftsPerRound!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(auctionStartDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt32(upgradeVariants!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {background!.serialize(buffer, true)} - break - case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency, let valueUsdAmount, let themePeer, let peerColor, let hostId, let offerMinStars, let craftChancePermille): - if boxed { - buffer.appendInt32(-2047825459) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(giftId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - serializeInt32(num, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {ownerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(ownerName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(ownerAddress!, buffer: buffer, boxed: false)} + public class Cons_starGift { + public var flags: Int32 + public var id: Int64 + public var sticker: Api.Document + public var stars: Int64 + public var availabilityRemains: Int32? + public var availabilityTotal: Int32? + public var availabilityResale: Int64? + public var convertStars: Int64 + public var firstSaleDate: Int32? + public var lastSaleDate: Int32? + public var upgradeStars: Int64? + public var resellMinStars: Int64? + public var title: String? + public var releasedBy: Api.Peer? + public var perUserTotal: Int32? + public var perUserRemains: Int32? + public var lockedUntilDate: Int32? + public var auctionSlug: String? + public var giftsPerRound: Int32? + public var auctionStartDate: Int32? + public var upgradeVariants: Int32? + public var background: Api.StarGiftBackground? + public init(flags: Int32, id: Int64, sticker: Api.Document, stars: Int64, availabilityRemains: Int32?, availabilityTotal: Int32?, availabilityResale: Int64?, convertStars: Int64, firstSaleDate: Int32?, lastSaleDate: Int32?, upgradeStars: Int64?, resellMinStars: Int64?, title: String?, releasedBy: Api.Peer?, perUserTotal: Int32?, perUserRemains: Int32?, lockedUntilDate: Int32?, auctionSlug: String?, giftsPerRound: Int32?, auctionStartDate: Int32?, upgradeVariants: Int32?, background: Api.StarGiftBackground?) { + self.flags = flags + self.id = id + self.sticker = sticker + self.stars = stars + self.availabilityRemains = availabilityRemains + self.availabilityTotal = availabilityTotal + self.availabilityResale = availabilityResale + self.convertStars = convertStars + self.firstSaleDate = firstSaleDate + self.lastSaleDate = lastSaleDate + self.upgradeStars = upgradeStars + self.resellMinStars = resellMinStars + self.title = title + self.releasedBy = releasedBy + self.perUserTotal = perUserTotal + self.perUserRemains = perUserRemains + self.lockedUntilDate = lockedUntilDate + self.auctionSlug = auctionSlug + self.giftsPerRound = giftsPerRound + self.auctionStartDate = auctionStartDate + self.upgradeVariants = upgradeVariants + self.background = background + } + } + public class Cons_starGiftUnique { + public var flags: Int32 + public var id: Int64 + public var giftId: Int64 + public var title: String + public var slug: String + public var num: Int32 + public var ownerId: Api.Peer? + public var ownerName: String? + public var ownerAddress: String? + public var attributes: [Api.StarGiftAttribute] + public var availabilityIssued: Int32 + public var availabilityTotal: Int32 + public var giftAddress: String? + public var resellAmount: [Api.StarsAmount]? + public var releasedBy: Api.Peer? + public var valueAmount: Int64? + public var valueCurrency: String? + public var valueUsdAmount: Int64? + public var themePeer: Api.Peer? + public var peerColor: Api.PeerColor? + public var hostId: Api.Peer? + public var offerMinStars: Int32? + public var craftChancePermille: Int32? + public init(flags: Int32, id: Int64, giftId: Int64, title: String, slug: String, num: Int32, ownerId: Api.Peer?, ownerName: String?, ownerAddress: String?, attributes: [Api.StarGiftAttribute], availabilityIssued: Int32, availabilityTotal: Int32, giftAddress: String?, resellAmount: [Api.StarsAmount]?, releasedBy: Api.Peer?, valueAmount: Int64?, valueCurrency: String?, valueUsdAmount: Int64?, themePeer: Api.Peer?, peerColor: Api.PeerColor?, hostId: Api.Peer?, offerMinStars: Int32?, craftChancePermille: Int32?) { + self.flags = flags + self.id = id + self.giftId = giftId + self.title = title + self.slug = slug + self.num = num + self.ownerId = ownerId + self.ownerName = ownerName + self.ownerAddress = ownerAddress + self.attributes = attributes + self.availabilityIssued = availabilityIssued + self.availabilityTotal = availabilityTotal + self.giftAddress = giftAddress + self.resellAmount = resellAmount + self.releasedBy = releasedBy + self.valueAmount = valueAmount + self.valueCurrency = valueCurrency + self.valueUsdAmount = valueUsdAmount + self.themePeer = themePeer + self.peerColor = peerColor + self.hostId = hostId + self.offerMinStars = offerMinStars + self.craftChancePermille = craftChancePermille + } + } + case starGift(Cons_starGift) + case starGiftUnique(Cons_starGiftUnique) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGift(let _data): + if boxed { + buffer.appendInt32(825922887) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + _data.sticker.serialize(buffer, true) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.availabilityRemains!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.availabilityTotal!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.availabilityResale!, buffer: buffer, boxed: false) + } + serializeInt64(_data.convertStars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.firstSaleDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.lastSaleDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt64(_data.upgradeStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.resellMinStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.releasedBy!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt32(_data.perUserTotal!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt32(_data.perUserRemains!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeInt32(_data.lockedUntilDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeString(_data.auctionSlug!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.giftsPerRound!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.auctionStartDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt32(_data.upgradeVariants!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + _data.background!.serialize(buffer, true) + } + break + case .starGiftUnique(let _data): + if boxed { + buffer.appendInt32(-2047825459) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + serializeInt32(_data.num, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.ownerId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.ownerName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.ownerAddress!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + serializeInt32(_data.availabilityIssued, buffer: buffer, boxed: false) + serializeInt32(_data.availabilityTotal, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.giftAddress!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { + buffer.appendInt32(Int32(_data.resellAmount!.count)) + for item in _data.resellAmount! { item.serialize(buffer, true) } - serializeInt32(availabilityIssued, buffer: buffer, boxed: false) - serializeInt32(availabilityTotal, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(giftAddress!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(resellAmount!.count)) - for item in resellAmount! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 5) != 0 {releasedBy!.serialize(buffer, true)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(valueAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeString(valueCurrency!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(valueUsdAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {themePeer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 11) != 0 {peerColor!.serialize(buffer, true)} - if Int(flags) & Int(1 << 12) != 0 {hostId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt32(offerMinStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 16) != 0 {serializeInt32(craftChancePermille!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGift(let flags, let id, let sticker, let stars, let availabilityRemains, let availabilityTotal, let availabilityResale, let convertStars, let firstSaleDate, let lastSaleDate, let upgradeStars, let resellMinStars, let title, let releasedBy, let perUserTotal, let perUserRemains, let lockedUntilDate, let auctionSlug, let giftsPerRound, let auctionStartDate, let upgradeVariants, let background): - return ("starGift", [("flags", flags as Any), ("id", id as Any), ("sticker", sticker as Any), ("stars", stars as Any), ("availabilityRemains", availabilityRemains as Any), ("availabilityTotal", availabilityTotal as Any), ("availabilityResale", availabilityResale as Any), ("convertStars", convertStars as Any), ("firstSaleDate", firstSaleDate as Any), ("lastSaleDate", lastSaleDate as Any), ("upgradeStars", upgradeStars as Any), ("resellMinStars", resellMinStars as Any), ("title", title as Any), ("releasedBy", releasedBy as Any), ("perUserTotal", perUserTotal as Any), ("perUserRemains", perUserRemains as Any), ("lockedUntilDate", lockedUntilDate as Any), ("auctionSlug", auctionSlug as Any), ("giftsPerRound", giftsPerRound as Any), ("auctionStartDate", auctionStartDate as Any), ("upgradeVariants", upgradeVariants as Any), ("background", background as Any)]) - case .starGiftUnique(let flags, let id, let giftId, let title, let slug, let num, let ownerId, let ownerName, let ownerAddress, let attributes, let availabilityIssued, let availabilityTotal, let giftAddress, let resellAmount, let releasedBy, let valueAmount, let valueCurrency, let valueUsdAmount, let themePeer, let peerColor, let hostId, let offerMinStars, let craftChancePermille): - return ("starGiftUnique", [("flags", flags as Any), ("id", id as Any), ("giftId", giftId as Any), ("title", title as Any), ("slug", slug as Any), ("num", num as Any), ("ownerId", ownerId as Any), ("ownerName", ownerName as Any), ("ownerAddress", ownerAddress as Any), ("attributes", attributes as Any), ("availabilityIssued", availabilityIssued as Any), ("availabilityTotal", availabilityTotal as Any), ("giftAddress", giftAddress as Any), ("resellAmount", resellAmount as Any), ("releasedBy", releasedBy as Any), ("valueAmount", valueAmount as Any), ("valueCurrency", valueCurrency as Any), ("valueUsdAmount", valueUsdAmount as Any), ("themePeer", themePeer as Any), ("peerColor", peerColor as Any), ("hostId", hostId as Any), ("offerMinStars", offerMinStars as Any), ("craftChancePermille", craftChancePermille as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.releasedBy!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.valueAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeString(_data.valueCurrency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.valueUsdAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.themePeer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + _data.peerColor!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + _data.hostId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt32(_data.offerMinStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeInt32(_data.craftChancePermille!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGift(let _data): + return ("starGift", [("flags", _data.flags as Any), ("id", _data.id as Any), ("sticker", _data.sticker as Any), ("stars", _data.stars as Any), ("availabilityRemains", _data.availabilityRemains as Any), ("availabilityTotal", _data.availabilityTotal as Any), ("availabilityResale", _data.availabilityResale as Any), ("convertStars", _data.convertStars as Any), ("firstSaleDate", _data.firstSaleDate as Any), ("lastSaleDate", _data.lastSaleDate as Any), ("upgradeStars", _data.upgradeStars as Any), ("resellMinStars", _data.resellMinStars as Any), ("title", _data.title as Any), ("releasedBy", _data.releasedBy as Any), ("perUserTotal", _data.perUserTotal as Any), ("perUserRemains", _data.perUserRemains as Any), ("lockedUntilDate", _data.lockedUntilDate as Any), ("auctionSlug", _data.auctionSlug as Any), ("giftsPerRound", _data.giftsPerRound as Any), ("auctionStartDate", _data.auctionStartDate as Any), ("upgradeVariants", _data.upgradeVariants as Any), ("background", _data.background as Any)]) + case .starGiftUnique(let _data): + return ("starGiftUnique", [("flags", _data.flags as Any), ("id", _data.id as Any), ("giftId", _data.giftId as Any), ("title", _data.title as Any), ("slug", _data.slug as Any), ("num", _data.num as Any), ("ownerId", _data.ownerId as Any), ("ownerName", _data.ownerName as Any), ("ownerAddress", _data.ownerAddress as Any), ("attributes", _data.attributes as Any), ("availabilityIssued", _data.availabilityIssued as Any), ("availabilityTotal", _data.availabilityTotal as Any), ("giftAddress", _data.giftAddress as Any), ("resellAmount", _data.resellAmount as Any), ("releasedBy", _data.releasedBy as Any), ("valueAmount", _data.valueAmount as Any), ("valueCurrency", _data.valueCurrency as Any), ("valueUsdAmount", _data.valueUsdAmount as Any), ("themePeer", _data.themePeer as Any), ("peerColor", _data.peerColor as Any), ("hostId", _data.hostId as Any), ("offerMinStars", _data.offerMinStars as Any), ("craftChancePermille", _data.craftChancePermille as Any)]) + } + } + public static func parse_starGift(_ reader: BufferReader) -> StarGift? { var _1: Int32? _1 = reader.readInt32() @@ -380,45 +649,79 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } var _7: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = reader.readInt64() + } var _8: Int64? _8 = reader.readInt64() var _9: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _9 = reader.readInt32() + } var _10: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _10 = reader.readInt32() + } var _11: Int64? - if Int(_1!) & Int(1 << 3) != 0 {_11 = reader.readInt64() } + if Int(_1!) & Int(1 << 3) != 0 { + _11 = reader.readInt64() + } var _12: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_12 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _12 = reader.readInt64() + } var _13: String? - if Int(_1!) & Int(1 << 5) != 0 {_13 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _13 = parseString(reader) + } var _14: Api.Peer? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _14 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _14 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _15: Int32? - if Int(_1!) & Int(1 << 8) != 0 {_15 = reader.readInt32() } + if Int(_1!) & Int(1 << 8) != 0 { + _15 = reader.readInt32() + } var _16: Int32? - if Int(_1!) & Int(1 << 8) != 0 {_16 = reader.readInt32() } + if Int(_1!) & Int(1 << 8) != 0 { + _16 = reader.readInt32() + } var _17: Int32? - if Int(_1!) & Int(1 << 9) != 0 {_17 = reader.readInt32() } + if Int(_1!) & Int(1 << 9) != 0 { + _17 = reader.readInt32() + } var _18: String? - if Int(_1!) & Int(1 << 11) != 0 {_18 = parseString(reader) } + if Int(_1!) & Int(1 << 11) != 0 { + _18 = parseString(reader) + } var _19: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_19 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _19 = reader.readInt32() + } var _20: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_20 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _20 = reader.readInt32() + } var _21: Int32? - if Int(_1!) & Int(1 << 12) != 0 {_21 = reader.readInt32() } + if Int(_1!) & Int(1 << 12) != 0 { + _21 = reader.readInt32() + } var _22: Api.StarGiftBackground? - if Int(_1!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() { - _22 = Api.parse(reader, signature: signature) as? Api.StarGiftBackground - } } + if Int(_1!) & Int(1 << 13) != 0 { + if let signature = reader.readInt32() { + _22 = Api.parse(reader, signature: signature) as? Api.StarGiftBackground + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -442,7 +745,7 @@ public extension Api { let _c21 = (Int(_1!) & Int(1 << 12) == 0) || _21 != nil let _c22 = (Int(_1!) & Int(1 << 13) == 0) || _22 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 { - return Api.StarGift.starGift(flags: _1!, id: _2!, sticker: _3!, stars: _4!, availabilityRemains: _5, availabilityTotal: _6, availabilityResale: _7, convertStars: _8!, firstSaleDate: _9, lastSaleDate: _10, upgradeStars: _11, resellMinStars: _12, title: _13, releasedBy: _14, perUserTotal: _15, perUserRemains: _16, lockedUntilDate: _17, auctionSlug: _18, giftsPerRound: _19, auctionStartDate: _20, upgradeVariants: _21, background: _22) + return Api.StarGift.starGift(Cons_starGift(flags: _1!, id: _2!, sticker: _3!, stars: _4!, availabilityRemains: _5, availabilityTotal: _6, availabilityResale: _7, convertStars: _8!, firstSaleDate: _9, lastSaleDate: _10, upgradeStars: _11, resellMinStars: _12, title: _13, releasedBy: _14, perUserTotal: _15, perUserRemains: _16, lockedUntilDate: _17, auctionSlug: _18, giftsPerRound: _19, auctionStartDate: _20, upgradeVariants: _21, background: _22)) } else { return nil @@ -462,13 +765,19 @@ public extension Api { var _6: Int32? _6 = reader.readInt32() var _7: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _8: String? - if Int(_1!) & Int(1 << 1) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _8 = parseString(reader) + } var _9: String? - if Int(_1!) & Int(1 << 2) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _9 = parseString(reader) + } var _10: [Api.StarGiftAttribute]? if let _ = reader.readInt32() { _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) @@ -478,37 +787,59 @@ public extension Api { var _12: Int32? _12 = reader.readInt32() var _13: String? - if Int(_1!) & Int(1 << 3) != 0 {_13 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _13 = parseString(reader) + } var _14: [Api.StarsAmount]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsAmount.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsAmount.self) + } + } var _15: Api.Peer? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _16: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_16 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _16 = reader.readInt64() + } var _17: String? - if Int(_1!) & Int(1 << 8) != 0 {_17 = parseString(reader) } + if Int(_1!) & Int(1 << 8) != 0 { + _17 = parseString(reader) + } var _18: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_18 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _18 = reader.readInt64() + } var _19: Api.Peer? - if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _20: Api.PeerColor? - if Int(_1!) & Int(1 << 11) != 0 {if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_1!) & Int(1 << 11) != 0 { + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _21: Api.Peer? - if Int(_1!) & Int(1 << 12) != 0 {if let signature = reader.readInt32() { - _21 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _21 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _22: Int32? - if Int(_1!) & Int(1 << 13) != 0 {_22 = reader.readInt32() } + if Int(_1!) & Int(1 << 13) != 0 { + _22 = reader.readInt32() + } var _23: Int32? - if Int(_1!) & Int(1 << 16) != 0 {_23 = reader.readInt32() } + if Int(_1!) & Int(1 << 16) != 0 { + _23 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -533,39 +864,48 @@ public extension Api { let _c22 = (Int(_1!) & Int(1 << 13) == 0) || _22 != nil let _c23 = (Int(_1!) & Int(1 << 16) == 0) || _23 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 { - return Api.StarGift.starGiftUnique(flags: _1!, id: _2!, giftId: _3!, title: _4!, slug: _5!, num: _6!, ownerId: _7, ownerName: _8, ownerAddress: _9, attributes: _10!, availabilityIssued: _11!, availabilityTotal: _12!, giftAddress: _13, resellAmount: _14, releasedBy: _15, valueAmount: _16, valueCurrency: _17, valueUsdAmount: _18, themePeer: _19, peerColor: _20, hostId: _21, offerMinStars: _22, craftChancePermille: _23) + return Api.StarGift.starGiftUnique(Cons_starGiftUnique(flags: _1!, id: _2!, giftId: _3!, title: _4!, slug: _5!, num: _6!, ownerId: _7, ownerName: _8, ownerAddress: _9, attributes: _10!, availabilityIssued: _11!, availabilityTotal: _12!, giftAddress: _13, resellAmount: _14, releasedBy: _15, valueAmount: _16, valueCurrency: _17, valueUsdAmount: _18, themePeer: _19, peerColor: _20, hostId: _21, offerMinStars: _22, craftChancePermille: _23)) } else { return nil } } - } } public extension Api { enum StarGiftActiveAuctionState: TypeConstructorDescription { - case starGiftActiveAuctionState(gift: Api.StarGift, state: Api.StarGiftAuctionState, userState: Api.StarGiftAuctionUserState) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftActiveAuctionState(let gift, let state, let userState): - if boxed { - buffer.appendInt32(-753154979) - } - gift.serialize(buffer, true) - state.serialize(buffer, true) - userState.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftActiveAuctionState(let gift, let state, let userState): - return ("starGiftActiveAuctionState", [("gift", gift as Any), ("state", state as Any), ("userState", userState as Any)]) - } - } - + public class Cons_starGiftActiveAuctionState { + public var gift: Api.StarGift + public var state: Api.StarGiftAuctionState + public var userState: Api.StarGiftAuctionUserState + public init(gift: Api.StarGift, state: Api.StarGiftAuctionState, userState: Api.StarGiftAuctionUserState) { + self.gift = gift + self.state = state + self.userState = userState + } + } + case starGiftActiveAuctionState(Cons_starGiftActiveAuctionState) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftActiveAuctionState(let _data): + if boxed { + buffer.appendInt32(-753154979) + } + _data.gift.serialize(buffer, true) + _data.state.serialize(buffer, true) + _data.userState.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftActiveAuctionState(let _data): + return ("starGiftActiveAuctionState", [("gift", _data.gift as Any), ("state", _data.state as Any), ("userState", _data.userState as Any)]) + } + } + public static func parse_starGiftActiveAuctionState(_ reader: BufferReader) -> StarGiftActiveAuctionState? { var _1: Api.StarGift? if let signature = reader.readInt32() { @@ -583,79 +923,136 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarGiftActiveAuctionState.starGiftActiveAuctionState(gift: _1!, state: _2!, userState: _3!) + return Api.StarGiftActiveAuctionState.starGiftActiveAuctionState(Cons_starGiftActiveAuctionState(gift: _1!, state: _2!, userState: _3!)) } else { return nil } } - } } public extension Api { enum StarGiftAttribute: TypeConstructorDescription { - case starGiftAttributeBackdrop(name: String, backdropId: Int32, centerColor: Int32, edgeColor: Int32, patternColor: Int32, textColor: Int32, rarity: Api.StarGiftAttributeRarity) - case starGiftAttributeModel(flags: Int32, name: String, document: Api.Document, rarity: Api.StarGiftAttributeRarity) - case starGiftAttributeOriginalDetails(flags: Int32, senderId: Api.Peer?, recipientId: Api.Peer, date: Int32, message: Api.TextWithEntities?) - case starGiftAttributePattern(name: String, document: Api.Document, rarity: Api.StarGiftAttributeRarity) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeBackdrop(let name, let backdropId, let centerColor, let edgeColor, let patternColor, let textColor, let rarity): - if boxed { - buffer.appendInt32(-1624963868) - } - serializeString(name, buffer: buffer, boxed: false) - serializeInt32(backdropId, buffer: buffer, boxed: false) - serializeInt32(centerColor, buffer: buffer, boxed: false) - serializeInt32(edgeColor, buffer: buffer, boxed: false) - serializeInt32(patternColor, buffer: buffer, boxed: false) - serializeInt32(textColor, buffer: buffer, boxed: false) - rarity.serialize(buffer, true) - break - case .starGiftAttributeModel(let flags, let name, let document, let rarity): - if boxed { - buffer.appendInt32(1448235490) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - document.serialize(buffer, true) - rarity.serialize(buffer, true) - break - case .starGiftAttributeOriginalDetails(let flags, let senderId, let recipientId, let date, let message): - if boxed { - buffer.appendInt32(-524291476) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {senderId!.serialize(buffer, true)} - recipientId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - break - case .starGiftAttributePattern(let name, let document, let rarity): - if boxed { - buffer.appendInt32(1315997162) - } - serializeString(name, buffer: buffer, boxed: false) - document.serialize(buffer, true) - rarity.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeBackdrop(let name, let backdropId, let centerColor, let edgeColor, let patternColor, let textColor, let rarity): - return ("starGiftAttributeBackdrop", [("name", name as Any), ("backdropId", backdropId as Any), ("centerColor", centerColor as Any), ("edgeColor", edgeColor as Any), ("patternColor", patternColor as Any), ("textColor", textColor as Any), ("rarity", rarity as Any)]) - case .starGiftAttributeModel(let flags, let name, let document, let rarity): - return ("starGiftAttributeModel", [("flags", flags as Any), ("name", name as Any), ("document", document as Any), ("rarity", rarity as Any)]) - case .starGiftAttributeOriginalDetails(let flags, let senderId, let recipientId, let date, let message): - return ("starGiftAttributeOriginalDetails", [("flags", flags as Any), ("senderId", senderId as Any), ("recipientId", recipientId as Any), ("date", date as Any), ("message", message as Any)]) - case .starGiftAttributePattern(let name, let document, let rarity): - return ("starGiftAttributePattern", [("name", name as Any), ("document", document as Any), ("rarity", rarity as Any)]) - } - } - + public class Cons_starGiftAttributeBackdrop { + public var name: String + public var backdropId: Int32 + public var centerColor: Int32 + public var edgeColor: Int32 + public var patternColor: Int32 + public var textColor: Int32 + public var rarity: Api.StarGiftAttributeRarity + public init(name: String, backdropId: Int32, centerColor: Int32, edgeColor: Int32, patternColor: Int32, textColor: Int32, rarity: Api.StarGiftAttributeRarity) { + self.name = name + self.backdropId = backdropId + self.centerColor = centerColor + self.edgeColor = edgeColor + self.patternColor = patternColor + self.textColor = textColor + self.rarity = rarity + } + } + public class Cons_starGiftAttributeModel { + public var flags: Int32 + public var name: String + public var document: Api.Document + public var rarity: Api.StarGiftAttributeRarity + public init(flags: Int32, name: String, document: Api.Document, rarity: Api.StarGiftAttributeRarity) { + self.flags = flags + self.name = name + self.document = document + self.rarity = rarity + } + } + public class Cons_starGiftAttributeOriginalDetails { + public var flags: Int32 + public var senderId: Api.Peer? + public var recipientId: Api.Peer + public var date: Int32 + public var message: Api.TextWithEntities? + public init(flags: Int32, senderId: Api.Peer?, recipientId: Api.Peer, date: Int32, message: Api.TextWithEntities?) { + self.flags = flags + self.senderId = senderId + self.recipientId = recipientId + self.date = date + self.message = message + } + } + public class Cons_starGiftAttributePattern { + public var name: String + public var document: Api.Document + public var rarity: Api.StarGiftAttributeRarity + public init(name: String, document: Api.Document, rarity: Api.StarGiftAttributeRarity) { + self.name = name + self.document = document + self.rarity = rarity + } + } + case starGiftAttributeBackdrop(Cons_starGiftAttributeBackdrop) + case starGiftAttributeModel(Cons_starGiftAttributeModel) + case starGiftAttributeOriginalDetails(Cons_starGiftAttributeOriginalDetails) + case starGiftAttributePattern(Cons_starGiftAttributePattern) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAttributeBackdrop(let _data): + if boxed { + buffer.appendInt32(-1624963868) + } + serializeString(_data.name, buffer: buffer, boxed: false) + serializeInt32(_data.backdropId, buffer: buffer, boxed: false) + serializeInt32(_data.centerColor, buffer: buffer, boxed: false) + serializeInt32(_data.edgeColor, buffer: buffer, boxed: false) + serializeInt32(_data.patternColor, buffer: buffer, boxed: false) + serializeInt32(_data.textColor, buffer: buffer, boxed: false) + _data.rarity.serialize(buffer, true) + break + case .starGiftAttributeModel(let _data): + if boxed { + buffer.appendInt32(1448235490) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + _data.document.serialize(buffer, true) + _data.rarity.serialize(buffer, true) + break + case .starGiftAttributeOriginalDetails(let _data): + if boxed { + buffer.appendInt32(-524291476) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.senderId!.serialize(buffer, true) + } + _data.recipientId.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + break + case .starGiftAttributePattern(let _data): + if boxed { + buffer.appendInt32(1315997162) + } + serializeString(_data.name, buffer: buffer, boxed: false) + _data.document.serialize(buffer, true) + _data.rarity.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAttributeBackdrop(let _data): + return ("starGiftAttributeBackdrop", [("name", _data.name as Any), ("backdropId", _data.backdropId as Any), ("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("patternColor", _data.patternColor as Any), ("textColor", _data.textColor as Any), ("rarity", _data.rarity as Any)]) + case .starGiftAttributeModel(let _data): + return ("starGiftAttributeModel", [("flags", _data.flags as Any), ("name", _data.name as Any), ("document", _data.document as Any), ("rarity", _data.rarity as Any)]) + case .starGiftAttributeOriginalDetails(let _data): + return ("starGiftAttributeOriginalDetails", [("flags", _data.flags as Any), ("senderId", _data.senderId as Any), ("recipientId", _data.recipientId as Any), ("date", _data.date as Any), ("message", _data.message as Any)]) + case .starGiftAttributePattern(let _data): + return ("starGiftAttributePattern", [("name", _data.name as Any), ("document", _data.document as Any), ("rarity", _data.rarity as Any)]) + } + } + public static func parse_starGiftAttributeBackdrop(_ reader: BufferReader) -> StarGiftAttribute? { var _1: String? _1 = parseString(reader) @@ -681,7 +1078,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarGiftAttribute.starGiftAttributeBackdrop(name: _1!, backdropId: _2!, centerColor: _3!, edgeColor: _4!, patternColor: _5!, textColor: _6!, rarity: _7!) + return Api.StarGiftAttribute.starGiftAttributeBackdrop(Cons_starGiftAttributeBackdrop(name: _1!, backdropId: _2!, centerColor: _3!, edgeColor: _4!, patternColor: _5!, textColor: _6!, rarity: _7!)) } else { return nil @@ -705,7 +1102,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StarGiftAttribute.starGiftAttributeModel(flags: _1!, name: _2!, document: _3!, rarity: _4!) + return Api.StarGiftAttribute.starGiftAttributeModel(Cons_starGiftAttributeModel(flags: _1!, name: _2!, document: _3!, rarity: _4!)) } else { return nil @@ -715,9 +1112,11 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Api.Peer? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.Peer @@ -725,16 +1124,18 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarGiftAttribute.starGiftAttributeOriginalDetails(flags: _1!, senderId: _2, recipientId: _3!, date: _4!, message: _5) + return Api.StarGiftAttribute.starGiftAttributeOriginalDetails(Cons_starGiftAttributeOriginalDetails(flags: _1!, senderId: _2, recipientId: _3!, date: _4!, message: _5)) } else { return nil @@ -755,38 +1156,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarGiftAttribute.starGiftAttributePattern(name: _1!, document: _2!, rarity: _3!) + return Api.StarGiftAttribute.starGiftAttributePattern(Cons_starGiftAttributePattern(name: _1!, document: _2!, rarity: _3!)) } else { return nil } } - } } public extension Api { enum StarGiftAttributeCounter: TypeConstructorDescription { - case starGiftAttributeCounter(attribute: Api.StarGiftAttributeId, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeCounter(let attribute, let count): - if boxed { - buffer.appendInt32(783398488) - } - attribute.serialize(buffer, true) - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeCounter(let attribute, let count): - return ("starGiftAttributeCounter", [("attribute", attribute as Any), ("count", count as Any)]) - } - } - + public class Cons_starGiftAttributeCounter { + public var attribute: Api.StarGiftAttributeId + public var count: Int32 + public init(attribute: Api.StarGiftAttributeId, count: Int32) { + self.attribute = attribute + self.count = count + } + } + case starGiftAttributeCounter(Cons_starGiftAttributeCounter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAttributeCounter(let _data): + if boxed { + buffer.appendInt32(783398488) + } + _data.attribute.serialize(buffer, true) + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAttributeCounter(let _data): + return ("starGiftAttributeCounter", [("attribute", _data.attribute as Any), ("count", _data.count as Any)]) + } + } + public static func parse_starGiftAttributeCounter(_ reader: BufferReader) -> StarGiftAttributeCounter? { var _1: Api.StarGiftAttributeId? if let signature = reader.readInt32() { @@ -797,61 +1205,78 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarGiftAttributeCounter.starGiftAttributeCounter(attribute: _1!, count: _2!) + return Api.StarGiftAttributeCounter.starGiftAttributeCounter(Cons_starGiftAttributeCounter(attribute: _1!, count: _2!)) } else { return nil } } - } } public extension Api { enum StarGiftAttributeId: TypeConstructorDescription { - case starGiftAttributeIdBackdrop(backdropId: Int32) - case starGiftAttributeIdModel(documentId: Int64) - case starGiftAttributeIdPattern(documentId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeIdBackdrop(let backdropId): - if boxed { - buffer.appendInt32(520210263) - } - serializeInt32(backdropId, buffer: buffer, boxed: false) - break - case .starGiftAttributeIdModel(let documentId): - if boxed { - buffer.appendInt32(1219145276) - } - serializeInt64(documentId, buffer: buffer, boxed: false) - break - case .starGiftAttributeIdPattern(let documentId): - if boxed { - buffer.appendInt32(1242965043) - } - serializeInt64(documentId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeIdBackdrop(let backdropId): - return ("starGiftAttributeIdBackdrop", [("backdropId", backdropId as Any)]) - case .starGiftAttributeIdModel(let documentId): - return ("starGiftAttributeIdModel", [("documentId", documentId as Any)]) - case .starGiftAttributeIdPattern(let documentId): - return ("starGiftAttributeIdPattern", [("documentId", documentId as Any)]) - } - } - + public class Cons_starGiftAttributeIdBackdrop { + public var backdropId: Int32 + public init(backdropId: Int32) { + self.backdropId = backdropId + } + } + public class Cons_starGiftAttributeIdModel { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + } + public class Cons_starGiftAttributeIdPattern { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + } + case starGiftAttributeIdBackdrop(Cons_starGiftAttributeIdBackdrop) + case starGiftAttributeIdModel(Cons_starGiftAttributeIdModel) + case starGiftAttributeIdPattern(Cons_starGiftAttributeIdPattern) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAttributeIdBackdrop(let _data): + if boxed { + buffer.appendInt32(520210263) + } + serializeInt32(_data.backdropId, buffer: buffer, boxed: false) + break + case .starGiftAttributeIdModel(let _data): + if boxed { + buffer.appendInt32(1219145276) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + break + case .starGiftAttributeIdPattern(let _data): + if boxed { + buffer.appendInt32(1242965043) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAttributeIdBackdrop(let _data): + return ("starGiftAttributeIdBackdrop", [("backdropId", _data.backdropId as Any)]) + case .starGiftAttributeIdModel(let _data): + return ("starGiftAttributeIdModel", [("documentId", _data.documentId as Any)]) + case .starGiftAttributeIdPattern(let _data): + return ("starGiftAttributeIdPattern", [("documentId", _data.documentId as Any)]) + } + } + public static func parse_starGiftAttributeIdBackdrop(_ reader: BufferReader) -> StarGiftAttributeId? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdBackdrop(backdropId: _1!) + return Api.StarGiftAttributeId.starGiftAttributeIdBackdrop(Cons_starGiftAttributeIdBackdrop(backdropId: _1!)) } else { return nil @@ -862,7 +1287,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdModel(documentId: _1!) + return Api.StarGiftAttributeId.starGiftAttributeIdModel(Cons_starGiftAttributeIdModel(documentId: _1!)) } else { return nil @@ -873,70 +1298,72 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdPattern(documentId: _1!) + return Api.StarGiftAttributeId.starGiftAttributeIdPattern(Cons_starGiftAttributeIdPattern(documentId: _1!)) } else { return nil } } - } } public extension Api { enum StarGiftAttributeRarity: TypeConstructorDescription { - case starGiftAttributeRarity(permille: Int32) + public class Cons_starGiftAttributeRarity { + public var permille: Int32 + public init(permille: Int32) { + self.permille = permille + } + } + case starGiftAttributeRarity(Cons_starGiftAttributeRarity) case starGiftAttributeRarityEpic case starGiftAttributeRarityLegendary case starGiftAttributeRarityRare - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeRarity(let permille): - if boxed { - buffer.appendInt32(910391095) - } - serializeInt32(permille, buffer: buffer, boxed: false) - break - case .starGiftAttributeRarityEpic: - if boxed { - buffer.appendInt32(2029777832) - } - - break - case .starGiftAttributeRarityLegendary: - if boxed { - buffer.appendInt32(-822614104) - } - - break - case .starGiftAttributeRarityRare: - if boxed { - buffer.appendInt32(-259174037) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeRarity(let permille): - return ("starGiftAttributeRarity", [("permille", permille as Any)]) - case .starGiftAttributeRarityEpic: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAttributeRarity(let _data): + if boxed { + buffer.appendInt32(910391095) + } + serializeInt32(_data.permille, buffer: buffer, boxed: false) + break + case .starGiftAttributeRarityEpic: + if boxed { + buffer.appendInt32(2029777832) + } + break + case .starGiftAttributeRarityLegendary: + if boxed { + buffer.appendInt32(-822614104) + } + break + case .starGiftAttributeRarityRare: + if boxed { + buffer.appendInt32(-259174037) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAttributeRarity(let _data): + return ("starGiftAttributeRarity", [("permille", _data.permille as Any)]) + case .starGiftAttributeRarityEpic: return ("starGiftAttributeRarityEpic", []) - case .starGiftAttributeRarityLegendary: + case .starGiftAttributeRarityLegendary: return ("starGiftAttributeRarityLegendary", []) - case .starGiftAttributeRarityRare: + case .starGiftAttributeRarityRare: return ("starGiftAttributeRarityRare", []) - } - } - + } + } + public static func parse_starGiftAttributeRarity(_ reader: BufferReader) -> StarGiftAttributeRarity? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.StarGiftAttributeRarity.starGiftAttributeRarity(permille: _1!) + return Api.StarGiftAttributeRarity.starGiftAttributeRarity(Cons_starGiftAttributeRarity(permille: _1!)) } else { return nil @@ -951,38 +1378,61 @@ public extension Api { public static func parse_starGiftAttributeRarityRare(_ reader: BufferReader) -> StarGiftAttributeRarity? { return Api.StarGiftAttributeRarity.starGiftAttributeRarityRare } - } } public extension Api { enum StarGiftAuctionAcquiredGift: TypeConstructorDescription { - case starGiftAuctionAcquiredGift(flags: Int32, peer: Api.Peer, date: Int32, bidAmount: Int64, round: Int32, pos: Int32, message: Api.TextWithEntities?, giftNum: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionAcquiredGift(let flags, let peer, let date, let bidAmount, let round, let pos, let message, let giftNum): - if boxed { - buffer.appendInt32(1118831432) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(bidAmount, buffer: buffer, boxed: false) - serializeInt32(round, buffer: buffer, boxed: false) - serializeInt32(pos, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {message!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(giftNum!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionAcquiredGift(let flags, let peer, let date, let bidAmount, let round, let pos, let message, let giftNum): - return ("starGiftAuctionAcquiredGift", [("flags", flags as Any), ("peer", peer as Any), ("date", date as Any), ("bidAmount", bidAmount as Any), ("round", round as Any), ("pos", pos as Any), ("message", message as Any), ("giftNum", giftNum as Any)]) - } - } - + public class Cons_starGiftAuctionAcquiredGift { + public var flags: Int32 + public var peer: Api.Peer + public var date: Int32 + public var bidAmount: Int64 + public var round: Int32 + public var pos: Int32 + public var message: Api.TextWithEntities? + public var giftNum: Int32? + public init(flags: Int32, peer: Api.Peer, date: Int32, bidAmount: Int64, round: Int32, pos: Int32, message: Api.TextWithEntities?, giftNum: Int32?) { + self.flags = flags + self.peer = peer + self.date = date + self.bidAmount = bidAmount + self.round = round + self.pos = pos + self.message = message + self.giftNum = giftNum + } + } + case starGiftAuctionAcquiredGift(Cons_starGiftAuctionAcquiredGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionAcquiredGift(let _data): + if boxed { + buffer.appendInt32(1118831432) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.bidAmount, buffer: buffer, boxed: false) + serializeInt32(_data.round, buffer: buffer, boxed: false) + serializeInt32(_data.pos, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.message!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.giftNum!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionAcquiredGift(let _data): + return ("starGiftAuctionAcquiredGift", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("bidAmount", _data.bidAmount as Any), ("round", _data.round as Any), ("pos", _data.pos as Any), ("message", _data.message as Any), ("giftNum", _data.giftNum as Any)]) + } + } + public static func parse_starGiftAuctionAcquiredGift(_ reader: BufferReader) -> StarGiftAuctionAcquiredGift? { var _1: Int32? _1 = reader.readInt32() @@ -999,11 +1449,15 @@ public extension Api { var _6: Int32? _6 = reader.readInt32() var _7: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } var _8: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _8 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1013,50 +1467,69 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.StarGiftAuctionAcquiredGift.starGiftAuctionAcquiredGift(flags: _1!, peer: _2!, date: _3!, bidAmount: _4!, round: _5!, pos: _6!, message: _7, giftNum: _8) + return Api.StarGiftAuctionAcquiredGift.starGiftAuctionAcquiredGift(Cons_starGiftAuctionAcquiredGift(flags: _1!, peer: _2!, date: _3!, bidAmount: _4!, round: _5!, pos: _6!, message: _7, giftNum: _8)) } else { return nil } } - } } public extension Api { enum StarGiftAuctionRound: TypeConstructorDescription { - case starGiftAuctionRound(num: Int32, duration: Int32) - case starGiftAuctionRoundExtendable(num: Int32, duration: Int32, extendTop: Int32, extendWindow: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionRound(let num, let duration): - if boxed { - buffer.appendInt32(984483112) - } - serializeInt32(num, buffer: buffer, boxed: false) - serializeInt32(duration, buffer: buffer, boxed: false) - break - case .starGiftAuctionRoundExtendable(let num, let duration, let extendTop, let extendWindow): - if boxed { - buffer.appendInt32(178266597) - } - serializeInt32(num, buffer: buffer, boxed: false) - serializeInt32(duration, buffer: buffer, boxed: false) - serializeInt32(extendTop, buffer: buffer, boxed: false) - serializeInt32(extendWindow, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionRound(let num, let duration): - return ("starGiftAuctionRound", [("num", num as Any), ("duration", duration as Any)]) - case .starGiftAuctionRoundExtendable(let num, let duration, let extendTop, let extendWindow): - return ("starGiftAuctionRoundExtendable", [("num", num as Any), ("duration", duration as Any), ("extendTop", extendTop as Any), ("extendWindow", extendWindow as Any)]) - } - } - + public class Cons_starGiftAuctionRound { + public var num: Int32 + public var duration: Int32 + public init(num: Int32, duration: Int32) { + self.num = num + self.duration = duration + } + } + public class Cons_starGiftAuctionRoundExtendable { + public var num: Int32 + public var duration: Int32 + public var extendTop: Int32 + public var extendWindow: Int32 + public init(num: Int32, duration: Int32, extendTop: Int32, extendWindow: Int32) { + self.num = num + self.duration = duration + self.extendTop = extendTop + self.extendWindow = extendWindow + } + } + case starGiftAuctionRound(Cons_starGiftAuctionRound) + case starGiftAuctionRoundExtendable(Cons_starGiftAuctionRoundExtendable) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionRound(let _data): + if boxed { + buffer.appendInt32(984483112) + } + serializeInt32(_data.num, buffer: buffer, boxed: false) + serializeInt32(_data.duration, buffer: buffer, boxed: false) + break + case .starGiftAuctionRoundExtendable(let _data): + if boxed { + buffer.appendInt32(178266597) + } + serializeInt32(_data.num, buffer: buffer, boxed: false) + serializeInt32(_data.duration, buffer: buffer, boxed: false) + serializeInt32(_data.extendTop, buffer: buffer, boxed: false) + serializeInt32(_data.extendWindow, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionRound(let _data): + return ("starGiftAuctionRound", [("num", _data.num as Any), ("duration", _data.duration as Any)]) + case .starGiftAuctionRoundExtendable(let _data): + return ("starGiftAuctionRoundExtendable", [("num", _data.num as Any), ("duration", _data.duration as Any), ("extendTop", _data.extendTop as Any), ("extendWindow", _data.extendWindow as Any)]) + } + } + public static func parse_starGiftAuctionRound(_ reader: BufferReader) -> StarGiftAuctionRound? { var _1: Int32? _1 = reader.readInt32() @@ -1065,7 +1538,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarGiftAuctionRound.starGiftAuctionRound(num: _1!, duration: _2!) + return Api.StarGiftAuctionRound.starGiftAuctionRound(Cons_starGiftAuctionRound(num: _1!, duration: _2!)) } else { return nil @@ -1085,84 +1558,134 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StarGiftAuctionRound.starGiftAuctionRoundExtendable(num: _1!, duration: _2!, extendTop: _3!, extendWindow: _4!) + return Api.StarGiftAuctionRound.starGiftAuctionRoundExtendable(Cons_starGiftAuctionRoundExtendable(num: _1!, duration: _2!, extendTop: _3!, extendWindow: _4!)) } else { return nil } } - } } public extension Api { enum StarGiftAuctionState: TypeConstructorDescription { - case starGiftAuctionState(version: Int32, startDate: Int32, endDate: Int32, minBidAmount: Int64, bidLevels: [Api.AuctionBidLevel], topBidders: [Int64], nextRoundAt: Int32, lastGiftNum: Int32, giftsLeft: Int32, currentRound: Int32, totalRounds: Int32, rounds: [Api.StarGiftAuctionRound]) - case starGiftAuctionStateFinished(flags: Int32, startDate: Int32, endDate: Int32, averagePrice: Int64, listedCount: Int32?, fragmentListedCount: Int32?, fragmentListedUrl: String?) + public class Cons_starGiftAuctionState { + public var version: Int32 + public var startDate: Int32 + public var endDate: Int32 + public var minBidAmount: Int64 + public var bidLevels: [Api.AuctionBidLevel] + public var topBidders: [Int64] + public var nextRoundAt: Int32 + public var lastGiftNum: Int32 + public var giftsLeft: Int32 + public var currentRound: Int32 + public var totalRounds: Int32 + public var rounds: [Api.StarGiftAuctionRound] + public init(version: Int32, startDate: Int32, endDate: Int32, minBidAmount: Int64, bidLevels: [Api.AuctionBidLevel], topBidders: [Int64], nextRoundAt: Int32, lastGiftNum: Int32, giftsLeft: Int32, currentRound: Int32, totalRounds: Int32, rounds: [Api.StarGiftAuctionRound]) { + self.version = version + self.startDate = startDate + self.endDate = endDate + self.minBidAmount = minBidAmount + self.bidLevels = bidLevels + self.topBidders = topBidders + self.nextRoundAt = nextRoundAt + self.lastGiftNum = lastGiftNum + self.giftsLeft = giftsLeft + self.currentRound = currentRound + self.totalRounds = totalRounds + self.rounds = rounds + } + } + public class Cons_starGiftAuctionStateFinished { + public var flags: Int32 + public var startDate: Int32 + public var endDate: Int32 + public var averagePrice: Int64 + public var listedCount: Int32? + public var fragmentListedCount: Int32? + public var fragmentListedUrl: String? + public init(flags: Int32, startDate: Int32, endDate: Int32, averagePrice: Int64, listedCount: Int32?, fragmentListedCount: Int32?, fragmentListedUrl: String?) { + self.flags = flags + self.startDate = startDate + self.endDate = endDate + self.averagePrice = averagePrice + self.listedCount = listedCount + self.fragmentListedCount = fragmentListedCount + self.fragmentListedUrl = fragmentListedUrl + } + } + case starGiftAuctionState(Cons_starGiftAuctionState) + case starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished) case starGiftAuctionStateNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionState(let version, let startDate, let endDate, let minBidAmount, let bidLevels, let topBidders, let nextRoundAt, let lastGiftNum, let giftsLeft, let currentRound, let totalRounds, let rounds): - if boxed { - buffer.appendInt32(1998212710) - } - serializeInt32(version, buffer: buffer, boxed: false) - serializeInt32(startDate, buffer: buffer, boxed: false) - serializeInt32(endDate, buffer: buffer, boxed: false) - serializeInt64(minBidAmount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(bidLevels.count)) - for item in bidLevels { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topBidders.count)) - for item in topBidders { - serializeInt64(item, buffer: buffer, boxed: false) - } - serializeInt32(nextRoundAt, buffer: buffer, boxed: false) - serializeInt32(lastGiftNum, buffer: buffer, boxed: false) - serializeInt32(giftsLeft, buffer: buffer, boxed: false) - serializeInt32(currentRound, buffer: buffer, boxed: false) - serializeInt32(totalRounds, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rounds.count)) - for item in rounds { - item.serialize(buffer, true) - } - break - case .starGiftAuctionStateFinished(let flags, let startDate, let endDate, let averagePrice, let listedCount, let fragmentListedCount, let fragmentListedUrl): - if boxed { - buffer.appendInt32(-1758614593) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(startDate, buffer: buffer, boxed: false) - serializeInt32(endDate, buffer: buffer, boxed: false) - serializeInt64(averagePrice, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(listedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(fragmentListedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(fragmentListedUrl!, buffer: buffer, boxed: false)} - break - case .starGiftAuctionStateNotModified: - if boxed { - buffer.appendInt32(-30197422) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionState(let version, let startDate, let endDate, let minBidAmount, let bidLevels, let topBidders, let nextRoundAt, let lastGiftNum, let giftsLeft, let currentRound, let totalRounds, let rounds): - return ("starGiftAuctionState", [("version", version as Any), ("startDate", startDate as Any), ("endDate", endDate as Any), ("minBidAmount", minBidAmount as Any), ("bidLevels", bidLevels as Any), ("topBidders", topBidders as Any), ("nextRoundAt", nextRoundAt as Any), ("lastGiftNum", lastGiftNum as Any), ("giftsLeft", giftsLeft as Any), ("currentRound", currentRound as Any), ("totalRounds", totalRounds as Any), ("rounds", rounds as Any)]) - case .starGiftAuctionStateFinished(let flags, let startDate, let endDate, let averagePrice, let listedCount, let fragmentListedCount, let fragmentListedUrl): - return ("starGiftAuctionStateFinished", [("flags", flags as Any), ("startDate", startDate as Any), ("endDate", endDate as Any), ("averagePrice", averagePrice as Any), ("listedCount", listedCount as Any), ("fragmentListedCount", fragmentListedCount as Any), ("fragmentListedUrl", fragmentListedUrl as Any)]) - case .starGiftAuctionStateNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionState(let _data): + if boxed { + buffer.appendInt32(1998212710) + } + serializeInt32(_data.version, buffer: buffer, boxed: false) + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + serializeInt32(_data.endDate, buffer: buffer, boxed: false) + serializeInt64(_data.minBidAmount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.bidLevels.count)) + for item in _data.bidLevels { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topBidders.count)) + for item in _data.topBidders { + serializeInt64(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.nextRoundAt, buffer: buffer, boxed: false) + serializeInt32(_data.lastGiftNum, buffer: buffer, boxed: false) + serializeInt32(_data.giftsLeft, buffer: buffer, boxed: false) + serializeInt32(_data.currentRound, buffer: buffer, boxed: false) + serializeInt32(_data.totalRounds, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rounds.count)) + for item in _data.rounds { + item.serialize(buffer, true) + } + break + case .starGiftAuctionStateFinished(let _data): + if boxed { + buffer.appendInt32(-1758614593) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + serializeInt32(_data.endDate, buffer: buffer, boxed: false) + serializeInt64(_data.averagePrice, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.listedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.fragmentListedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.fragmentListedUrl!, buffer: buffer, boxed: false) + } + break + case .starGiftAuctionStateNotModified: + if boxed { + buffer.appendInt32(-30197422) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionState(let _data): + return ("starGiftAuctionState", [("version", _data.version as Any), ("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any), ("minBidAmount", _data.minBidAmount as Any), ("bidLevels", _data.bidLevels as Any), ("topBidders", _data.topBidders as Any), ("nextRoundAt", _data.nextRoundAt as Any), ("lastGiftNum", _data.lastGiftNum as Any), ("giftsLeft", _data.giftsLeft as Any), ("currentRound", _data.currentRound as Any), ("totalRounds", _data.totalRounds as Any), ("rounds", _data.rounds as Any)]) + case .starGiftAuctionStateFinished(let _data): + return ("starGiftAuctionStateFinished", [("flags", _data.flags as Any), ("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any), ("averagePrice", _data.averagePrice as Any), ("listedCount", _data.listedCount as Any), ("fragmentListedCount", _data.fragmentListedCount as Any), ("fragmentListedUrl", _data.fragmentListedUrl as Any)]) + case .starGiftAuctionStateNotModified: return ("starGiftAuctionStateNotModified", []) - } - } - + } + } + public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { var _1: Int32? _1 = reader.readInt32() @@ -1207,7 +1730,7 @@ public extension Api { let _c11 = _11 != nil let _c12 = _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.StarGiftAuctionState.starGiftAuctionState(version: _1!, startDate: _2!, endDate: _3!, minBidAmount: _4!, bidLevels: _5!, topBidders: _6!, nextRoundAt: _7!, lastGiftNum: _8!, giftsLeft: _9!, currentRound: _10!, totalRounds: _11!, rounds: _12!) + return Api.StarGiftAuctionState.starGiftAuctionState(Cons_starGiftAuctionState(version: _1!, startDate: _2!, endDate: _3!, minBidAmount: _4!, bidLevels: _5!, topBidders: _6!, nextRoundAt: _7!, lastGiftNum: _8!, giftsLeft: _9!, currentRound: _10!, totalRounds: _11!, rounds: _12!)) } else { return nil @@ -1223,11 +1746,17 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1236,7 +1765,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarGiftAuctionState.starGiftAuctionStateFinished(flags: _1!, startDate: _2!, endDate: _3!, averagePrice: _4!, listedCount: _5, fragmentListedCount: _6, fragmentListedUrl: _7) + return Api.StarGiftAuctionState.starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished(flags: _1!, startDate: _2!, endDate: _3!, averagePrice: _4!, listedCount: _5, fragmentListedCount: _6, fragmentListedUrl: _7)) } else { return nil @@ -1245,49 +1774,80 @@ public extension Api { public static func parse_starGiftAuctionStateNotModified(_ reader: BufferReader) -> StarGiftAuctionState? { return Api.StarGiftAuctionState.starGiftAuctionStateNotModified } - } } public extension Api { enum StarGiftAuctionUserState: TypeConstructorDescription { - case starGiftAuctionUserState(flags: Int32, bidAmount: Int64?, bidDate: Int32?, minBidAmount: Int64?, bidPeer: Api.Peer?, acquiredCount: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionUserState(let flags, let bidAmount, let bidDate, let minBidAmount, let bidPeer, let acquiredCount): - if boxed { - buffer.appendInt32(787403204) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(bidAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(bidDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(minBidAmount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {bidPeer!.serialize(buffer, true)} - serializeInt32(acquiredCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionUserState(let flags, let bidAmount, let bidDate, let minBidAmount, let bidPeer, let acquiredCount): - return ("starGiftAuctionUserState", [("flags", flags as Any), ("bidAmount", bidAmount as Any), ("bidDate", bidDate as Any), ("minBidAmount", minBidAmount as Any), ("bidPeer", bidPeer as Any), ("acquiredCount", acquiredCount as Any)]) - } - } - + public class Cons_starGiftAuctionUserState { + public var flags: Int32 + public var bidAmount: Int64? + public var bidDate: Int32? + public var minBidAmount: Int64? + public var bidPeer: Api.Peer? + public var acquiredCount: Int32 + public init(flags: Int32, bidAmount: Int64?, bidDate: Int32?, minBidAmount: Int64?, bidPeer: Api.Peer?, acquiredCount: Int32) { + self.flags = flags + self.bidAmount = bidAmount + self.bidDate = bidDate + self.minBidAmount = minBidAmount + self.bidPeer = bidPeer + self.acquiredCount = acquiredCount + } + } + case starGiftAuctionUserState(Cons_starGiftAuctionUserState) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionUserState(let _data): + if boxed { + buffer.appendInt32(787403204) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.bidAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.bidDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.minBidAmount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.bidPeer!.serialize(buffer, true) + } + serializeInt32(_data.acquiredCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionUserState(let _data): + return ("starGiftAuctionUserState", [("flags", _data.flags as Any), ("bidAmount", _data.bidAmount as Any), ("bidDate", _data.bidDate as Any), ("minBidAmount", _data.minBidAmount as Any), ("bidPeer", _data.bidPeer as Any), ("acquiredCount", _data.acquiredCount as Any)]) + } + } + public static func parse_starGiftAuctionUserState(_ reader: BufferReader) -> StarGiftAuctionUserState? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } var _5: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _6: Int32? _6 = reader.readInt32() let _c1 = _1 != nil @@ -1297,39 +1857,48 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarGiftAuctionUserState.starGiftAuctionUserState(flags: _1!, bidAmount: _2, bidDate: _3, minBidAmount: _4, bidPeer: _5, acquiredCount: _6!) + return Api.StarGiftAuctionUserState.starGiftAuctionUserState(Cons_starGiftAuctionUserState(flags: _1!, bidAmount: _2, bidDate: _3, minBidAmount: _4, bidPeer: _5, acquiredCount: _6!)) } else { return nil } } - } } public extension Api { enum StarGiftBackground: TypeConstructorDescription { - case starGiftBackground(centerColor: Int32, edgeColor: Int32, textColor: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftBackground(let centerColor, let edgeColor, let textColor): - if boxed { - buffer.appendInt32(-1342872680) - } - serializeInt32(centerColor, buffer: buffer, boxed: false) - serializeInt32(edgeColor, buffer: buffer, boxed: false) - serializeInt32(textColor, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftBackground(let centerColor, let edgeColor, let textColor): - return ("starGiftBackground", [("centerColor", centerColor as Any), ("edgeColor", edgeColor as Any), ("textColor", textColor as Any)]) - } - } - + public class Cons_starGiftBackground { + public var centerColor: Int32 + public var edgeColor: Int32 + public var textColor: Int32 + public init(centerColor: Int32, edgeColor: Int32, textColor: Int32) { + self.centerColor = centerColor + self.edgeColor = edgeColor + self.textColor = textColor + } + } + case starGiftBackground(Cons_starGiftBackground) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftBackground(let _data): + if boxed { + buffer.appendInt32(-1342872680) + } + serializeInt32(_data.centerColor, buffer: buffer, boxed: false) + serializeInt32(_data.edgeColor, buffer: buffer, boxed: false) + serializeInt32(_data.textColor, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftBackground(let _data): + return ("starGiftBackground", [("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("textColor", _data.textColor as Any)]) + } + } + public static func parse_starGiftBackground(_ reader: BufferReader) -> StarGiftBackground? { var _1: Int32? _1 = reader.readInt32() @@ -1341,42 +1910,59 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarGiftBackground.starGiftBackground(centerColor: _1!, edgeColor: _2!, textColor: _3!) + return Api.StarGiftBackground.starGiftBackground(Cons_starGiftBackground(centerColor: _1!, edgeColor: _2!, textColor: _3!)) } else { return nil } } - } } public extension Api { enum StarGiftCollection: TypeConstructorDescription { - case starGiftCollection(flags: Int32, collectionId: Int32, title: String, icon: Api.Document?, giftsCount: Int32, hash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftCollection(let flags, let collectionId, let title, let icon, let giftsCount, let hash): - if boxed { - buffer.appendInt32(-1653926992) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(collectionId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {icon!.serialize(buffer, true)} - serializeInt32(giftsCount, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftCollection(let flags, let collectionId, let title, let icon, let giftsCount, let hash): - return ("starGiftCollection", [("flags", flags as Any), ("collectionId", collectionId as Any), ("title", title as Any), ("icon", icon as Any), ("giftsCount", giftsCount as Any), ("hash", hash as Any)]) - } - } - + public class Cons_starGiftCollection { + public var flags: Int32 + public var collectionId: Int32 + public var title: String + public var icon: Api.Document? + public var giftsCount: Int32 + public var hash: Int64 + public init(flags: Int32, collectionId: Int32, title: String, icon: Api.Document?, giftsCount: Int32, hash: Int64) { + self.flags = flags + self.collectionId = collectionId + self.title = title + self.icon = icon + self.giftsCount = giftsCount + self.hash = hash + } + } + case starGiftCollection(Cons_starGiftCollection) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftCollection(let _data): + if boxed { + buffer.appendInt32(-1653926992) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.collectionId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.icon!.serialize(buffer, true) + } + serializeInt32(_data.giftsCount, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftCollection(let _data): + return ("starGiftCollection", [("flags", _data.flags as Any), ("collectionId", _data.collectionId as Any), ("title", _data.title as Any), ("icon", _data.icon as Any), ("giftsCount", _data.giftsCount as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_starGiftCollection(_ reader: BufferReader) -> StarGiftCollection? { var _1: Int32? _1 = reader.readInt32() @@ -1385,9 +1971,11 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _5: Int32? _5 = reader.readInt32() var _6: Int64? @@ -1399,38 +1987,45 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarGiftCollection.starGiftCollection(flags: _1!, collectionId: _2!, title: _3!, icon: _4, giftsCount: _5!, hash: _6!) + return Api.StarGiftCollection.starGiftCollection(Cons_starGiftCollection(flags: _1!, collectionId: _2!, title: _3!, icon: _4, giftsCount: _5!, hash: _6!)) } else { return nil } } - } } public extension Api { enum StarGiftUpgradePrice: TypeConstructorDescription { - case starGiftUpgradePrice(date: Int32, upgradeStars: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftUpgradePrice(let date, let upgradeStars): - if boxed { - buffer.appendInt32(-1712704739) - } - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(upgradeStars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftUpgradePrice(let date, let upgradeStars): - return ("starGiftUpgradePrice", [("date", date as Any), ("upgradeStars", upgradeStars as Any)]) - } - } - + public class Cons_starGiftUpgradePrice { + public var date: Int32 + public var upgradeStars: Int64 + public init(date: Int32, upgradeStars: Int64) { + self.date = date + self.upgradeStars = upgradeStars + } + } + case starGiftUpgradePrice(Cons_starGiftUpgradePrice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftUpgradePrice(let _data): + if boxed { + buffer.appendInt32(-1712704739) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.upgradeStars, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftUpgradePrice(let _data): + return ("starGiftUpgradePrice", [("date", _data.date as Any), ("upgradeStars", _data.upgradeStars as Any)]) + } + } + public static func parse_starGiftUpgradePrice(_ reader: BufferReader) -> StarGiftUpgradePrice? { var _1: Int32? _1 = reader.readInt32() @@ -1439,42 +2034,63 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarGiftUpgradePrice.starGiftUpgradePrice(date: _1!, upgradeStars: _2!) + return Api.StarGiftUpgradePrice.starGiftUpgradePrice(Cons_starGiftUpgradePrice(date: _1!, upgradeStars: _2!)) } else { return nil } } - } } public extension Api { enum StarRefProgram: TypeConstructorDescription { - case starRefProgram(flags: Int32, botId: Int64, commissionPermille: Int32, durationMonths: Int32?, endDate: Int32?, dailyRevenuePerUser: Api.StarsAmount?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starRefProgram(let flags, let botId, let commissionPermille, let durationMonths, let endDate, let dailyRevenuePerUser): - if boxed { - buffer.appendInt32(-586389774) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeInt32(commissionPermille, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(durationMonths!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(endDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {dailyRevenuePerUser!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starRefProgram(let flags, let botId, let commissionPermille, let durationMonths, let endDate, let dailyRevenuePerUser): - return ("starRefProgram", [("flags", flags as Any), ("botId", botId as Any), ("commissionPermille", commissionPermille as Any), ("durationMonths", durationMonths as Any), ("endDate", endDate as Any), ("dailyRevenuePerUser", dailyRevenuePerUser as Any)]) - } - } - + public class Cons_starRefProgram { + public var flags: Int32 + public var botId: Int64 + public var commissionPermille: Int32 + public var durationMonths: Int32? + public var endDate: Int32? + public var dailyRevenuePerUser: Api.StarsAmount? + public init(flags: Int32, botId: Int64, commissionPermille: Int32, durationMonths: Int32?, endDate: Int32?, dailyRevenuePerUser: Api.StarsAmount?) { + self.flags = flags + self.botId = botId + self.commissionPermille = commissionPermille + self.durationMonths = durationMonths + self.endDate = endDate + self.dailyRevenuePerUser = dailyRevenuePerUser + } + } + case starRefProgram(Cons_starRefProgram) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starRefProgram(let _data): + if boxed { + buffer.appendInt32(-586389774) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt32(_data.commissionPermille, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.durationMonths!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.endDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.dailyRevenuePerUser!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starRefProgram(let _data): + return ("starRefProgram", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("commissionPermille", _data.commissionPermille as Any), ("durationMonths", _data.durationMonths as Any), ("endDate", _data.endDate as Any), ("dailyRevenuePerUser", _data.dailyRevenuePerUser as Any)]) + } + } + public static func parse_starRefProgram(_ reader: BufferReader) -> StarRefProgram? { var _1: Int32? _1 = reader.readInt32() @@ -1483,13 +2099,19 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } var _6: Api.StarsAmount? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1497,47 +2119,60 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarRefProgram.starRefProgram(flags: _1!, botId: _2!, commissionPermille: _3!, durationMonths: _4, endDate: _5, dailyRevenuePerUser: _6) + return Api.StarRefProgram.starRefProgram(Cons_starRefProgram(flags: _1!, botId: _2!, commissionPermille: _3!, durationMonths: _4, endDate: _5, dailyRevenuePerUser: _6)) } else { return nil } } - } } public extension Api { enum StarsAmount: TypeConstructorDescription { - case starsAmount(amount: Int64, nanos: Int32) - case starsTonAmount(amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsAmount(let amount, let nanos): - if boxed { - buffer.appendInt32(-1145654109) - } - serializeInt64(amount, buffer: buffer, boxed: false) - serializeInt32(nanos, buffer: buffer, boxed: false) - break - case .starsTonAmount(let amount): - if boxed { - buffer.appendInt32(1957618656) - } - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsAmount(let amount, let nanos): - return ("starsAmount", [("amount", amount as Any), ("nanos", nanos as Any)]) - case .starsTonAmount(let amount): - return ("starsTonAmount", [("amount", amount as Any)]) - } - } - + public class Cons_starsAmount { + public var amount: Int64 + public var nanos: Int32 + public init(amount: Int64, nanos: Int32) { + self.amount = amount + self.nanos = nanos + } + } + public class Cons_starsTonAmount { + public var amount: Int64 + public init(amount: Int64) { + self.amount = amount + } + } + case starsAmount(Cons_starsAmount) + case starsTonAmount(Cons_starsTonAmount) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsAmount(let _data): + if boxed { + buffer.appendInt32(-1145654109) + } + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeInt32(_data.nanos, buffer: buffer, boxed: false) + break + case .starsTonAmount(let _data): + if boxed { + buffer.appendInt32(1957618656) + } + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsAmount(let _data): + return ("starsAmount", [("amount", _data.amount as Any), ("nanos", _data.nanos as Any)]) + case .starsTonAmount(let _data): + return ("starsTonAmount", [("amount", _data.amount as Any)]) + } + } + public static func parse_starsAmount(_ reader: BufferReader) -> StarsAmount? { var _1: Int64? _1 = reader.readInt64() @@ -1546,7 +2181,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarsAmount.starsAmount(amount: _1!, nanos: _2!) + return Api.StarsAmount.starsAmount(Cons_starsAmount(amount: _1!, nanos: _2!)) } else { return nil @@ -1557,12 +2192,11 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.StarsAmount.starsTonAmount(amount: _1!) + return Api.StarsAmount.starsTonAmount(Cons_starsTonAmount(amount: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api26.swift b/submodules/TelegramApi/Sources/Api26.swift index a8ac14f57e..3c8ff86c4b 100644 --- a/submodules/TelegramApi/Sources/Api26.swift +++ b/submodules/TelegramApi/Sources/Api26.swift @@ -1,36 +1,54 @@ public extension Api { enum StarsGiftOption: TypeConstructorDescription { - case starsGiftOption(flags: Int32, stars: Int64, storeProduct: String?, currency: String, amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsGiftOption(let flags, let stars, let storeProduct, let currency, let amount): - if boxed { - buffer.appendInt32(1577421297) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(storeProduct!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsGiftOption(let flags, let stars, let storeProduct, let currency, let amount): - return ("starsGiftOption", [("flags", flags as Any), ("stars", stars as Any), ("storeProduct", storeProduct as Any), ("currency", currency as Any), ("amount", amount as Any)]) - } - } - + public class Cons_starsGiftOption { + public var flags: Int32 + public var stars: Int64 + public var storeProduct: String? + public var currency: String + public var amount: Int64 + public init(flags: Int32, stars: Int64, storeProduct: String?, currency: String, amount: Int64) { + self.flags = flags + self.stars = stars + self.storeProduct = storeProduct + self.currency = currency + self.amount = amount + } + } + case starsGiftOption(Cons_starsGiftOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsGiftOption(let _data): + if boxed { + buffer.appendInt32(1577421297) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.storeProduct!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsGiftOption(let _data): + return ("starsGiftOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + } + } + public static func parse_starsGiftOption(_ reader: BufferReader) -> StarsGiftOption? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? _4 = parseString(reader) var _5: Int64? @@ -41,47 +59,66 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsGiftOption.starsGiftOption(flags: _1!, stars: _2!, storeProduct: _3, currency: _4!, amount: _5!) + return Api.StarsGiftOption.starsGiftOption(Cons_starsGiftOption(flags: _1!, stars: _2!, storeProduct: _3, currency: _4!, amount: _5!)) } else { return nil } } - } } public extension Api { enum StarsGiveawayOption: TypeConstructorDescription { - case starsGiveawayOption(flags: Int32, stars: Int64, yearlyBoosts: Int32, storeProduct: String?, currency: String, amount: Int64, winners: [Api.StarsGiveawayWinnersOption]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsGiveawayOption(let flags, let stars, let yearlyBoosts, let storeProduct, let currency, let amount, let winners): - if boxed { - buffer.appendInt32(-1798404822) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - serializeInt32(yearlyBoosts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(storeProduct!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(winners.count)) - for item in winners { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsGiveawayOption(let flags, let stars, let yearlyBoosts, let storeProduct, let currency, let amount, let winners): - return ("starsGiveawayOption", [("flags", flags as Any), ("stars", stars as Any), ("yearlyBoosts", yearlyBoosts as Any), ("storeProduct", storeProduct as Any), ("currency", currency as Any), ("amount", amount as Any), ("winners", winners as Any)]) - } - } - + public class Cons_starsGiveawayOption { + public var flags: Int32 + public var stars: Int64 + public var yearlyBoosts: Int32 + public var storeProduct: String? + public var currency: String + public var amount: Int64 + public var winners: [Api.StarsGiveawayWinnersOption] + public init(flags: Int32, stars: Int64, yearlyBoosts: Int32, storeProduct: String?, currency: String, amount: Int64, winners: [Api.StarsGiveawayWinnersOption]) { + self.flags = flags + self.stars = stars + self.yearlyBoosts = yearlyBoosts + self.storeProduct = storeProduct + self.currency = currency + self.amount = amount + self.winners = winners + } + } + case starsGiveawayOption(Cons_starsGiveawayOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsGiveawayOption(let _data): + if boxed { + buffer.appendInt32(-1798404822) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + serializeInt32(_data.yearlyBoosts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.storeProduct!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.winners.count)) + for item in _data.winners { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsGiveawayOption(let _data): + return ("starsGiveawayOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("yearlyBoosts", _data.yearlyBoosts as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("winners", _data.winners as Any)]) + } + } + public static func parse_starsGiveawayOption(_ reader: BufferReader) -> StarsGiveawayOption? { var _1: Int32? _1 = reader.readInt32() @@ -90,7 +127,9 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: String? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } var _5: String? _5 = parseString(reader) var _6: Int64? @@ -107,39 +146,48 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarsGiveawayOption.starsGiveawayOption(flags: _1!, stars: _2!, yearlyBoosts: _3!, storeProduct: _4, currency: _5!, amount: _6!, winners: _7!) + return Api.StarsGiveawayOption.starsGiveawayOption(Cons_starsGiveawayOption(flags: _1!, stars: _2!, yearlyBoosts: _3!, storeProduct: _4, currency: _5!, amount: _6!, winners: _7!)) } else { return nil } } - } } public extension Api { enum StarsGiveawayWinnersOption: TypeConstructorDescription { - case starsGiveawayWinnersOption(flags: Int32, users: Int32, perUserStars: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsGiveawayWinnersOption(let flags, let users, let perUserStars): - if boxed { - buffer.appendInt32(1411605001) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(users, buffer: buffer, boxed: false) - serializeInt64(perUserStars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsGiveawayWinnersOption(let flags, let users, let perUserStars): - return ("starsGiveawayWinnersOption", [("flags", flags as Any), ("users", users as Any), ("perUserStars", perUserStars as Any)]) - } - } - + public class Cons_starsGiveawayWinnersOption { + public var flags: Int32 + public var users: Int32 + public var perUserStars: Int64 + public init(flags: Int32, users: Int32, perUserStars: Int64) { + self.flags = flags + self.users = users + self.perUserStars = perUserStars + } + } + case starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsGiveawayWinnersOption(let _data): + if boxed { + buffer.appendInt32(1411605001) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.users, buffer: buffer, boxed: false) + serializeInt64(_data.perUserStars, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsGiveawayWinnersOption(let _data): + return ("starsGiveawayWinnersOption", [("flags", _data.flags as Any), ("users", _data.users as Any), ("perUserStars", _data.perUserStars as Any)]) + } + } + public static func parse_starsGiveawayWinnersOption(_ reader: BufferReader) -> StarsGiveawayWinnersOption? { var _1: Int32? _1 = reader.readInt32() @@ -151,41 +199,56 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarsGiveawayWinnersOption.starsGiveawayWinnersOption(flags: _1!, users: _2!, perUserStars: _3!) + return Api.StarsGiveawayWinnersOption.starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption(flags: _1!, users: _2!, perUserStars: _3!)) } else { return nil } } - } } public extension Api { enum StarsRating: TypeConstructorDescription { - case starsRating(flags: Int32, level: Int32, currentLevelStars: Int64, stars: Int64, nextLevelStars: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsRating(let flags, let level, let currentLevelStars, let stars, let nextLevelStars): - if boxed { - buffer.appendInt32(453922567) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(level, buffer: buffer, boxed: false) - serializeInt64(currentLevelStars, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(nextLevelStars!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsRating(let flags, let level, let currentLevelStars, let stars, let nextLevelStars): - return ("starsRating", [("flags", flags as Any), ("level", level as Any), ("currentLevelStars", currentLevelStars as Any), ("stars", stars as Any), ("nextLevelStars", nextLevelStars as Any)]) - } - } - + public class Cons_starsRating { + public var flags: Int32 + public var level: Int32 + public var currentLevelStars: Int64 + public var stars: Int64 + public var nextLevelStars: Int64? + public init(flags: Int32, level: Int32, currentLevelStars: Int64, stars: Int64, nextLevelStars: Int64?) { + self.flags = flags + self.level = level + self.currentLevelStars = currentLevelStars + self.stars = stars + self.nextLevelStars = nextLevelStars + } + } + case starsRating(Cons_starsRating) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsRating(let _data): + if boxed { + buffer.appendInt32(453922567) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.level, buffer: buffer, boxed: false) + serializeInt64(_data.currentLevelStars, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.nextLevelStars!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsRating(let _data): + return ("starsRating", [("flags", _data.flags as Any), ("level", _data.level as Any), ("currentLevelStars", _data.currentLevelStars as Any), ("stars", _data.stars as Any), ("nextLevelStars", _data.nextLevelStars as Any)]) + } + } + public static func parse_starsRating(_ reader: BufferReader) -> StarsRating? { var _1: Int32? _1 = reader.readInt32() @@ -196,48 +259,65 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsRating.starsRating(flags: _1!, level: _2!, currentLevelStars: _3!, stars: _4!, nextLevelStars: _5) + return Api.StarsRating.starsRating(Cons_starsRating(flags: _1!, level: _2!, currentLevelStars: _3!, stars: _4!, nextLevelStars: _5)) } else { return nil } } - } } public extension Api { enum StarsRevenueStatus: TypeConstructorDescription { - case starsRevenueStatus(flags: Int32, currentBalance: Api.StarsAmount, availableBalance: Api.StarsAmount, overallRevenue: Api.StarsAmount, nextWithdrawalAt: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsRevenueStatus(let flags, let currentBalance, let availableBalance, let overallRevenue, let nextWithdrawalAt): - if boxed { - buffer.appendInt32(-21080943) - } - serializeInt32(flags, buffer: buffer, boxed: false) - currentBalance.serialize(buffer, true) - availableBalance.serialize(buffer, true) - overallRevenue.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(nextWithdrawalAt!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsRevenueStatus(let flags, let currentBalance, let availableBalance, let overallRevenue, let nextWithdrawalAt): - return ("starsRevenueStatus", [("flags", flags as Any), ("currentBalance", currentBalance as Any), ("availableBalance", availableBalance as Any), ("overallRevenue", overallRevenue as Any), ("nextWithdrawalAt", nextWithdrawalAt as Any)]) - } - } - + public class Cons_starsRevenueStatus { + public var flags: Int32 + public var currentBalance: Api.StarsAmount + public var availableBalance: Api.StarsAmount + public var overallRevenue: Api.StarsAmount + public var nextWithdrawalAt: Int32? + public init(flags: Int32, currentBalance: Api.StarsAmount, availableBalance: Api.StarsAmount, overallRevenue: Api.StarsAmount, nextWithdrawalAt: Int32?) { + self.flags = flags + self.currentBalance = currentBalance + self.availableBalance = availableBalance + self.overallRevenue = overallRevenue + self.nextWithdrawalAt = nextWithdrawalAt + } + } + case starsRevenueStatus(Cons_starsRevenueStatus) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsRevenueStatus(let _data): + if boxed { + buffer.appendInt32(-21080943) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.currentBalance.serialize(buffer, true) + _data.availableBalance.serialize(buffer, true) + _data.overallRevenue.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.nextWithdrawalAt!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsRevenueStatus(let _data): + return ("starsRevenueStatus", [("flags", _data.flags as Any), ("currentBalance", _data.currentBalance as Any), ("availableBalance", _data.availableBalance as Any), ("overallRevenue", _data.overallRevenue as Any), ("nextWithdrawalAt", _data.nextWithdrawalAt as Any)]) + } + } + public static func parse_starsRevenueStatus(_ reader: BufferReader) -> StarsRevenueStatus? { var _1: Int32? _1 = reader.readInt32() @@ -254,52 +334,83 @@ public extension Api { _4 = Api.parse(reader, signature: signature) as? Api.StarsAmount } var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsRevenueStatus.starsRevenueStatus(flags: _1!, currentBalance: _2!, availableBalance: _3!, overallRevenue: _4!, nextWithdrawalAt: _5) + return Api.StarsRevenueStatus.starsRevenueStatus(Cons_starsRevenueStatus(flags: _1!, currentBalance: _2!, availableBalance: _3!, overallRevenue: _4!, nextWithdrawalAt: _5)) } else { return nil } } - } } public extension Api { enum StarsSubscription: TypeConstructorDescription { - case starsSubscription(flags: Int32, id: String, peer: Api.Peer, untilDate: Int32, pricing: Api.StarsSubscriptionPricing, chatInviteHash: String?, title: String?, photo: Api.WebDocument?, invoiceSlug: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsSubscription(let flags, let id, let peer, let untilDate, let pricing, let chatInviteHash, let title, let photo, let invoiceSlug): - if boxed { - buffer.appendInt32(779004698) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(untilDate, buffer: buffer, boxed: false) - pricing.serialize(buffer, true) - if Int(flags) & Int(1 << 3) != 0 {serializeString(chatInviteHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {serializeString(invoiceSlug!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsSubscription(let flags, let id, let peer, let untilDate, let pricing, let chatInviteHash, let title, let photo, let invoiceSlug): - return ("starsSubscription", [("flags", flags as Any), ("id", id as Any), ("peer", peer as Any), ("untilDate", untilDate as Any), ("pricing", pricing as Any), ("chatInviteHash", chatInviteHash as Any), ("title", title as Any), ("photo", photo as Any), ("invoiceSlug", invoiceSlug as Any)]) - } - } - + public class Cons_starsSubscription { + public var flags: Int32 + public var id: String + public var peer: Api.Peer + public var untilDate: Int32 + public var pricing: Api.StarsSubscriptionPricing + public var chatInviteHash: String? + public var title: String? + public var photo: Api.WebDocument? + public var invoiceSlug: String? + public init(flags: Int32, id: String, peer: Api.Peer, untilDate: Int32, pricing: Api.StarsSubscriptionPricing, chatInviteHash: String?, title: String?, photo: Api.WebDocument?, invoiceSlug: String?) { + self.flags = flags + self.id = id + self.peer = peer + self.untilDate = untilDate + self.pricing = pricing + self.chatInviteHash = chatInviteHash + self.title = title + self.photo = photo + self.invoiceSlug = invoiceSlug + } + } + case starsSubscription(Cons_starsSubscription) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsSubscription(let _data): + if boxed { + buffer.appendInt32(779004698) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + _data.pricing.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.chatInviteHash!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.invoiceSlug!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsSubscription(let _data): + return ("starsSubscription", [("flags", _data.flags as Any), ("id", _data.id as Any), ("peer", _data.peer as Any), ("untilDate", _data.untilDate as Any), ("pricing", _data.pricing as Any), ("chatInviteHash", _data.chatInviteHash as Any), ("title", _data.title as Any), ("photo", _data.photo as Any), ("invoiceSlug", _data.invoiceSlug as Any)]) + } + } + public static func parse_starsSubscription(_ reader: BufferReader) -> StarsSubscription? { var _1: Int32? _1 = reader.readInt32() @@ -316,15 +427,23 @@ public extension Api { _5 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing } var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 4) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = parseString(reader) + } var _8: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _9: String? - if Int(_1!) & Int(1 << 6) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _9 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -335,38 +454,45 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.StarsSubscription.starsSubscription(flags: _1!, id: _2!, peer: _3!, untilDate: _4!, pricing: _5!, chatInviteHash: _6, title: _7, photo: _8, invoiceSlug: _9) + return Api.StarsSubscription.starsSubscription(Cons_starsSubscription(flags: _1!, id: _2!, peer: _3!, untilDate: _4!, pricing: _5!, chatInviteHash: _6, title: _7, photo: _8, invoiceSlug: _9)) } else { return nil } } - } } public extension Api { enum StarsSubscriptionPricing: TypeConstructorDescription { - case starsSubscriptionPricing(period: Int32, amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsSubscriptionPricing(let period, let amount): - if boxed { - buffer.appendInt32(88173912) - } - serializeInt32(period, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsSubscriptionPricing(let period, let amount): - return ("starsSubscriptionPricing", [("period", period as Any), ("amount", amount as Any)]) - } - } - + public class Cons_starsSubscriptionPricing { + public var period: Int32 + public var amount: Int64 + public init(period: Int32, amount: Int64) { + self.period = period + self.amount = amount + } + } + case starsSubscriptionPricing(Cons_starsSubscriptionPricing) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsSubscriptionPricing(let _data): + if boxed { + buffer.appendInt32(88173912) + } + serializeInt32(_data.period, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsSubscriptionPricing(let _data): + return ("starsSubscriptionPricing", [("period", _data.period as Any), ("amount", _data.amount as Any)]) + } + } + public static func parse_starsSubscriptionPricing(_ reader: BufferReader) -> StarsSubscriptionPricing? { var _1: Int32? _1 = reader.readInt32() @@ -375,48 +501,65 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarsSubscriptionPricing.starsSubscriptionPricing(period: _1!, amount: _2!) + return Api.StarsSubscriptionPricing.starsSubscriptionPricing(Cons_starsSubscriptionPricing(period: _1!, amount: _2!)) } else { return nil } } - } } public extension Api { enum StarsTopupOption: TypeConstructorDescription { - case starsTopupOption(flags: Int32, stars: Int64, storeProduct: String?, currency: String, amount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsTopupOption(let flags, let stars, let storeProduct, let currency, let amount): - if boxed { - buffer.appendInt32(198776256) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stars, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(storeProduct!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsTopupOption(let flags, let stars, let storeProduct, let currency, let amount): - return ("starsTopupOption", [("flags", flags as Any), ("stars", stars as Any), ("storeProduct", storeProduct as Any), ("currency", currency as Any), ("amount", amount as Any)]) - } - } - + public class Cons_starsTopupOption { + public var flags: Int32 + public var stars: Int64 + public var storeProduct: String? + public var currency: String + public var amount: Int64 + public init(flags: Int32, stars: Int64, storeProduct: String?, currency: String, amount: Int64) { + self.flags = flags + self.stars = stars + self.storeProduct = storeProduct + self.currency = currency + self.amount = amount + } + } + case starsTopupOption(Cons_starsTopupOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsTopupOption(let _data): + if boxed { + buffer.appendInt32(198776256) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stars, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.storeProduct!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsTopupOption(let _data): + return ("starsTopupOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + } + } + public static func parse_starsTopupOption(_ reader: BufferReader) -> StarsTopupOption? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? _4 = parseString(reader) var _5: Int64? @@ -427,64 +570,153 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsTopupOption.starsTopupOption(flags: _1!, stars: _2!, storeProduct: _3, currency: _4!, amount: _5!) + return Api.StarsTopupOption.starsTopupOption(Cons_starsTopupOption(flags: _1!, stars: _2!, storeProduct: _3, currency: _4!, amount: _5!)) } else { return nil } } - } } public extension Api { enum StarsTransaction: TypeConstructorDescription { - case starsTransaction(flags: Int32, id: String, amount: Api.StarsAmount, date: Int32, peer: Api.StarsTransactionPeer, title: String?, description: String?, photo: Api.WebDocument?, transactionDate: Int32?, transactionUrl: String?, botPayload: Buffer?, msgId: Int32?, extendedMedia: [Api.MessageMedia]?, subscriptionPeriod: Int32?, giveawayPostId: Int32?, stargift: Api.StarGift?, floodskipNumber: Int32?, starrefCommissionPermille: Int32?, starrefPeer: Api.Peer?, starrefAmount: Api.StarsAmount?, paidMessages: Int32?, premiumGiftMonths: Int32?, adsProceedsFromDate: Int32?, adsProceedsToDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsTransaction(let flags, let id, let amount, let date, let peer, let title, let description, let photo, let transactionDate, let transactionUrl, let botPayload, let msgId, let extendedMedia, let subscriptionPeriod, let giveawayPostId, let stargift, let floodskipNumber, let starrefCommissionPermille, let starrefPeer, let starrefAmount, let paidMessages, let premiumGiftMonths, let adsProceedsFromDate, let adsProceedsToDate): - if boxed { - buffer.appendInt32(325426864) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - amount.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(transactionDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(transactionUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeBytes(botPayload!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt32(msgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(extendedMedia!.count)) - for item in extendedMedia! { + public class Cons_starsTransaction { + public var flags: Int32 + public var id: String + public var amount: Api.StarsAmount + public var date: Int32 + public var peer: Api.StarsTransactionPeer + public var title: String? + public var description: String? + public var photo: Api.WebDocument? + public var transactionDate: Int32? + public var transactionUrl: String? + public var botPayload: Buffer? + public var msgId: Int32? + public var extendedMedia: [Api.MessageMedia]? + public var subscriptionPeriod: Int32? + public var giveawayPostId: Int32? + public var stargift: Api.StarGift? + public var floodskipNumber: Int32? + public var starrefCommissionPermille: Int32? + public var starrefPeer: Api.Peer? + public var starrefAmount: Api.StarsAmount? + public var paidMessages: Int32? + public var premiumGiftMonths: Int32? + public var adsProceedsFromDate: Int32? + public var adsProceedsToDate: Int32? + public init(flags: Int32, id: String, amount: Api.StarsAmount, date: Int32, peer: Api.StarsTransactionPeer, title: String?, description: String?, photo: Api.WebDocument?, transactionDate: Int32?, transactionUrl: String?, botPayload: Buffer?, msgId: Int32?, extendedMedia: [Api.MessageMedia]?, subscriptionPeriod: Int32?, giveawayPostId: Int32?, stargift: Api.StarGift?, floodskipNumber: Int32?, starrefCommissionPermille: Int32?, starrefPeer: Api.Peer?, starrefAmount: Api.StarsAmount?, paidMessages: Int32?, premiumGiftMonths: Int32?, adsProceedsFromDate: Int32?, adsProceedsToDate: Int32?) { + self.flags = flags + self.id = id + self.amount = amount + self.date = date + self.peer = peer + self.title = title + self.description = description + self.photo = photo + self.transactionDate = transactionDate + self.transactionUrl = transactionUrl + self.botPayload = botPayload + self.msgId = msgId + self.extendedMedia = extendedMedia + self.subscriptionPeriod = subscriptionPeriod + self.giveawayPostId = giveawayPostId + self.stargift = stargift + self.floodskipNumber = floodskipNumber + self.starrefCommissionPermille = starrefCommissionPermille + self.starrefPeer = starrefPeer + self.starrefAmount = starrefAmount + self.paidMessages = paidMessages + self.premiumGiftMonths = premiumGiftMonths + self.adsProceedsFromDate = adsProceedsFromDate + self.adsProceedsToDate = adsProceedsToDate + } + } + case starsTransaction(Cons_starsTransaction) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsTransaction(let _data): + if boxed { + buffer.appendInt32(325426864) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + _data.amount.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.transactionDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.transactionUrl!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeBytes(_data.botPayload!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt32(_data.msgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.extendedMedia!.count)) + for item in _data.extendedMedia! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 12) != 0 {serializeInt32(subscriptionPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt32(giveawayPostId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {stargift!.serialize(buffer, true)} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(floodskipNumber!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 16) != 0 {serializeInt32(starrefCommissionPermille!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {starrefPeer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {starrefAmount!.serialize(buffer, true)} - if Int(flags) & Int(1 << 19) != 0 {serializeInt32(paidMessages!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 20) != 0 {serializeInt32(premiumGiftMonths!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 23) != 0 {serializeInt32(adsProceedsFromDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 23) != 0 {serializeInt32(adsProceedsToDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsTransaction(let flags, let id, let amount, let date, let peer, let title, let description, let photo, let transactionDate, let transactionUrl, let botPayload, let msgId, let extendedMedia, let subscriptionPeriod, let giveawayPostId, let stargift, let floodskipNumber, let starrefCommissionPermille, let starrefPeer, let starrefAmount, let paidMessages, let premiumGiftMonths, let adsProceedsFromDate, let adsProceedsToDate): - return ("starsTransaction", [("flags", flags as Any), ("id", id as Any), ("amount", amount as Any), ("date", date as Any), ("peer", peer as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("transactionDate", transactionDate as Any), ("transactionUrl", transactionUrl as Any), ("botPayload", botPayload as Any), ("msgId", msgId as Any), ("extendedMedia", extendedMedia as Any), ("subscriptionPeriod", subscriptionPeriod as Any), ("giveawayPostId", giveawayPostId as Any), ("stargift", stargift as Any), ("floodskipNumber", floodskipNumber as Any), ("starrefCommissionPermille", starrefCommissionPermille as Any), ("starrefPeer", starrefPeer as Any), ("starrefAmount", starrefAmount as Any), ("paidMessages", paidMessages as Any), ("premiumGiftMonths", premiumGiftMonths as Any), ("adsProceedsFromDate", adsProceedsFromDate as Any), ("adsProceedsToDate", adsProceedsToDate as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt32(_data.subscriptionPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt32(_data.giveawayPostId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + _data.stargift!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + serializeInt32(_data.floodskipNumber!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeInt32(_data.starrefCommissionPermille!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + _data.starrefPeer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + _data.starrefAmount!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 19) != 0 { + serializeInt32(_data.paidMessages!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 20) != 0 { + serializeInt32(_data.premiumGiftMonths!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 23) != 0 { + serializeInt32(_data.adsProceedsFromDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 23) != 0 { + serializeInt32(_data.adsProceedsToDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsTransaction(let _data): + return ("starsTransaction", [("flags", _data.flags as Any), ("id", _data.id as Any), ("amount", _data.amount as Any), ("date", _data.date as Any), ("peer", _data.peer as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("transactionDate", _data.transactionDate as Any), ("transactionUrl", _data.transactionUrl as Any), ("botPayload", _data.botPayload as Any), ("msgId", _data.msgId as Any), ("extendedMedia", _data.extendedMedia as Any), ("subscriptionPeriod", _data.subscriptionPeriod as Any), ("giveawayPostId", _data.giveawayPostId as Any), ("stargift", _data.stargift as Any), ("floodskipNumber", _data.floodskipNumber as Any), ("starrefCommissionPermille", _data.starrefCommissionPermille as Any), ("starrefPeer", _data.starrefPeer as Any), ("starrefAmount", _data.starrefAmount as Any), ("paidMessages", _data.paidMessages as Any), ("premiumGiftMonths", _data.premiumGiftMonths as Any), ("adsProceedsFromDate", _data.adsProceedsFromDate as Any), ("adsProceedsToDate", _data.adsProceedsToDate as Any)]) + } + } + public static func parse_starsTransaction(_ reader: BufferReader) -> StarsTransaction? { var _1: Int32? _1 = reader.readInt32() @@ -501,53 +733,91 @@ public extension Api { _5 = Api.parse(reader, signature: signature) as? Api.StarsTransactionPeer } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } var _8: Api.WebDocument? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _9: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _9 = reader.readInt32() + } var _10: String? - if Int(_1!) & Int(1 << 5) != 0 {_10 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _10 = parseString(reader) + } var _11: Buffer? - if Int(_1!) & Int(1 << 7) != 0 {_11 = parseBytes(reader) } + if Int(_1!) & Int(1 << 7) != 0 { + _11 = parseBytes(reader) + } var _12: Int32? - if Int(_1!) & Int(1 << 8) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 8) != 0 { + _12 = reader.readInt32() + } var _13: [Api.MessageMedia]? - if Int(_1!) & Int(1 << 9) != 0 {if let _ = reader.readInt32() { - _13 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageMedia.self) - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let _ = reader.readInt32() { + _13 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageMedia.self) + } + } var _14: Int32? - if Int(_1!) & Int(1 << 12) != 0 {_14 = reader.readInt32() } + if Int(_1!) & Int(1 << 12) != 0 { + _14 = reader.readInt32() + } var _15: Int32? - if Int(_1!) & Int(1 << 13) != 0 {_15 = reader.readInt32() } + if Int(_1!) & Int(1 << 13) != 0 { + _15 = reader.readInt32() + } var _16: Api.StarGift? - if Int(_1!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.StarGift - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.StarGift + } + } var _17: Int32? - if Int(_1!) & Int(1 << 15) != 0 {_17 = reader.readInt32() } + if Int(_1!) & Int(1 << 15) != 0 { + _17 = reader.readInt32() + } var _18: Int32? - if Int(_1!) & Int(1 << 16) != 0 {_18 = reader.readInt32() } + if Int(_1!) & Int(1 << 16) != 0 { + _18 = reader.readInt32() + } var _19: Api.Peer? - if Int(_1!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _20: Api.StarsAmount? - if Int(_1!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } } + if Int(_1!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } var _21: Int32? - if Int(_1!) & Int(1 << 19) != 0 {_21 = reader.readInt32() } + if Int(_1!) & Int(1 << 19) != 0 { + _21 = reader.readInt32() + } var _22: Int32? - if Int(_1!) & Int(1 << 20) != 0 {_22 = reader.readInt32() } + if Int(_1!) & Int(1 << 20) != 0 { + _22 = reader.readInt32() + } var _23: Int32? - if Int(_1!) & Int(1 << 23) != 0 {_23 = reader.readInt32() } + if Int(_1!) & Int(1 << 23) != 0 { + _23 = reader.readInt32() + } var _24: Int32? - if Int(_1!) & Int(1 << 23) != 0 {_24 = reader.readInt32() } + if Int(_1!) & Int(1 << 23) != 0 { + _24 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -573,18 +843,23 @@ public extension Api { let _c23 = (Int(_1!) & Int(1 << 23) == 0) || _23 != nil let _c24 = (Int(_1!) & Int(1 << 23) == 0) || _24 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 { - return Api.StarsTransaction.starsTransaction(flags: _1!, id: _2!, amount: _3!, date: _4!, peer: _5!, title: _6, description: _7, photo: _8, transactionDate: _9, transactionUrl: _10, botPayload: _11, msgId: _12, extendedMedia: _13, subscriptionPeriod: _14, giveawayPostId: _15, stargift: _16, floodskipNumber: _17, starrefCommissionPermille: _18, starrefPeer: _19, starrefAmount: _20, paidMessages: _21, premiumGiftMonths: _22, adsProceedsFromDate: _23, adsProceedsToDate: _24) + return Api.StarsTransaction.starsTransaction(Cons_starsTransaction(flags: _1!, id: _2!, amount: _3!, date: _4!, peer: _5!, title: _6, description: _7, photo: _8, transactionDate: _9, transactionUrl: _10, botPayload: _11, msgId: _12, extendedMedia: _13, subscriptionPeriod: _14, giveawayPostId: _15, stargift: _16, floodskipNumber: _17, starrefCommissionPermille: _18, starrefPeer: _19, starrefAmount: _20, paidMessages: _21, premiumGiftMonths: _22, adsProceedsFromDate: _23, adsProceedsToDate: _24)) } else { return nil } } - } } public extension Api { enum StarsTransactionPeer: TypeConstructorDescription { - case starsTransactionPeer(peer: Api.Peer) + public class Cons_starsTransactionPeer { + public var peer: Api.Peer + public init(peer: Api.Peer) { + self.peer = peer + } + } + case starsTransactionPeer(Cons_starsTransactionPeer) case starsTransactionPeerAPI case starsTransactionPeerAds case starsTransactionPeerAppStore @@ -592,81 +867,74 @@ public extension Api { case starsTransactionPeerPlayMarket case starsTransactionPeerPremiumBot case starsTransactionPeerUnsupported - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsTransactionPeer(let peer): - if boxed { - buffer.appendInt32(-670195363) - } - peer.serialize(buffer, true) - break - case .starsTransactionPeerAPI: - if boxed { - buffer.appendInt32(-110658899) - } - - break - case .starsTransactionPeerAds: - if boxed { - buffer.appendInt32(1617438738) - } - - break - case .starsTransactionPeerAppStore: - if boxed { - buffer.appendInt32(-1269320843) - } - - break - case .starsTransactionPeerFragment: - if boxed { - buffer.appendInt32(-382740222) - } - - break - case .starsTransactionPeerPlayMarket: - if boxed { - buffer.appendInt32(2069236235) - } - - break - case .starsTransactionPeerPremiumBot: - if boxed { - buffer.appendInt32(621656824) - } - - break - case .starsTransactionPeerUnsupported: - if boxed { - buffer.appendInt32(-1779253276) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsTransactionPeer(let peer): - return ("starsTransactionPeer", [("peer", peer as Any)]) - case .starsTransactionPeerAPI: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsTransactionPeer(let _data): + if boxed { + buffer.appendInt32(-670195363) + } + _data.peer.serialize(buffer, true) + break + case .starsTransactionPeerAPI: + if boxed { + buffer.appendInt32(-110658899) + } + break + case .starsTransactionPeerAds: + if boxed { + buffer.appendInt32(1617438738) + } + break + case .starsTransactionPeerAppStore: + if boxed { + buffer.appendInt32(-1269320843) + } + break + case .starsTransactionPeerFragment: + if boxed { + buffer.appendInt32(-382740222) + } + break + case .starsTransactionPeerPlayMarket: + if boxed { + buffer.appendInt32(2069236235) + } + break + case .starsTransactionPeerPremiumBot: + if boxed { + buffer.appendInt32(621656824) + } + break + case .starsTransactionPeerUnsupported: + if boxed { + buffer.appendInt32(-1779253276) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsTransactionPeer(let _data): + return ("starsTransactionPeer", [("peer", _data.peer as Any)]) + case .starsTransactionPeerAPI: return ("starsTransactionPeerAPI", []) - case .starsTransactionPeerAds: + case .starsTransactionPeerAds: return ("starsTransactionPeerAds", []) - case .starsTransactionPeerAppStore: + case .starsTransactionPeerAppStore: return ("starsTransactionPeerAppStore", []) - case .starsTransactionPeerFragment: + case .starsTransactionPeerFragment: return ("starsTransactionPeerFragment", []) - case .starsTransactionPeerPlayMarket: + case .starsTransactionPeerPlayMarket: return ("starsTransactionPeerPlayMarket", []) - case .starsTransactionPeerPremiumBot: + case .starsTransactionPeerPremiumBot: return ("starsTransactionPeerPremiumBot", []) - case .starsTransactionPeerUnsupported: + case .starsTransactionPeerUnsupported: return ("starsTransactionPeerUnsupported", []) - } - } - + } + } + public static func parse_starsTransactionPeer(_ reader: BufferReader) -> StarsTransactionPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -674,7 +942,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.StarsTransactionPeer.starsTransactionPeer(peer: _1!) + return Api.StarsTransactionPeer.starsTransactionPeer(Cons_starsTransactionPeer(peer: _1!)) } else { return nil @@ -701,32 +969,39 @@ public extension Api { public static func parse_starsTransactionPeerUnsupported(_ reader: BufferReader) -> StarsTransactionPeer? { return Api.StarsTransactionPeer.starsTransactionPeerUnsupported } - } } public extension Api { enum StatsAbsValueAndPrev: TypeConstructorDescription { - case statsAbsValueAndPrev(current: Double, previous: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsAbsValueAndPrev(let current, let previous): - if boxed { - buffer.appendInt32(-884757282) - } - serializeDouble(current, buffer: buffer, boxed: false) - serializeDouble(previous, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsAbsValueAndPrev(let current, let previous): - return ("statsAbsValueAndPrev", [("current", current as Any), ("previous", previous as Any)]) - } - } - + public class Cons_statsAbsValueAndPrev { + public var current: Double + public var previous: Double + public init(current: Double, previous: Double) { + self.current = current + self.previous = previous + } + } + case statsAbsValueAndPrev(Cons_statsAbsValueAndPrev) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsAbsValueAndPrev(let _data): + if boxed { + buffer.appendInt32(-884757282) + } + serializeDouble(_data.current, buffer: buffer, boxed: false) + serializeDouble(_data.previous, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsAbsValueAndPrev(let _data): + return ("statsAbsValueAndPrev", [("current", _data.current as Any), ("previous", _data.previous as Any)]) + } + } + public static func parse_statsAbsValueAndPrev(_ reader: BufferReader) -> StatsAbsValueAndPrev? { var _1: Double? _1 = reader.readDouble() @@ -735,38 +1010,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StatsAbsValueAndPrev.statsAbsValueAndPrev(current: _1!, previous: _2!) + return Api.StatsAbsValueAndPrev.statsAbsValueAndPrev(Cons_statsAbsValueAndPrev(current: _1!, previous: _2!)) } else { return nil } } - } } public extension Api { enum StatsDateRangeDays: TypeConstructorDescription { - case statsDateRangeDays(minDate: Int32, maxDate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsDateRangeDays(let minDate, let maxDate): - if boxed { - buffer.appendInt32(-1237848657) - } - serializeInt32(minDate, buffer: buffer, boxed: false) - serializeInt32(maxDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsDateRangeDays(let minDate, let maxDate): - return ("statsDateRangeDays", [("minDate", minDate as Any), ("maxDate", maxDate as Any)]) - } - } - + public class Cons_statsDateRangeDays { + public var minDate: Int32 + public var maxDate: Int32 + public init(minDate: Int32, maxDate: Int32) { + self.minDate = minDate + self.maxDate = maxDate + } + } + case statsDateRangeDays(Cons_statsDateRangeDays) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsDateRangeDays(let _data): + if boxed { + buffer.appendInt32(-1237848657) + } + serializeInt32(_data.minDate, buffer: buffer, boxed: false) + serializeInt32(_data.maxDate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsDateRangeDays(let _data): + return ("statsDateRangeDays", [("minDate", _data.minDate as Any), ("maxDate", _data.maxDate as Any)]) + } + } + public static func parse_statsDateRangeDays(_ reader: BufferReader) -> StatsDateRangeDays? { var _1: Int32? _1 = reader.readInt32() @@ -775,57 +1057,80 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StatsDateRangeDays.statsDateRangeDays(minDate: _1!, maxDate: _2!) + return Api.StatsDateRangeDays.statsDateRangeDays(Cons_statsDateRangeDays(minDate: _1!, maxDate: _2!)) } else { return nil } } - } } public extension Api { enum StatsGraph: TypeConstructorDescription { - case statsGraph(flags: Int32, json: Api.DataJSON, zoomToken: String?) - case statsGraphAsync(token: String) - case statsGraphError(error: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGraph(let flags, let json, let zoomToken): - if boxed { - buffer.appendInt32(-1901828938) - } - serializeInt32(flags, buffer: buffer, boxed: false) - json.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(zoomToken!, buffer: buffer, boxed: false)} - break - case .statsGraphAsync(let token): - if boxed { - buffer.appendInt32(1244130093) - } - serializeString(token, buffer: buffer, boxed: false) - break - case .statsGraphError(let error): - if boxed { - buffer.appendInt32(-1092839390) - } - serializeString(error, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGraph(let flags, let json, let zoomToken): - return ("statsGraph", [("flags", flags as Any), ("json", json as Any), ("zoomToken", zoomToken as Any)]) - case .statsGraphAsync(let token): - return ("statsGraphAsync", [("token", token as Any)]) - case .statsGraphError(let error): - return ("statsGraphError", [("error", error as Any)]) - } - } - + public class Cons_statsGraph { + public var flags: Int32 + public var json: Api.DataJSON + public var zoomToken: String? + public init(flags: Int32, json: Api.DataJSON, zoomToken: String?) { + self.flags = flags + self.json = json + self.zoomToken = zoomToken + } + } + public class Cons_statsGraphAsync { + public var token: String + public init(token: String) { + self.token = token + } + } + public class Cons_statsGraphError { + public var error: String + public init(error: String) { + self.error = error + } + } + case statsGraph(Cons_statsGraph) + case statsGraphAsync(Cons_statsGraphAsync) + case statsGraphError(Cons_statsGraphError) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsGraph(let _data): + if boxed { + buffer.appendInt32(-1901828938) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.json.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.zoomToken!, buffer: buffer, boxed: false) + } + break + case .statsGraphAsync(let _data): + if boxed { + buffer.appendInt32(1244130093) + } + serializeString(_data.token, buffer: buffer, boxed: false) + break + case .statsGraphError(let _data): + if boxed { + buffer.appendInt32(-1092839390) + } + serializeString(_data.error, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsGraph(let _data): + return ("statsGraph", [("flags", _data.flags as Any), ("json", _data.json as Any), ("zoomToken", _data.zoomToken as Any)]) + case .statsGraphAsync(let _data): + return ("statsGraphAsync", [("token", _data.token as Any)]) + case .statsGraphError(let _data): + return ("statsGraphError", [("error", _data.error as Any)]) + } + } + public static func parse_statsGraph(_ reader: BufferReader) -> StatsGraph? { var _1: Int32? _1 = reader.readInt32() @@ -834,12 +1139,14 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.DataJSON } var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.StatsGraph.statsGraph(flags: _1!, json: _2!, zoomToken: _3) + return Api.StatsGraph.statsGraph(Cons_statsGraph(flags: _1!, json: _2!, zoomToken: _3)) } else { return nil @@ -850,7 +1157,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.StatsGraph.statsGraphAsync(token: _1!) + return Api.StatsGraph.statsGraphAsync(Cons_statsGraphAsync(token: _1!)) } else { return nil @@ -861,40 +1168,51 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.StatsGraph.statsGraphError(error: _1!) + return Api.StatsGraph.statsGraphError(Cons_statsGraphError(error: _1!)) } else { return nil } } - } } public extension Api { enum StatsGroupTopAdmin: TypeConstructorDescription { - case statsGroupTopAdmin(userId: Int64, deleted: Int32, kicked: Int32, banned: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopAdmin(let userId, let deleted, let kicked, let banned): - if boxed { - buffer.appendInt32(-682079097) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(deleted, buffer: buffer, boxed: false) - serializeInt32(kicked, buffer: buffer, boxed: false) - serializeInt32(banned, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopAdmin(let userId, let deleted, let kicked, let banned): - return ("statsGroupTopAdmin", [("userId", userId as Any), ("deleted", deleted as Any), ("kicked", kicked as Any), ("banned", banned as Any)]) - } - } - + public class Cons_statsGroupTopAdmin { + public var userId: Int64 + public var deleted: Int32 + public var kicked: Int32 + public var banned: Int32 + public init(userId: Int64, deleted: Int32, kicked: Int32, banned: Int32) { + self.userId = userId + self.deleted = deleted + self.kicked = kicked + self.banned = banned + } + } + case statsGroupTopAdmin(Cons_statsGroupTopAdmin) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsGroupTopAdmin(let _data): + if boxed { + buffer.appendInt32(-682079097) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.deleted, buffer: buffer, boxed: false) + serializeInt32(_data.kicked, buffer: buffer, boxed: false) + serializeInt32(_data.banned, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsGroupTopAdmin(let _data): + return ("statsGroupTopAdmin", [("userId", _data.userId as Any), ("deleted", _data.deleted as Any), ("kicked", _data.kicked as Any), ("banned", _data.banned as Any)]) + } + } + public static func parse_statsGroupTopAdmin(_ reader: BufferReader) -> StatsGroupTopAdmin? { var _1: Int64? _1 = reader.readInt64() @@ -909,38 +1227,45 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StatsGroupTopAdmin.statsGroupTopAdmin(userId: _1!, deleted: _2!, kicked: _3!, banned: _4!) + return Api.StatsGroupTopAdmin.statsGroupTopAdmin(Cons_statsGroupTopAdmin(userId: _1!, deleted: _2!, kicked: _3!, banned: _4!)) } else { return nil } } - } } public extension Api { enum StatsGroupTopInviter: TypeConstructorDescription { - case statsGroupTopInviter(userId: Int64, invitations: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopInviter(let userId, let invitations): - if boxed { - buffer.appendInt32(1398765469) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(invitations, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopInviter(let userId, let invitations): - return ("statsGroupTopInviter", [("userId", userId as Any), ("invitations", invitations as Any)]) - } - } - + public class Cons_statsGroupTopInviter { + public var userId: Int64 + public var invitations: Int32 + public init(userId: Int64, invitations: Int32) { + self.userId = userId + self.invitations = invitations + } + } + case statsGroupTopInviter(Cons_statsGroupTopInviter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsGroupTopInviter(let _data): + if boxed { + buffer.appendInt32(1398765469) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.invitations, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsGroupTopInviter(let _data): + return ("statsGroupTopInviter", [("userId", _data.userId as Any), ("invitations", _data.invitations as Any)]) + } + } + public static func parse_statsGroupTopInviter(_ reader: BufferReader) -> StatsGroupTopInviter? { var _1: Int64? _1 = reader.readInt64() @@ -949,39 +1274,48 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StatsGroupTopInviter.statsGroupTopInviter(userId: _1!, invitations: _2!) + return Api.StatsGroupTopInviter.statsGroupTopInviter(Cons_statsGroupTopInviter(userId: _1!, invitations: _2!)) } else { return nil } } - } } public extension Api { enum StatsGroupTopPoster: TypeConstructorDescription { - case statsGroupTopPoster(userId: Int64, messages: Int32, avgChars: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopPoster(let userId, let messages, let avgChars): - if boxed { - buffer.appendInt32(-1660637285) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(messages, buffer: buffer, boxed: false) - serializeInt32(avgChars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopPoster(let userId, let messages, let avgChars): - return ("statsGroupTopPoster", [("userId", userId as Any), ("messages", messages as Any), ("avgChars", avgChars as Any)]) - } - } - + public class Cons_statsGroupTopPoster { + public var userId: Int64 + public var messages: Int32 + public var avgChars: Int32 + public init(userId: Int64, messages: Int32, avgChars: Int32) { + self.userId = userId + self.messages = messages + self.avgChars = avgChars + } + } + case statsGroupTopPoster(Cons_statsGroupTopPoster) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsGroupTopPoster(let _data): + if boxed { + buffer.appendInt32(-1660637285) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.messages, buffer: buffer, boxed: false) + serializeInt32(_data.avgChars, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsGroupTopPoster(let _data): + return ("statsGroupTopPoster", [("userId", _data.userId as Any), ("messages", _data.messages as Any), ("avgChars", _data.avgChars as Any)]) + } + } + public static func parse_statsGroupTopPoster(_ reader: BufferReader) -> StatsGroupTopPoster? { var _1: Int64? _1 = reader.readInt64() @@ -993,38 +1327,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StatsGroupTopPoster.statsGroupTopPoster(userId: _1!, messages: _2!, avgChars: _3!) + return Api.StatsGroupTopPoster.statsGroupTopPoster(Cons_statsGroupTopPoster(userId: _1!, messages: _2!, avgChars: _3!)) } else { return nil } } - } } public extension Api { enum StatsPercentValue: TypeConstructorDescription { - case statsPercentValue(part: Double, total: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsPercentValue(let part, let total): - if boxed { - buffer.appendInt32(-875679776) - } - serializeDouble(part, buffer: buffer, boxed: false) - serializeDouble(total, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsPercentValue(let part, let total): - return ("statsPercentValue", [("part", part as Any), ("total", total as Any)]) - } - } - + public class Cons_statsPercentValue { + public var part: Double + public var total: Double + public init(part: Double, total: Double) { + self.part = part + self.total = total + } + } + case statsPercentValue(Cons_statsPercentValue) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsPercentValue(let _data): + if boxed { + buffer.appendInt32(-875679776) + } + serializeDouble(_data.part, buffer: buffer, boxed: false) + serializeDouble(_data.total, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsPercentValue(let _data): + return ("statsPercentValue", [("part", _data.part as Any), ("total", _data.total as Any)]) + } + } + public static func parse_statsPercentValue(_ reader: BufferReader) -> StatsPercentValue? { var _1: Double? _1 = reader.readDouble() @@ -1033,78 +1374,90 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StatsPercentValue.statsPercentValue(part: _1!, total: _2!) + return Api.StatsPercentValue.statsPercentValue(Cons_statsPercentValue(part: _1!, total: _2!)) } else { return nil } } - } } public extension Api { enum StatsURL: TypeConstructorDescription { - case statsURL(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsURL(let url): - if boxed { - buffer.appendInt32(1202287072) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsURL(let url): - return ("statsURL", [("url", url as Any)]) - } - } - + public class Cons_statsURL { + public var url: String + public init(url: String) { + self.url = url + } + } + case statsURL(Cons_statsURL) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .statsURL(let _data): + if boxed { + buffer.appendInt32(1202287072) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .statsURL(let _data): + return ("statsURL", [("url", _data.url as Any)]) + } + } + public static func parse_statsURL(_ reader: BufferReader) -> StatsURL? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.StatsURL.statsURL(url: _1!) + return Api.StatsURL.statsURL(Cons_statsURL(url: _1!)) } else { return nil } } - } } public extension Api { enum StickerKeyword: TypeConstructorDescription { - case stickerKeyword(documentId: Int64, keyword: [String]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerKeyword(let documentId, let keyword): - if boxed { - buffer.appendInt32(-50416996) - } - serializeInt64(documentId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(keyword.count)) - for item in keyword { - serializeString(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerKeyword(let documentId, let keyword): - return ("stickerKeyword", [("documentId", documentId as Any), ("keyword", keyword as Any)]) - } - } - + public class Cons_stickerKeyword { + public var documentId: Int64 + public var keyword: [String] + public init(documentId: Int64, keyword: [String]) { + self.documentId = documentId + self.keyword = keyword + } + } + case stickerKeyword(Cons_stickerKeyword) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerKeyword(let _data): + if boxed { + buffer.appendInt32(-50416996) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.keyword.count)) + for item in _data.keyword { + serializeString(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerKeyword(let _data): + return ("stickerKeyword", [("documentId", _data.documentId as Any), ("keyword", _data.keyword as Any)]) + } + } + public static func parse_stickerKeyword(_ reader: BufferReader) -> StickerKeyword? { var _1: Int64? _1 = reader.readInt64() @@ -1115,42 +1468,49 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerKeyword.stickerKeyword(documentId: _1!, keyword: _2!) + return Api.StickerKeyword.stickerKeyword(Cons_stickerKeyword(documentId: _1!, keyword: _2!)) } else { return nil } } - } } public extension Api { enum StickerPack: TypeConstructorDescription { - case stickerPack(emoticon: String, documents: [Int64]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerPack(let emoticon, let documents): - if boxed { - buffer.appendInt32(313694676) - } - serializeString(emoticon, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerPack(let emoticon, let documents): - return ("stickerPack", [("emoticon", emoticon as Any), ("documents", documents as Any)]) - } - } - + public class Cons_stickerPack { + public var emoticon: String + public var documents: [Int64] + public init(emoticon: String, documents: [Int64]) { + self.emoticon = emoticon + self.documents = documents + } + } + case stickerPack(Cons_stickerPack) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerPack(let _data): + if boxed { + buffer.appendInt32(313694676) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerPack(let _data): + return ("stickerPack", [("emoticon", _data.emoticon as Any), ("documents", _data.documents as Any)]) + } + } + public static func parse_stickerPack(_ reader: BufferReader) -> StickerPack? { var _1: String? _1 = parseString(reader) @@ -1161,57 +1521,96 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerPack.stickerPack(emoticon: _1!, documents: _2!) + return Api.StickerPack.stickerPack(Cons_stickerPack(emoticon: _1!, documents: _2!)) } else { return nil } } - } } public extension Api { enum StickerSet: TypeConstructorDescription { - case stickerSet(flags: Int32, installedDate: Int32?, id: Int64, accessHash: Int64, title: String, shortName: String, thumbs: [Api.PhotoSize]?, thumbDcId: Int32?, thumbVersion: Int32?, thumbDocumentId: Int64?, count: Int32, hash: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerSet(let flags, let installedDate, let id, let accessHash, let title, let shortName, let thumbs, let thumbDcId, let thumbVersion, let thumbDocumentId, let count, let hash): - if boxed { - buffer.appendInt32(768691932) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(installedDate!, buffer: buffer, boxed: false)} - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(thumbs!.count)) - for item in thumbs! { + public class Cons_stickerSet { + public var flags: Int32 + public var installedDate: Int32? + public var id: Int64 + public var accessHash: Int64 + public var title: String + public var shortName: String + public var thumbs: [Api.PhotoSize]? + public var thumbDcId: Int32? + public var thumbVersion: Int32? + public var thumbDocumentId: Int64? + public var count: Int32 + public var hash: Int32 + public init(flags: Int32, installedDate: Int32?, id: Int64, accessHash: Int64, title: String, shortName: String, thumbs: [Api.PhotoSize]?, thumbDcId: Int32?, thumbVersion: Int32?, thumbDocumentId: Int64?, count: Int32, hash: Int32) { + self.flags = flags + self.installedDate = installedDate + self.id = id + self.accessHash = accessHash + self.title = title + self.shortName = shortName + self.thumbs = thumbs + self.thumbDcId = thumbDcId + self.thumbVersion = thumbVersion + self.thumbDocumentId = thumbDocumentId + self.count = count + self.hash = hash + } + } + case stickerSet(Cons_stickerSet) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerSet(let _data): + if boxed { + buffer.appendInt32(768691932) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.installedDate!, buffer: buffer, boxed: false) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.shortName, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.thumbs!.count)) + for item in _data.thumbs! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(thumbDcId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(thumbVersion!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeInt64(thumbDocumentId!, buffer: buffer, boxed: false)} - serializeInt32(count, buffer: buffer, boxed: false) - serializeInt32(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerSet(let flags, let installedDate, let id, let accessHash, let title, let shortName, let thumbs, let thumbDcId, let thumbVersion, let thumbDocumentId, let count, let hash): - return ("stickerSet", [("flags", flags as Any), ("installedDate", installedDate as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("shortName", shortName as Any), ("thumbs", thumbs as Any), ("thumbDcId", thumbDcId as Any), ("thumbVersion", thumbVersion as Any), ("thumbDocumentId", thumbDocumentId as Any), ("count", count as Any), ("hash", hash as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.thumbDcId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.thumbVersion!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.thumbDocumentId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt32(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerSet(let _data): + return ("stickerSet", [("flags", _data.flags as Any), ("installedDate", _data.installedDate as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("shortName", _data.shortName as Any), ("thumbs", _data.thumbs as Any), ("thumbDcId", _data.thumbDcId as Any), ("thumbVersion", _data.thumbVersion as Any), ("thumbDocumentId", _data.thumbDocumentId as Any), ("count", _data.count as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int64? _3 = reader.readInt64() var _4: Int64? @@ -1221,15 +1620,23 @@ public extension Api { var _6: String? _6 = parseString(reader) var _7: [Api.PhotoSize]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + } + } var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } var _9: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _9 = reader.readInt32() + } var _10: Int64? - if Int(_1!) & Int(1 << 8) != 0 {_10 = reader.readInt64() } + if Int(_1!) & Int(1 << 8) != 0 { + _10 = reader.readInt64() + } var _11: Int32? _11 = reader.readInt32() var _12: Int32? @@ -1247,85 +1654,118 @@ public extension Api { let _c11 = _11 != nil let _c12 = _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.StickerSet.stickerSet(flags: _1!, installedDate: _2, id: _3!, accessHash: _4!, title: _5!, shortName: _6!, thumbs: _7, thumbDcId: _8, thumbVersion: _9, thumbDocumentId: _10, count: _11!, hash: _12!) + return Api.StickerSet.stickerSet(Cons_stickerSet(flags: _1!, installedDate: _2, id: _3!, accessHash: _4!, title: _5!, shortName: _6!, thumbs: _7, thumbDcId: _8, thumbVersion: _9, thumbDocumentId: _10, count: _11!, hash: _12!)) } else { return nil } } - } } public extension Api { enum StickerSetCovered: TypeConstructorDescription { - case stickerSetCovered(set: Api.StickerSet, cover: Api.Document) - case stickerSetFullCovered(set: Api.StickerSet, packs: [Api.StickerPack], keywords: [Api.StickerKeyword], documents: [Api.Document]) - case stickerSetMultiCovered(set: Api.StickerSet, covers: [Api.Document]) - case stickerSetNoCovered(set: Api.StickerSet) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerSetCovered(let set, let cover): - if boxed { - buffer.appendInt32(1678812626) - } - set.serialize(buffer, true) - cover.serialize(buffer, true) - break - case .stickerSetFullCovered(let set, let packs, let keywords, let documents): - if boxed { - buffer.appendInt32(1087454222) - } - set.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(packs.count)) - for item in packs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(keywords.count)) - for item in keywords { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - break - case .stickerSetMultiCovered(let set, let covers): - if boxed { - buffer.appendInt32(872932635) - } - set.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(covers.count)) - for item in covers { - item.serialize(buffer, true) - } - break - case .stickerSetNoCovered(let set): - if boxed { - buffer.appendInt32(2008112412) - } - set.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerSetCovered(let set, let cover): - return ("stickerSetCovered", [("set", set as Any), ("cover", cover as Any)]) - case .stickerSetFullCovered(let set, let packs, let keywords, let documents): - return ("stickerSetFullCovered", [("set", set as Any), ("packs", packs as Any), ("keywords", keywords as Any), ("documents", documents as Any)]) - case .stickerSetMultiCovered(let set, let covers): - return ("stickerSetMultiCovered", [("set", set as Any), ("covers", covers as Any)]) - case .stickerSetNoCovered(let set): - return ("stickerSetNoCovered", [("set", set as Any)]) - } - } - + public class Cons_stickerSetCovered { + public var set: Api.StickerSet + public var cover: Api.Document + public init(set: Api.StickerSet, cover: Api.Document) { + self.set = set + self.cover = cover + } + } + public class Cons_stickerSetFullCovered { + public var set: Api.StickerSet + public var packs: [Api.StickerPack] + public var keywords: [Api.StickerKeyword] + public var documents: [Api.Document] + public init(set: Api.StickerSet, packs: [Api.StickerPack], keywords: [Api.StickerKeyword], documents: [Api.Document]) { + self.set = set + self.packs = packs + self.keywords = keywords + self.documents = documents + } + } + public class Cons_stickerSetMultiCovered { + public var set: Api.StickerSet + public var covers: [Api.Document] + public init(set: Api.StickerSet, covers: [Api.Document]) { + self.set = set + self.covers = covers + } + } + public class Cons_stickerSetNoCovered { + public var set: Api.StickerSet + public init(set: Api.StickerSet) { + self.set = set + } + } + case stickerSetCovered(Cons_stickerSetCovered) + case stickerSetFullCovered(Cons_stickerSetFullCovered) + case stickerSetMultiCovered(Cons_stickerSetMultiCovered) + case stickerSetNoCovered(Cons_stickerSetNoCovered) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerSetCovered(let _data): + if boxed { + buffer.appendInt32(1678812626) + } + _data.set.serialize(buffer, true) + _data.cover.serialize(buffer, true) + break + case .stickerSetFullCovered(let _data): + if boxed { + buffer.appendInt32(1087454222) + } + _data.set.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.packs.count)) + for item in _data.packs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.keywords.count)) + for item in _data.keywords { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + item.serialize(buffer, true) + } + break + case .stickerSetMultiCovered(let _data): + if boxed { + buffer.appendInt32(872932635) + } + _data.set.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.covers.count)) + for item in _data.covers { + item.serialize(buffer, true) + } + break + case .stickerSetNoCovered(let _data): + if boxed { + buffer.appendInt32(2008112412) + } + _data.set.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerSetCovered(let _data): + return ("stickerSetCovered", [("set", _data.set as Any), ("cover", _data.cover as Any)]) + case .stickerSetFullCovered(let _data): + return ("stickerSetFullCovered", [("set", _data.set as Any), ("packs", _data.packs as Any), ("keywords", _data.keywords as Any), ("documents", _data.documents as Any)]) + case .stickerSetMultiCovered(let _data): + return ("stickerSetMultiCovered", [("set", _data.set as Any), ("covers", _data.covers as Any)]) + case .stickerSetNoCovered(let _data): + return ("stickerSetNoCovered", [("set", _data.set as Any)]) + } + } + public static func parse_stickerSetCovered(_ reader: BufferReader) -> StickerSetCovered? { var _1: Api.StickerSet? if let signature = reader.readInt32() { @@ -1338,7 +1778,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerSetCovered.stickerSetCovered(set: _1!, cover: _2!) + return Api.StickerSetCovered.stickerSetCovered(Cons_stickerSetCovered(set: _1!, cover: _2!)) } else { return nil @@ -1366,7 +1806,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StickerSetCovered.stickerSetFullCovered(set: _1!, packs: _2!, keywords: _3!, documents: _4!) + return Api.StickerSetCovered.stickerSetFullCovered(Cons_stickerSetFullCovered(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) } else { return nil @@ -1384,7 +1824,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerSetCovered.stickerSetMultiCovered(set: _1!, covers: _2!) + return Api.StickerSetCovered.stickerSetMultiCovered(Cons_stickerSetMultiCovered(set: _1!, covers: _2!)) } else { return nil @@ -1397,12 +1837,11 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.StickerSetCovered.stickerSetNoCovered(set: _1!) + return Api.StickerSetCovered.stickerSetNoCovered(Cons_stickerSetNoCovered(set: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api27.swift b/submodules/TelegramApi/Sources/Api27.swift index 371fa03f23..350681bf02 100644 --- a/submodules/TelegramApi/Sources/Api27.swift +++ b/submodules/TelegramApi/Sources/Api27.swift @@ -1,73 +1,108 @@ public extension Api { enum StoriesStealthMode: TypeConstructorDescription { - case storiesStealthMode(flags: Int32, activeUntilDate: Int32?, cooldownUntilDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storiesStealthMode(let flags, let activeUntilDate, let cooldownUntilDate): - if boxed { - buffer.appendInt32(1898850301) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(activeUntilDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(cooldownUntilDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storiesStealthMode(let flags, let activeUntilDate, let cooldownUntilDate): - return ("storiesStealthMode", [("flags", flags as Any), ("activeUntilDate", activeUntilDate as Any), ("cooldownUntilDate", cooldownUntilDate as Any)]) - } - } - + public class Cons_storiesStealthMode { + public var flags: Int32 + public var activeUntilDate: Int32? + public var cooldownUntilDate: Int32? + public init(flags: Int32, activeUntilDate: Int32?, cooldownUntilDate: Int32?) { + self.flags = flags + self.activeUntilDate = activeUntilDate + self.cooldownUntilDate = cooldownUntilDate + } + } + case storiesStealthMode(Cons_storiesStealthMode) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storiesStealthMode(let _data): + if boxed { + buffer.appendInt32(1898850301) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.activeUntilDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.cooldownUntilDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storiesStealthMode(let _data): + return ("storiesStealthMode", [("flags", _data.flags as Any), ("activeUntilDate", _data.activeUntilDate as Any), ("cooldownUntilDate", _data.cooldownUntilDate as Any)]) + } + } + public static func parse_storiesStealthMode(_ reader: BufferReader) -> StoriesStealthMode? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.StoriesStealthMode.storiesStealthMode(flags: _1!, activeUntilDate: _2, cooldownUntilDate: _3) + return Api.StoriesStealthMode.storiesStealthMode(Cons_storiesStealthMode(flags: _1!, activeUntilDate: _2, cooldownUntilDate: _3)) } else { return nil } } - } } public extension Api { enum StoryAlbum: TypeConstructorDescription { - case storyAlbum(flags: Int32, albumId: Int32, title: String, iconPhoto: Api.Photo?, iconVideo: Api.Document?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyAlbum(let flags, let albumId, let title, let iconPhoto, let iconVideo): - if boxed { - buffer.appendInt32(-1826262950) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(albumId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {iconPhoto!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {iconVideo!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyAlbum(let flags, let albumId, let title, let iconPhoto, let iconVideo): - return ("storyAlbum", [("flags", flags as Any), ("albumId", albumId as Any), ("title", title as Any), ("iconPhoto", iconPhoto as Any), ("iconVideo", iconVideo as Any)]) - } - } - + public class Cons_storyAlbum { + public var flags: Int32 + public var albumId: Int32 + public var title: String + public var iconPhoto: Api.Photo? + public var iconVideo: Api.Document? + public init(flags: Int32, albumId: Int32, title: String, iconPhoto: Api.Photo?, iconVideo: Api.Document?) { + self.flags = flags + self.albumId = albumId + self.title = title + self.iconPhoto = iconPhoto + self.iconVideo = iconVideo + } + } + case storyAlbum(Cons_storyAlbum) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyAlbum(let _data): + if boxed { + buffer.appendInt32(-1826262950) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.albumId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.iconPhoto!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.iconVideo!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyAlbum(let _data): + return ("storyAlbum", [("flags", _data.flags as Any), ("albumId", _data.albumId as Any), ("title", _data.title as Any), ("iconPhoto", _data.iconPhoto as Any), ("iconVideo", _data.iconVideo as Any)]) + } + } + public static func parse_storyAlbum(_ reader: BufferReader) -> StoryAlbum? { var _1: Int32? _1 = reader.readInt32() @@ -76,150 +111,244 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.Photo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _5: Api.Document? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StoryAlbum.storyAlbum(flags: _1!, albumId: _2!, title: _3!, iconPhoto: _4, iconVideo: _5) + return Api.StoryAlbum.storyAlbum(Cons_storyAlbum(flags: _1!, albumId: _2!, title: _3!, iconPhoto: _4, iconVideo: _5)) } else { return nil } } - } } public extension Api { enum StoryFwdHeader: TypeConstructorDescription { - case storyFwdHeader(flags: Int32, from: Api.Peer?, fromName: String?, storyId: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyFwdHeader(let flags, let from, let fromName, let storyId): - if boxed { - buffer.appendInt32(-1205411504) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {from!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(fromName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(storyId!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyFwdHeader(let flags, let from, let fromName, let storyId): - return ("storyFwdHeader", [("flags", flags as Any), ("from", from as Any), ("fromName", fromName as Any), ("storyId", storyId as Any)]) - } - } - + public class Cons_storyFwdHeader { + public var flags: Int32 + public var from: Api.Peer? + public var fromName: String? + public var storyId: Int32? + public init(flags: Int32, from: Api.Peer?, fromName: String?, storyId: Int32?) { + self.flags = flags + self.from = from + self.fromName = fromName + self.storyId = storyId + } + } + case storyFwdHeader(Cons_storyFwdHeader) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyFwdHeader(let _data): + if boxed { + buffer.appendInt32(-1205411504) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.from!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.fromName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.storyId!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyFwdHeader(let _data): + return ("storyFwdHeader", [("flags", _data.flags as Any), ("from", _data.from as Any), ("fromName", _data.fromName as Any), ("storyId", _data.storyId as Any)]) + } + } + public static func parse_storyFwdHeader(_ reader: BufferReader) -> StoryFwdHeader? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StoryFwdHeader.storyFwdHeader(flags: _1!, from: _2, fromName: _3, storyId: _4) + return Api.StoryFwdHeader.storyFwdHeader(Cons_storyFwdHeader(flags: _1!, from: _2, fromName: _3, storyId: _4)) } else { return nil } } - } } public extension Api { indirect enum StoryItem: TypeConstructorDescription { - case storyItem(flags: Int32, id: Int32, date: Int32, fromId: Api.Peer?, fwdFrom: Api.StoryFwdHeader?, expireDate: Int32, caption: String?, entities: [Api.MessageEntity]?, media: Api.MessageMedia, mediaAreas: [Api.MediaArea]?, privacy: [Api.PrivacyRule]?, views: Api.StoryViews?, sentReaction: Api.Reaction?, albums: [Int32]?) - case storyItemDeleted(id: Int32) - case storyItemSkipped(flags: Int32, id: Int32, date: Int32, expireDate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyItem(let flags, let id, let date, let fromId, let fwdFrom, let expireDate, let caption, let entities, let media, let mediaAreas, let privacy, let views, let sentReaction, let albums): - if boxed { - buffer.appendInt32(-302947087) + public class Cons_storyItem { + public var flags: Int32 + public var id: Int32 + public var date: Int32 + public var fromId: Api.Peer? + public var fwdFrom: Api.StoryFwdHeader? + public var expireDate: Int32 + public var caption: String? + public var entities: [Api.MessageEntity]? + public var media: Api.MessageMedia + public var mediaAreas: [Api.MediaArea]? + public var privacy: [Api.PrivacyRule]? + public var views: Api.StoryViews? + public var sentReaction: Api.Reaction? + public var albums: [Int32]? + public init(flags: Int32, id: Int32, date: Int32, fromId: Api.Peer?, fwdFrom: Api.StoryFwdHeader?, expireDate: Int32, caption: String?, entities: [Api.MessageEntity]?, media: Api.MessageMedia, mediaAreas: [Api.MediaArea]?, privacy: [Api.PrivacyRule]?, views: Api.StoryViews?, sentReaction: Api.Reaction?, albums: [Int32]?) { + self.flags = flags + self.id = id + self.date = date + self.fromId = fromId + self.fwdFrom = fwdFrom + self.expireDate = expireDate + self.caption = caption + self.entities = entities + self.media = media + self.mediaAreas = mediaAreas + self.privacy = privacy + self.views = views + self.sentReaction = sentReaction + self.albums = albums + } + } + public class Cons_storyItemDeleted { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + } + public class Cons_storyItemSkipped { + public var flags: Int32 + public var id: Int32 + public var date: Int32 + public var expireDate: Int32 + public init(flags: Int32, id: Int32, date: Int32, expireDate: Int32) { + self.flags = flags + self.id = id + self.date = date + self.expireDate = expireDate + } + } + case storyItem(Cons_storyItem) + case storyItemDeleted(Cons_storyItemDeleted) + case storyItemSkipped(Cons_storyItemSkipped) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyItem(let _data): + if boxed { + buffer.appendInt32(-302947087) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + _data.fwdFrom!.serialize(buffer, true) + } + serializeInt32(_data.expireDate, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.caption!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { + item.serialize(buffer, true) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 18) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {fwdFrom!.serialize(buffer, true)} - serializeInt32(expireDate, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(caption!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + } + _data.media.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 14) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.mediaAreas!.count)) + for item in _data.mediaAreas! { item.serialize(buffer, true) - }} - media.serialize(buffer, true) - if Int(flags) & Int(1 << 14) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(mediaAreas!.count)) - for item in mediaAreas! { + } + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.privacy!.count)) + for item in _data.privacy! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(privacy!.count)) - for item in privacy! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 3) != 0 {views!.serialize(buffer, true)} - if Int(flags) & Int(1 << 15) != 0 {sentReaction!.serialize(buffer, true)} - if Int(flags) & Int(1 << 19) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(albums!.count)) - for item in albums! { + } + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.views!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.sentReaction!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 19) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.albums!.count)) + for item in _data.albums! { serializeInt32(item, buffer: buffer, boxed: false) - }} - break - case .storyItemDeleted(let id): - if boxed { - buffer.appendInt32(1374088783) } - serializeInt32(id, buffer: buffer, boxed: false) - break - case .storyItemSkipped(let flags, let id, let date, let expireDate): - if boxed { - buffer.appendInt32(-5388013) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(expireDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyItem(let flags, let id, let date, let fromId, let fwdFrom, let expireDate, let caption, let entities, let media, let mediaAreas, let privacy, let views, let sentReaction, let albums): - return ("storyItem", [("flags", flags as Any), ("id", id as Any), ("date", date as Any), ("fromId", fromId as Any), ("fwdFrom", fwdFrom as Any), ("expireDate", expireDate as Any), ("caption", caption as Any), ("entities", entities as Any), ("media", media as Any), ("mediaAreas", mediaAreas as Any), ("privacy", privacy as Any), ("views", views as Any), ("sentReaction", sentReaction as Any), ("albums", albums as Any)]) - case .storyItemDeleted(let id): - return ("storyItemDeleted", [("id", id as Any)]) - case .storyItemSkipped(let flags, let id, let date, let expireDate): - return ("storyItemSkipped", [("flags", flags as Any), ("id", id as Any), ("date", date as Any), ("expireDate", expireDate as Any)]) - } - } - + } + break + case .storyItemDeleted(let _data): + if boxed { + buffer.appendInt32(1374088783) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + case .storyItemSkipped(let _data): + if boxed { + buffer.appendInt32(-5388013) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.expireDate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyItem(let _data): + return ("storyItem", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("fromId", _data.fromId as Any), ("fwdFrom", _data.fwdFrom as Any), ("expireDate", _data.expireDate as Any), ("caption", _data.caption as Any), ("entities", _data.entities as Any), ("media", _data.media as Any), ("mediaAreas", _data.mediaAreas as Any), ("privacy", _data.privacy as Any), ("views", _data.views as Any), ("sentReaction", _data.sentReaction as Any), ("albums", _data.albums as Any)]) + case .storyItemDeleted(let _data): + return ("storyItemDeleted", [("id", _data.id as Any)]) + case .storyItemSkipped(let _data): + return ("storyItemSkipped", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("expireDate", _data.expireDate as Any)]) + } + } + public static func parse_storyItem(_ reader: BufferReader) -> StoryItem? { var _1: Int32? _1 = reader.readInt32() @@ -228,45 +357,63 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.Peer? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _5: Api.StoryFwdHeader? - if Int(_1!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.StoryFwdHeader - } } + if Int(_1!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.StoryFwdHeader + } + } var _6: Int32? _6 = reader.readInt32() var _7: String? - if Int(_1!) & Int(1 << 0) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } var _8: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _9: Api.MessageMedia? if let signature = reader.readInt32() { _9 = Api.parse(reader, signature: signature) as? Api.MessageMedia } var _10: [Api.MediaArea]? - if Int(_1!) & Int(1 << 14) != 0 {if let _ = reader.readInt32() { - _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MediaArea.self) - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let _ = reader.readInt32() { + _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MediaArea.self) + } + } var _11: [Api.PrivacyRule]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) + } + } var _12: Api.StoryViews? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.StoryViews - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.StoryViews + } + } var _13: Api.Reaction? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.Reaction - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.Reaction + } + } var _14: [Int32]? - if Int(_1!) & Int(1 << 19) != 0 {if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 19) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -282,7 +429,7 @@ public extension Api { let _c13 = (Int(_1!) & Int(1 << 15) == 0) || _13 != nil let _c14 = (Int(_1!) & Int(1 << 19) == 0) || _14 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 { - return Api.StoryItem.storyItem(flags: _1!, id: _2!, date: _3!, fromId: _4, fwdFrom: _5, expireDate: _6!, caption: _7, entities: _8, media: _9!, mediaAreas: _10, privacy: _11, views: _12, sentReaction: _13, albums: _14) + return Api.StoryItem.storyItem(Cons_storyItem(flags: _1!, id: _2!, date: _3!, fromId: _4, fwdFrom: _5, expireDate: _6!, caption: _7, entities: _8, media: _9!, mediaAreas: _10, privacy: _11, views: _12, sentReaction: _13, albums: _14)) } else { return nil @@ -293,7 +440,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.StoryItem.storyItemDeleted(id: _1!) + return Api.StoryItem.storyItemDeleted(Cons_storyItemDeleted(id: _1!)) } else { return nil @@ -313,58 +460,81 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StoryItem.storyItemSkipped(flags: _1!, id: _2!, date: _3!, expireDate: _4!) + return Api.StoryItem.storyItemSkipped(Cons_storyItemSkipped(flags: _1!, id: _2!, date: _3!, expireDate: _4!)) } else { return nil } } - } } public extension Api { indirect enum StoryReaction: TypeConstructorDescription { - case storyReaction(peerId: Api.Peer, date: Int32, reaction: Api.Reaction) - case storyReactionPublicForward(message: Api.Message) - case storyReactionPublicRepost(peerId: Api.Peer, story: Api.StoryItem) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyReaction(let peerId, let date, let reaction): - if boxed { - buffer.appendInt32(1620104917) - } - peerId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - break - case .storyReactionPublicForward(let message): - if boxed { - buffer.appendInt32(-1146411453) - } - message.serialize(buffer, true) - break - case .storyReactionPublicRepost(let peerId, let story): - if boxed { - buffer.appendInt32(-808644845) - } - peerId.serialize(buffer, true) - story.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyReaction(let peerId, let date, let reaction): - return ("storyReaction", [("peerId", peerId as Any), ("date", date as Any), ("reaction", reaction as Any)]) - case .storyReactionPublicForward(let message): - return ("storyReactionPublicForward", [("message", message as Any)]) - case .storyReactionPublicRepost(let peerId, let story): - return ("storyReactionPublicRepost", [("peerId", peerId as Any), ("story", story as Any)]) - } - } - + public class Cons_storyReaction { + public var peerId: Api.Peer + public var date: Int32 + public var reaction: Api.Reaction + public init(peerId: Api.Peer, date: Int32, reaction: Api.Reaction) { + self.peerId = peerId + self.date = date + self.reaction = reaction + } + } + public class Cons_storyReactionPublicForward { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_storyReactionPublicRepost { + public var peerId: Api.Peer + public var story: Api.StoryItem + public init(peerId: Api.Peer, story: Api.StoryItem) { + self.peerId = peerId + self.story = story + } + } + case storyReaction(Cons_storyReaction) + case storyReactionPublicForward(Cons_storyReactionPublicForward) + case storyReactionPublicRepost(Cons_storyReactionPublicRepost) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyReaction(let _data): + if boxed { + buffer.appendInt32(1620104917) + } + _data.peerId.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.reaction.serialize(buffer, true) + break + case .storyReactionPublicForward(let _data): + if boxed { + buffer.appendInt32(-1146411453) + } + _data.message.serialize(buffer, true) + break + case .storyReactionPublicRepost(let _data): + if boxed { + buffer.appendInt32(-808644845) + } + _data.peerId.serialize(buffer, true) + _data.story.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyReaction(let _data): + return ("storyReaction", [("peerId", _data.peerId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + case .storyReactionPublicForward(let _data): + return ("storyReactionPublicForward", [("message", _data.message as Any)]) + case .storyReactionPublicRepost(let _data): + return ("storyReactionPublicRepost", [("peerId", _data.peerId as Any), ("story", _data.story as Any)]) + } + } + public static func parse_storyReaction(_ reader: BufferReader) -> StoryReaction? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -380,7 +550,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StoryReaction.storyReaction(peerId: _1!, date: _2!, reaction: _3!) + return Api.StoryReaction.storyReaction(Cons_storyReaction(peerId: _1!, date: _2!, reaction: _3!)) } else { return nil @@ -393,7 +563,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.StoryReaction.storyReactionPublicForward(message: _1!) + return Api.StoryReaction.storyReactionPublicForward(Cons_storyReactionPublicForward(message: _1!)) } else { return nil @@ -411,61 +581,92 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StoryReaction.storyReactionPublicRepost(peerId: _1!, story: _2!) + return Api.StoryReaction.storyReactionPublicRepost(Cons_storyReactionPublicRepost(peerId: _1!, story: _2!)) } else { return nil } } - } } public extension Api { indirect enum StoryView: TypeConstructorDescription { - case storyView(flags: Int32, userId: Int64, date: Int32, reaction: Api.Reaction?) - case storyViewPublicForward(flags: Int32, message: Api.Message) - case storyViewPublicRepost(flags: Int32, peerId: Api.Peer, story: Api.StoryItem) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyView(let flags, let userId, let date, let reaction): - if boxed { - buffer.appendInt32(-1329730875) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {reaction!.serialize(buffer, true)} - break - case .storyViewPublicForward(let flags, let message): - if boxed { - buffer.appendInt32(-1870436597) - } - serializeInt32(flags, buffer: buffer, boxed: false) - message.serialize(buffer, true) - break - case .storyViewPublicRepost(let flags, let peerId, let story): - if boxed { - buffer.appendInt32(-1116418231) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peerId.serialize(buffer, true) - story.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyView(let flags, let userId, let date, let reaction): - return ("storyView", [("flags", flags as Any), ("userId", userId as Any), ("date", date as Any), ("reaction", reaction as Any)]) - case .storyViewPublicForward(let flags, let message): - return ("storyViewPublicForward", [("flags", flags as Any), ("message", message as Any)]) - case .storyViewPublicRepost(let flags, let peerId, let story): - return ("storyViewPublicRepost", [("flags", flags as Any), ("peerId", peerId as Any), ("story", story as Any)]) - } - } - + public class Cons_storyView { + public var flags: Int32 + public var userId: Int64 + public var date: Int32 + public var reaction: Api.Reaction? + public init(flags: Int32, userId: Int64, date: Int32, reaction: Api.Reaction?) { + self.flags = flags + self.userId = userId + self.date = date + self.reaction = reaction + } + } + public class Cons_storyViewPublicForward { + public var flags: Int32 + public var message: Api.Message + public init(flags: Int32, message: Api.Message) { + self.flags = flags + self.message = message + } + } + public class Cons_storyViewPublicRepost { + public var flags: Int32 + public var peerId: Api.Peer + public var story: Api.StoryItem + public init(flags: Int32, peerId: Api.Peer, story: Api.StoryItem) { + self.flags = flags + self.peerId = peerId + self.story = story + } + } + case storyView(Cons_storyView) + case storyViewPublicForward(Cons_storyViewPublicForward) + case storyViewPublicRepost(Cons_storyViewPublicRepost) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyView(let _data): + if boxed { + buffer.appendInt32(-1329730875) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.reaction!.serialize(buffer, true) + } + break + case .storyViewPublicForward(let _data): + if boxed { + buffer.appendInt32(-1870436597) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + break + case .storyViewPublicRepost(let _data): + if boxed { + buffer.appendInt32(-1116418231) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peerId.serialize(buffer, true) + _data.story.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyView(let _data): + return ("storyView", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + case .storyViewPublicForward(let _data): + return ("storyViewPublicForward", [("flags", _data.flags as Any), ("message", _data.message as Any)]) + case .storyViewPublicRepost(let _data): + return ("storyViewPublicRepost", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("story", _data.story as Any)]) + } + } + public static func parse_storyView(_ reader: BufferReader) -> StoryView? { var _1: Int32? _1 = reader.readInt32() @@ -474,15 +675,17 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.Reaction? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Reaction - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Reaction + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StoryView.storyView(flags: _1!, userId: _2!, date: _3!, reaction: _4) + return Api.StoryView.storyView(Cons_storyView(flags: _1!, userId: _2!, date: _3!, reaction: _4)) } else { return nil @@ -498,7 +701,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StoryView.storyViewPublicForward(flags: _1!, message: _2!) + return Api.StoryView.storyViewPublicForward(Cons_storyViewPublicForward(flags: _1!, message: _2!)) } else { return nil @@ -519,67 +722,98 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StoryView.storyViewPublicRepost(flags: _1!, peerId: _2!, story: _3!) + return Api.StoryView.storyViewPublicRepost(Cons_storyViewPublicRepost(flags: _1!, peerId: _2!, story: _3!)) } else { return nil } } - } } public extension Api { enum StoryViews: TypeConstructorDescription { - case storyViews(flags: Int32, viewsCount: Int32, forwardsCount: Int32?, reactions: [Api.ReactionCount]?, reactionsCount: Int32?, recentViewers: [Int64]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyViews(let flags, let viewsCount, let forwardsCount, let reactions, let reactionsCount, let recentViewers): - if boxed { - buffer.appendInt32(-1923523370) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(viewsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(forwardsCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions!.count)) - for item in reactions! { + public class Cons_storyViews { + public var flags: Int32 + public var viewsCount: Int32 + public var forwardsCount: Int32? + public var reactions: [Api.ReactionCount]? + public var reactionsCount: Int32? + public var recentViewers: [Int64]? + public init(flags: Int32, viewsCount: Int32, forwardsCount: Int32?, reactions: [Api.ReactionCount]?, reactionsCount: Int32?, recentViewers: [Int64]?) { + self.flags = flags + self.viewsCount = viewsCount + self.forwardsCount = forwardsCount + self.reactions = reactions + self.reactionsCount = reactionsCount + self.recentViewers = recentViewers + } + } + case storyViews(Cons_storyViews) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyViews(let _data): + if boxed { + buffer.appendInt32(-1923523370) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.viewsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.forwardsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions!.count)) + for item in _data.reactions! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(reactionsCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentViewers!.count)) - for item in recentViewers! { + } + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.reactionsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentViewers!.count)) + for item in _data.recentViewers! { serializeInt64(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyViews(let flags, let viewsCount, let forwardsCount, let reactions, let reactionsCount, let recentViewers): - return ("storyViews", [("flags", flags as Any), ("viewsCount", viewsCount as Any), ("forwardsCount", forwardsCount as Any), ("reactions", reactions as Any), ("reactionsCount", reactionsCount as Any), ("recentViewers", recentViewers as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyViews(let _data): + return ("storyViews", [("flags", _data.flags as Any), ("viewsCount", _data.viewsCount as Any), ("forwardsCount", _data.forwardsCount as Any), ("reactions", _data.reactions as Any), ("reactionsCount", _data.reactionsCount as Any), ("recentViewers", _data.recentViewers as Any)]) + } + } + public static func parse_storyViews(_ reader: BufferReader) -> StoryViews? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } var _4: [Api.ReactionCount]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) + } + } var _5: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } var _6: [Int64]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil @@ -587,88 +821,112 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StoryViews.storyViews(flags: _1!, viewsCount: _2!, forwardsCount: _3, reactions: _4, reactionsCount: _5, recentViewers: _6) + return Api.StoryViews.storyViews(Cons_storyViews(flags: _1!, viewsCount: _2!, forwardsCount: _3, reactions: _4, reactionsCount: _5, recentViewers: _6)) } else { return nil } } - } } public extension Api { enum SuggestedPost: TypeConstructorDescription { - case suggestedPost(flags: Int32, price: Api.StarsAmount?, scheduleDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .suggestedPost(let flags, let price, let scheduleDate): - if boxed { - buffer.appendInt32(244201445) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {price!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .suggestedPost(let flags, let price, let scheduleDate): - return ("suggestedPost", [("flags", flags as Any), ("price", price as Any), ("scheduleDate", scheduleDate as Any)]) - } - } - + public class Cons_suggestedPost { + public var flags: Int32 + public var price: Api.StarsAmount? + public var scheduleDate: Int32? + public init(flags: Int32, price: Api.StarsAmount?, scheduleDate: Int32?) { + self.flags = flags + self.price = price + self.scheduleDate = scheduleDate + } + } + case suggestedPost(Cons_suggestedPost) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .suggestedPost(let _data): + if boxed { + buffer.appendInt32(244201445) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.price!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.scheduleDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .suggestedPost(let _data): + return ("suggestedPost", [("flags", _data.flags as Any), ("price", _data.price as Any), ("scheduleDate", _data.scheduleDate as Any)]) + } + } + public static func parse_suggestedPost(_ reader: BufferReader) -> SuggestedPost? { var _1: Int32? _1 = reader.readInt32() var _2: Api.StarsAmount? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.SuggestedPost.suggestedPost(flags: _1!, price: _2, scheduleDate: _3) + return Api.SuggestedPost.suggestedPost(Cons_suggestedPost(flags: _1!, price: _2, scheduleDate: _3)) } else { return nil } } - } } public extension Api { enum TextWithEntities: TypeConstructorDescription { - case textWithEntities(text: String, entities: [Api.MessageEntity]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .textWithEntities(let text, let entities): - if boxed { - buffer.appendInt32(1964978502) - } - serializeString(text, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .textWithEntities(let text, let entities): - return ("textWithEntities", [("text", text as Any), ("entities", entities as Any)]) - } - } - + public class Cons_textWithEntities { + public var text: String + public var entities: [Api.MessageEntity] + public init(text: String, entities: [Api.MessageEntity]) { + self.text = text + self.entities = entities + } + } + case textWithEntities(Cons_textWithEntities) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .textWithEntities(let _data): + if boxed { + buffer.appendInt32(1964978502) + } + serializeString(_data.text, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities.count)) + for item in _data.entities { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .textWithEntities(let _data): + return ("textWithEntities", [("text", _data.text as Any), ("entities", _data.entities as Any)]) + } + } + public static func parse_textWithEntities(_ reader: BufferReader) -> TextWithEntities? { var _1: String? _1 = parseString(reader) @@ -679,49 +937,78 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.TextWithEntities.textWithEntities(text: _1!, entities: _2!) + return Api.TextWithEntities.textWithEntities(Cons_textWithEntities(text: _1!, entities: _2!)) } else { return nil } } - } } public extension Api { enum Theme: TypeConstructorDescription { - case theme(flags: Int32, id: Int64, accessHash: Int64, slug: String, title: String, document: Api.Document?, settings: [Api.ThemeSettings]?, emoticon: String?, installsCount: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .theme(let flags, let id, let accessHash, let slug, let title, let document, let settings, let emoticon, let installsCount): - if boxed { - buffer.appendInt32(-1609668650) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(settings!.count)) - for item in settings! { + public class Cons_theme { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var slug: String + public var title: String + public var document: Api.Document? + public var settings: [Api.ThemeSettings]? + public var emoticon: String? + public var installsCount: Int32? + public init(flags: Int32, id: Int64, accessHash: Int64, slug: String, title: String, document: Api.Document?, settings: [Api.ThemeSettings]?, emoticon: String?, installsCount: Int32?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.slug = slug + self.title = title + self.document = document + self.settings = settings + self.emoticon = emoticon + self.installsCount = installsCount + } + } + case theme(Cons_theme) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .theme(let _data): + if boxed { + buffer.appendInt32(-1609668650) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.settings!.count)) + for item in _data.settings! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 6) != 0 {serializeString(emoticon!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(installsCount!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .theme(let flags, let id, let accessHash, let slug, let title, let document, let settings, let emoticon, let installsCount): - return ("theme", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("slug", slug as Any), ("title", title as Any), ("document", document as Any), ("settings", settings as Any), ("emoticon", emoticon as Any), ("installsCount", installsCount as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.installsCount!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .theme(let _data): + return ("theme", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("slug", _data.slug as Any), ("title", _data.title as Any), ("document", _data.document as Any), ("settings", _data.settings as Any), ("emoticon", _data.emoticon as Any), ("installsCount", _data.installsCount as Any)]) + } + } + public static func parse_theme(_ reader: BufferReader) -> Theme? { var _1: Int32? _1 = reader.readInt32() @@ -734,17 +1021,25 @@ public extension Api { var _5: String? _5 = parseString(reader) var _6: Api.Document? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _7: [Api.ThemeSettings]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) + } + } var _8: String? - if Int(_1!) & Int(1 << 6) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _8 = parseString(reader) + } var _9: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _9 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -755,46 +1050,67 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 6) == 0) || _8 != nil let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Theme.theme(flags: _1!, id: _2!, accessHash: _3!, slug: _4!, title: _5!, document: _6, settings: _7, emoticon: _8, installsCount: _9) + return Api.Theme.theme(Cons_theme(flags: _1!, id: _2!, accessHash: _3!, slug: _4!, title: _5!, document: _6, settings: _7, emoticon: _8, installsCount: _9)) } else { return nil } } - } } public extension Api { enum ThemeSettings: TypeConstructorDescription { - case themeSettings(flags: Int32, baseTheme: Api.BaseTheme, accentColor: Int32, outboxAccentColor: Int32?, messageColors: [Int32]?, wallpaper: Api.WallPaper?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .themeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper): - if boxed { - buffer.appendInt32(-94849324) - } - serializeInt32(flags, buffer: buffer, boxed: false) - baseTheme.serialize(buffer, true) - serializeInt32(accentColor, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(outboxAccentColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messageColors!.count)) - for item in messageColors! { + public class Cons_themeSettings { + public var flags: Int32 + public var baseTheme: Api.BaseTheme + public var accentColor: Int32 + public var outboxAccentColor: Int32? + public var messageColors: [Int32]? + public var wallpaper: Api.WallPaper? + public init(flags: Int32, baseTheme: Api.BaseTheme, accentColor: Int32, outboxAccentColor: Int32?, messageColors: [Int32]?, wallpaper: Api.WallPaper?) { + self.flags = flags + self.baseTheme = baseTheme + self.accentColor = accentColor + self.outboxAccentColor = outboxAccentColor + self.messageColors = messageColors + self.wallpaper = wallpaper + } + } + case themeSettings(Cons_themeSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .themeSettings(let _data): + if boxed { + buffer.appendInt32(-94849324) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.baseTheme.serialize(buffer, true) + serializeInt32(_data.accentColor, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.outboxAccentColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messageColors!.count)) + for item in _data.messageColors! { serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 1) != 0 {wallpaper!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .themeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper): - return ("themeSettings", [("flags", flags as Any), ("baseTheme", baseTheme as Any), ("accentColor", accentColor as Any), ("outboxAccentColor", outboxAccentColor as Any), ("messageColors", messageColors as Any), ("wallpaper", wallpaper as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .themeSettings(let _data): + return ("themeSettings", [("flags", _data.flags as Any), ("baseTheme", _data.baseTheme as Any), ("accentColor", _data.accentColor as Any), ("outboxAccentColor", _data.outboxAccentColor as Any), ("messageColors", _data.messageColors as Any), ("wallpaper", _data.wallpaper as Any)]) + } + } + public static func parse_themeSettings(_ reader: BufferReader) -> ThemeSettings? { var _1: Int32? _1 = reader.readInt32() @@ -805,15 +1121,21 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } var _5: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } var _6: Api.WallPaper? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WallPaper - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -821,39 +1143,48 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.ThemeSettings.themeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6) + return Api.ThemeSettings.themeSettings(Cons_themeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6)) } else { return nil } } - } } public extension Api { enum Timezone: TypeConstructorDescription { - case timezone(id: String, name: String, utcOffset: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .timezone(let id, let name, let utcOffset): - if boxed { - buffer.appendInt32(-7173643) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - serializeInt32(utcOffset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .timezone(let id, let name, let utcOffset): - return ("timezone", [("id", id as Any), ("name", name as Any), ("utcOffset", utcOffset as Any)]) - } - } - + public class Cons_timezone { + public var id: String + public var name: String + public var utcOffset: Int32 + public init(id: String, name: String, utcOffset: Int32) { + self.id = id + self.name = name + self.utcOffset = utcOffset + } + } + case timezone(Cons_timezone) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .timezone(let _data): + if boxed { + buffer.appendInt32(-7173643) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + serializeInt32(_data.utcOffset, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .timezone(let _data): + return ("timezone", [("id", _data.id as Any), ("name", _data.name as Any), ("utcOffset", _data.utcOffset as Any)]) + } + } + public static func parse_timezone(_ reader: BufferReader) -> Timezone? { var _1: String? _1 = parseString(reader) @@ -865,39 +1196,48 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Timezone.timezone(id: _1!, name: _2!, utcOffset: _3!) + return Api.Timezone.timezone(Cons_timezone(id: _1!, name: _2!, utcOffset: _3!)) } else { return nil } } - } } public extension Api { enum TodoCompletion: TypeConstructorDescription { - case todoCompletion(id: Int32, completedBy: Api.Peer, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoCompletion(let id, let completedBy, let date): - if boxed { - buffer.appendInt32(572241380) - } - serializeInt32(id, buffer: buffer, boxed: false) - completedBy.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoCompletion(let id, let completedBy, let date): - return ("todoCompletion", [("id", id as Any), ("completedBy", completedBy as Any), ("date", date as Any)]) - } - } - + public class Cons_todoCompletion { + public var id: Int32 + public var completedBy: Api.Peer + public var date: Int32 + public init(id: Int32, completedBy: Api.Peer, date: Int32) { + self.id = id + self.completedBy = completedBy + self.date = date + } + } + case todoCompletion(Cons_todoCompletion) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .todoCompletion(let _data): + if boxed { + buffer.appendInt32(572241380) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + _data.completedBy.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .todoCompletion(let _data): + return ("todoCompletion", [("id", _data.id as Any), ("completedBy", _data.completedBy as Any), ("date", _data.date as Any)]) + } + } + public static func parse_todoCompletion(_ reader: BufferReader) -> TodoCompletion? { var _1: Int32? _1 = reader.readInt32() @@ -911,38 +1251,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.TodoCompletion.todoCompletion(id: _1!, completedBy: _2!, date: _3!) + return Api.TodoCompletion.todoCompletion(Cons_todoCompletion(id: _1!, completedBy: _2!, date: _3!)) } else { return nil } } - } } public extension Api { enum TodoItem: TypeConstructorDescription { - case todoItem(id: Int32, title: Api.TextWithEntities) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoItem(let id, let title): - if boxed { - buffer.appendInt32(-878074577) - } - serializeInt32(id, buffer: buffer, boxed: false) - title.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoItem(let id, let title): - return ("todoItem", [("id", id as Any), ("title", title as Any)]) - } - } - + public class Cons_todoItem { + public var id: Int32 + public var title: Api.TextWithEntities + public init(id: Int32, title: Api.TextWithEntities) { + self.id = id + self.title = title + } + } + case todoItem(Cons_todoItem) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .todoItem(let _data): + if boxed { + buffer.appendInt32(-878074577) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .todoItem(let _data): + return ("todoItem", [("id", _data.id as Any), ("title", _data.title as Any)]) + } + } + public static func parse_todoItem(_ reader: BufferReader) -> TodoItem? { var _1: Int32? _1 = reader.readInt32() @@ -953,43 +1300,52 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.TodoItem.todoItem(id: _1!, title: _2!) + return Api.TodoItem.todoItem(Cons_todoItem(id: _1!, title: _2!)) } else { return nil } } - } } public extension Api { enum TodoList: TypeConstructorDescription { - case todoList(flags: Int32, title: Api.TextWithEntities, list: [Api.TodoItem]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoList(let flags, let title, let list): - if boxed { - buffer.appendInt32(1236871718) - } - serializeInt32(flags, buffer: buffer, boxed: false) - title.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(list.count)) - for item in list { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoList(let flags, let title, let list): - return ("todoList", [("flags", flags as Any), ("title", title as Any), ("list", list as Any)]) - } - } - + public class Cons_todoList { + public var flags: Int32 + public var title: Api.TextWithEntities + public var list: [Api.TodoItem] + public init(flags: Int32, title: Api.TextWithEntities, list: [Api.TodoItem]) { + self.flags = flags + self.title = title + self.list = list + } + } + case todoList(Cons_todoList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .todoList(let _data): + if boxed { + buffer.appendInt32(1236871718) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.list.count)) + for item in _data.list { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .todoList(let _data): + return ("todoList", [("flags", _data.flags as Any), ("title", _data.title as Any), ("list", _data.list as Any)]) + } + } + public static func parse_todoList(_ reader: BufferReader) -> TodoList? { var _1: Int32? _1 = reader.readInt32() @@ -1005,38 +1361,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.TodoList.todoList(flags: _1!, title: _2!, list: _3!) + return Api.TodoList.todoList(Cons_todoList(flags: _1!, title: _2!, list: _3!)) } else { return nil } } - } } public extension Api { enum TopPeer: TypeConstructorDescription { - case topPeer(peer: Api.Peer, rating: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .topPeer(let peer, let rating): - if boxed { - buffer.appendInt32(-305282981) - } - peer.serialize(buffer, true) - serializeDouble(rating, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeer(let peer, let rating): - return ("topPeer", [("peer", peer as Any), ("rating", rating as Any)]) - } - } - + public class Cons_topPeer { + public var peer: Api.Peer + public var rating: Double + public init(peer: Api.Peer, rating: Double) { + self.peer = peer + self.rating = rating + } + } + case topPeer(Cons_topPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .topPeer(let _data): + if boxed { + buffer.appendInt32(-305282981) + } + _data.peer.serialize(buffer, true) + serializeDouble(_data.rating, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .topPeer(let _data): + return ("topPeer", [("peer", _data.peer as Any), ("rating", _data.rating as Any)]) + } + } + public static func parse_topPeer(_ reader: BufferReader) -> TopPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -1047,13 +1410,12 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.TopPeer.topPeer(peer: _1!, rating: _2!) + return Api.TopPeer.topPeer(Cons_topPeer(peer: _1!, rating: _2!)) } else { return nil } } - } } public extension Api { @@ -1067,89 +1429,80 @@ public extension Api { case topPeerCategoryForwardUsers case topPeerCategoryGroups case topPeerCategoryPhoneCalls - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .topPeerCategoryBotsApp: - if boxed { - buffer.appendInt32(-39945236) - } - - break - case .topPeerCategoryBotsInline: - if boxed { - buffer.appendInt32(344356834) - } - - break - case .topPeerCategoryBotsPM: - if boxed { - buffer.appendInt32(-1419371685) - } - - break - case .topPeerCategoryChannels: - if boxed { - buffer.appendInt32(371037736) - } - - break - case .topPeerCategoryCorrespondents: - if boxed { - buffer.appendInt32(104314861) - } - - break - case .topPeerCategoryForwardChats: - if boxed { - buffer.appendInt32(-68239120) - } - - break - case .topPeerCategoryForwardUsers: - if boxed { - buffer.appendInt32(-1472172887) - } - - break - case .topPeerCategoryGroups: - if boxed { - buffer.appendInt32(-1122524854) - } - - break - case .topPeerCategoryPhoneCalls: - if boxed { - buffer.appendInt32(511092620) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeerCategoryBotsApp: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .topPeerCategoryBotsApp: + if boxed { + buffer.appendInt32(-39945236) + } + break + case .topPeerCategoryBotsInline: + if boxed { + buffer.appendInt32(344356834) + } + break + case .topPeerCategoryBotsPM: + if boxed { + buffer.appendInt32(-1419371685) + } + break + case .topPeerCategoryChannels: + if boxed { + buffer.appendInt32(371037736) + } + break + case .topPeerCategoryCorrespondents: + if boxed { + buffer.appendInt32(104314861) + } + break + case .topPeerCategoryForwardChats: + if boxed { + buffer.appendInt32(-68239120) + } + break + case .topPeerCategoryForwardUsers: + if boxed { + buffer.appendInt32(-1472172887) + } + break + case .topPeerCategoryGroups: + if boxed { + buffer.appendInt32(-1122524854) + } + break + case .topPeerCategoryPhoneCalls: + if boxed { + buffer.appendInt32(511092620) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .topPeerCategoryBotsApp: return ("topPeerCategoryBotsApp", []) - case .topPeerCategoryBotsInline: + case .topPeerCategoryBotsInline: return ("topPeerCategoryBotsInline", []) - case .topPeerCategoryBotsPM: + case .topPeerCategoryBotsPM: return ("topPeerCategoryBotsPM", []) - case .topPeerCategoryChannels: + case .topPeerCategoryChannels: return ("topPeerCategoryChannels", []) - case .topPeerCategoryCorrespondents: + case .topPeerCategoryCorrespondents: return ("topPeerCategoryCorrespondents", []) - case .topPeerCategoryForwardChats: + case .topPeerCategoryForwardChats: return ("topPeerCategoryForwardChats", []) - case .topPeerCategoryForwardUsers: + case .topPeerCategoryForwardUsers: return ("topPeerCategoryForwardUsers", []) - case .topPeerCategoryGroups: + case .topPeerCategoryGroups: return ("topPeerCategoryGroups", []) - case .topPeerCategoryPhoneCalls: + case .topPeerCategoryPhoneCalls: return ("topPeerCategoryPhoneCalls", []) - } - } - + } + } + public static func parse_topPeerCategoryBotsApp(_ reader: BufferReader) -> TopPeerCategory? { return Api.TopPeerCategory.topPeerCategoryBotsApp } @@ -1177,37 +1530,46 @@ public extension Api { public static func parse_topPeerCategoryPhoneCalls(_ reader: BufferReader) -> TopPeerCategory? { return Api.TopPeerCategory.topPeerCategoryPhoneCalls } - } } public extension Api { enum TopPeerCategoryPeers: TypeConstructorDescription { - case topPeerCategoryPeers(category: Api.TopPeerCategory, count: Int32, peers: [Api.TopPeer]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .topPeerCategoryPeers(let category, let count, let peers): - if boxed { - buffer.appendInt32(-75283823) - } - category.serialize(buffer, true) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeerCategoryPeers(let category, let count, let peers): - return ("topPeerCategoryPeers", [("category", category as Any), ("count", count as Any), ("peers", peers as Any)]) - } - } - + public class Cons_topPeerCategoryPeers { + public var category: Api.TopPeerCategory + public var count: Int32 + public var peers: [Api.TopPeer] + public init(category: Api.TopPeerCategory, count: Int32, peers: [Api.TopPeer]) { + self.category = category + self.count = count + self.peers = peers + } + } + case topPeerCategoryPeers(Cons_topPeerCategoryPeers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .topPeerCategoryPeers(let _data): + if boxed { + buffer.appendInt32(-75283823) + } + _data.category.serialize(buffer, true) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .topPeerCategoryPeers(let _data): + return ("topPeerCategoryPeers", [("category", _data.category as Any), ("count", _data.count as Any), ("peers", _data.peers as Any)]) + } + } + public static func parse_topPeerCategoryPeers(_ reader: BufferReader) -> TopPeerCategoryPeers? { var _1: Api.TopPeerCategory? if let signature = reader.readInt32() { @@ -1223,12 +1585,11 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.TopPeerCategoryPeers.topPeerCategoryPeers(category: _1!, count: _2!, peers: _3!) + return Api.TopPeerCategoryPeers.topPeerCategoryPeers(Cons_topPeerCategoryPeers(category: _1!, count: _2!, peers: _3!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api28.swift b/submodules/TelegramApi/Sources/Api28.swift index 0b2de32a38..2fcefd2998 100644 --- a/submodules/TelegramApi/Sources/Api28.swift +++ b/submodules/TelegramApi/Sources/Api28.swift @@ -1,1796 +1,3259 @@ public extension Api { indirect enum Update: TypeConstructorDescription { + public class Cons_updateBotBusinessConnect { + public var connection: Api.BotBusinessConnection + public var qts: Int32 + public init(connection: Api.BotBusinessConnection, qts: Int32) { + self.connection = connection + self.qts = qts + } + } + public class Cons_updateBotCallbackQuery { + public var flags: Int32 + public var queryId: Int64 + public var userId: Int64 + public var peer: Api.Peer + public var msgId: Int32 + public var chatInstance: Int64 + public var data: Buffer? + public var gameShortName: String? + public init(flags: Int32, queryId: Int64, userId: Int64, peer: Api.Peer, msgId: Int32, chatInstance: Int64, data: Buffer?, gameShortName: String?) { + self.flags = flags + self.queryId = queryId + self.userId = userId + self.peer = peer + self.msgId = msgId + self.chatInstance = chatInstance + self.data = data + self.gameShortName = gameShortName + } + } + public class Cons_updateBotChatBoost { + public var peer: Api.Peer + public var boost: Api.Boost + public var qts: Int32 + public init(peer: Api.Peer, boost: Api.Boost, qts: Int32) { + self.peer = peer + self.boost = boost + self.qts = qts + } + } + public class Cons_updateBotChatInviteRequester { + public var peer: Api.Peer + public var date: Int32 + public var userId: Int64 + public var about: String + public var invite: Api.ExportedChatInvite + public var qts: Int32 + public init(peer: Api.Peer, date: Int32, userId: Int64, about: String, invite: Api.ExportedChatInvite, qts: Int32) { + self.peer = peer + self.date = date + self.userId = userId + self.about = about + self.invite = invite + self.qts = qts + } + } + public class Cons_updateBotCommands { + public var peer: Api.Peer + public var botId: Int64 + public var commands: [Api.BotCommand] + public init(peer: Api.Peer, botId: Int64, commands: [Api.BotCommand]) { + self.peer = peer + self.botId = botId + self.commands = commands + } + } + public class Cons_updateBotDeleteBusinessMessage { + public var connectionId: String + public var peer: Api.Peer + public var messages: [Int32] + public var qts: Int32 + public init(connectionId: String, peer: Api.Peer, messages: [Int32], qts: Int32) { + self.connectionId = connectionId + self.peer = peer + self.messages = messages + self.qts = qts + } + } + public class Cons_updateBotEditBusinessMessage { + public var flags: Int32 + public var connectionId: String + public var message: Api.Message + public var replyToMessage: Api.Message? + public var qts: Int32 + public init(flags: Int32, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, qts: Int32) { + self.flags = flags + self.connectionId = connectionId + self.message = message + self.replyToMessage = replyToMessage + self.qts = qts + } + } + public class Cons_updateBotInlineQuery { + public var flags: Int32 + public var queryId: Int64 + public var userId: Int64 + public var query: String + public var geo: Api.GeoPoint? + public var peerType: Api.InlineQueryPeerType? + public var offset: String + public init(flags: Int32, queryId: Int64, userId: Int64, query: String, geo: Api.GeoPoint?, peerType: Api.InlineQueryPeerType?, offset: String) { + self.flags = flags + self.queryId = queryId + self.userId = userId + self.query = query + self.geo = geo + self.peerType = peerType + self.offset = offset + } + } + public class Cons_updateBotInlineSend { + public var flags: Int32 + public var userId: Int64 + public var query: String + public var geo: Api.GeoPoint? + public var id: String + public var msgId: Api.InputBotInlineMessageID? + public init(flags: Int32, userId: Int64, query: String, geo: Api.GeoPoint?, id: String, msgId: Api.InputBotInlineMessageID?) { + self.flags = flags + self.userId = userId + self.query = query + self.geo = geo + self.id = id + self.msgId = msgId + } + } + public class Cons_updateBotMenuButton { + public var botId: Int64 + public var button: Api.BotMenuButton + public init(botId: Int64, button: Api.BotMenuButton) { + self.botId = botId + self.button = button + } + } + public class Cons_updateBotMessageReaction { + public var peer: Api.Peer + public var msgId: Int32 + public var date: Int32 + public var actor: Api.Peer + public var oldReactions: [Api.Reaction] + public var newReactions: [Api.Reaction] + public var qts: Int32 + public init(peer: Api.Peer, msgId: Int32, date: Int32, actor: Api.Peer, oldReactions: [Api.Reaction], newReactions: [Api.Reaction], qts: Int32) { + self.peer = peer + self.msgId = msgId + self.date = date + self.actor = actor + self.oldReactions = oldReactions + self.newReactions = newReactions + self.qts = qts + } + } + public class Cons_updateBotMessageReactions { + public var peer: Api.Peer + public var msgId: Int32 + public var date: Int32 + public var reactions: [Api.ReactionCount] + public var qts: Int32 + public init(peer: Api.Peer, msgId: Int32, date: Int32, reactions: [Api.ReactionCount], qts: Int32) { + self.peer = peer + self.msgId = msgId + self.date = date + self.reactions = reactions + self.qts = qts + } + } + public class Cons_updateBotNewBusinessMessage { + public var flags: Int32 + public var connectionId: String + public var message: Api.Message + public var replyToMessage: Api.Message? + public var qts: Int32 + public init(flags: Int32, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, qts: Int32) { + self.flags = flags + self.connectionId = connectionId + self.message = message + self.replyToMessage = replyToMessage + self.qts = qts + } + } + public class Cons_updateBotPrecheckoutQuery { + public var flags: Int32 + public var queryId: Int64 + public var userId: Int64 + public var payload: Buffer + public var info: Api.PaymentRequestedInfo? + public var shippingOptionId: String? + public var currency: String + public var totalAmount: Int64 + public init(flags: Int32, queryId: Int64, userId: Int64, payload: Buffer, info: Api.PaymentRequestedInfo?, shippingOptionId: String?, currency: String, totalAmount: Int64) { + self.flags = flags + self.queryId = queryId + self.userId = userId + self.payload = payload + self.info = info + self.shippingOptionId = shippingOptionId + self.currency = currency + self.totalAmount = totalAmount + } + } + public class Cons_updateBotPurchasedPaidMedia { + public var userId: Int64 + public var payload: String + public var qts: Int32 + public init(userId: Int64, payload: String, qts: Int32) { + self.userId = userId + self.payload = payload + self.qts = qts + } + } + public class Cons_updateBotShippingQuery { + public var queryId: Int64 + public var userId: Int64 + public var payload: Buffer + public var shippingAddress: Api.PostAddress + public init(queryId: Int64, userId: Int64, payload: Buffer, shippingAddress: Api.PostAddress) { + self.queryId = queryId + self.userId = userId + self.payload = payload + self.shippingAddress = shippingAddress + } + } + public class Cons_updateBotStopped { + public var userId: Int64 + public var date: Int32 + public var stopped: Api.Bool + public var qts: Int32 + public init(userId: Int64, date: Int32, stopped: Api.Bool, qts: Int32) { + self.userId = userId + self.date = date + self.stopped = stopped + self.qts = qts + } + } + public class Cons_updateBotWebhookJSON { + public var data: Api.DataJSON + public init(data: Api.DataJSON) { + self.data = data + } + } + public class Cons_updateBotWebhookJSONQuery { + public var queryId: Int64 + public var data: Api.DataJSON + public var timeout: Int32 + public init(queryId: Int64, data: Api.DataJSON, timeout: Int32) { + self.queryId = queryId + self.data = data + self.timeout = timeout + } + } + public class Cons_updateBusinessBotCallbackQuery { + public var flags: Int32 + public var queryId: Int64 + public var userId: Int64 + public var connectionId: String + public var message: Api.Message + public var replyToMessage: Api.Message? + public var chatInstance: Int64 + public var data: Buffer? + public init(flags: Int32, queryId: Int64, userId: Int64, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, chatInstance: Int64, data: Buffer?) { + self.flags = flags + self.queryId = queryId + self.userId = userId + self.connectionId = connectionId + self.message = message + self.replyToMessage = replyToMessage + self.chatInstance = chatInstance + self.data = data + } + } + public class Cons_updateChannel { + public var channelId: Int64 + public init(channelId: Int64) { + self.channelId = channelId + } + } + public class Cons_updateChannelAvailableMessages { + public var channelId: Int64 + public var availableMinId: Int32 + public init(channelId: Int64, availableMinId: Int32) { + self.channelId = channelId + self.availableMinId = availableMinId + } + } + public class Cons_updateChannelMessageForwards { + public var channelId: Int64 + public var id: Int32 + public var forwards: Int32 + public init(channelId: Int64, id: Int32, forwards: Int32) { + self.channelId = channelId + self.id = id + self.forwards = forwards + } + } + public class Cons_updateChannelMessageViews { + public var channelId: Int64 + public var id: Int32 + public var views: Int32 + public init(channelId: Int64, id: Int32, views: Int32) { + self.channelId = channelId + self.id = id + self.views = views + } + } + public class Cons_updateChannelParticipant { + public var flags: Int32 + public var channelId: Int64 + public var date: Int32 + public var actorId: Int64 + public var userId: Int64 + public var prevParticipant: Api.ChannelParticipant? + public var newParticipant: Api.ChannelParticipant? + public var invite: Api.ExportedChatInvite? + public var qts: Int32 + public init(flags: Int32, channelId: Int64, date: Int32, actorId: Int64, userId: Int64, prevParticipant: Api.ChannelParticipant?, newParticipant: Api.ChannelParticipant?, invite: Api.ExportedChatInvite?, qts: Int32) { + self.flags = flags + self.channelId = channelId + self.date = date + self.actorId = actorId + self.userId = userId + self.prevParticipant = prevParticipant + self.newParticipant = newParticipant + self.invite = invite + self.qts = qts + } + } + public class Cons_updateChannelReadMessagesContents { + public var flags: Int32 + public var channelId: Int64 + public var topMsgId: Int32? + public var savedPeerId: Api.Peer? + public var messages: [Int32] + public init(flags: Int32, channelId: Int64, topMsgId: Int32?, savedPeerId: Api.Peer?, messages: [Int32]) { + self.flags = flags + self.channelId = channelId + self.topMsgId = topMsgId + self.savedPeerId = savedPeerId + self.messages = messages + } + } + public class Cons_updateChannelTooLong { + public var flags: Int32 + public var channelId: Int64 + public var pts: Int32? + public init(flags: Int32, channelId: Int64, pts: Int32?) { + self.flags = flags + self.channelId = channelId + self.pts = pts + } + } + public class Cons_updateChannelUserTyping { + public var flags: Int32 + public var channelId: Int64 + public var topMsgId: Int32? + public var fromId: Api.Peer + public var action: Api.SendMessageAction + public init(flags: Int32, channelId: Int64, topMsgId: Int32?, fromId: Api.Peer, action: Api.SendMessageAction) { + self.flags = flags + self.channelId = channelId + self.topMsgId = topMsgId + self.fromId = fromId + self.action = action + } + } + public class Cons_updateChannelViewForumAsMessages { + public var channelId: Int64 + public var enabled: Api.Bool + public init(channelId: Int64, enabled: Api.Bool) { + self.channelId = channelId + self.enabled = enabled + } + } + public class Cons_updateChannelWebPage { + public var channelId: Int64 + public var webpage: Api.WebPage + public var pts: Int32 + public var ptsCount: Int32 + public init(channelId: Int64, webpage: Api.WebPage, pts: Int32, ptsCount: Int32) { + self.channelId = channelId + self.webpage = webpage + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateChat { + public var chatId: Int64 + public init(chatId: Int64) { + self.chatId = chatId + } + } + public class Cons_updateChatDefaultBannedRights { + public var peer: Api.Peer + public var defaultBannedRights: Api.ChatBannedRights + public var version: Int32 + public init(peer: Api.Peer, defaultBannedRights: Api.ChatBannedRights, version: Int32) { + self.peer = peer + self.defaultBannedRights = defaultBannedRights + self.version = version + } + } + public class Cons_updateChatParticipant { + public var flags: Int32 + public var chatId: Int64 + public var date: Int32 + public var actorId: Int64 + public var userId: Int64 + public var prevParticipant: Api.ChatParticipant? + public var newParticipant: Api.ChatParticipant? + public var invite: Api.ExportedChatInvite? + public var qts: Int32 + public init(flags: Int32, chatId: Int64, date: Int32, actorId: Int64, userId: Int64, prevParticipant: Api.ChatParticipant?, newParticipant: Api.ChatParticipant?, invite: Api.ExportedChatInvite?, qts: Int32) { + self.flags = flags + self.chatId = chatId + self.date = date + self.actorId = actorId + self.userId = userId + self.prevParticipant = prevParticipant + self.newParticipant = newParticipant + self.invite = invite + self.qts = qts + } + } + public class Cons_updateChatParticipantAdd { + public var chatId: Int64 + public var userId: Int64 + public var inviterId: Int64 + public var date: Int32 + public var version: Int32 + public init(chatId: Int64, userId: Int64, inviterId: Int64, date: Int32, version: Int32) { + self.chatId = chatId + self.userId = userId + self.inviterId = inviterId + self.date = date + self.version = version + } + } + public class Cons_updateChatParticipantAdmin { + public var chatId: Int64 + public var userId: Int64 + public var isAdmin: Api.Bool + public var version: Int32 + public init(chatId: Int64, userId: Int64, isAdmin: Api.Bool, version: Int32) { + self.chatId = chatId + self.userId = userId + self.isAdmin = isAdmin + self.version = version + } + } + public class Cons_updateChatParticipantDelete { + public var chatId: Int64 + public var userId: Int64 + public var version: Int32 + public init(chatId: Int64, userId: Int64, version: Int32) { + self.chatId = chatId + self.userId = userId + self.version = version + } + } + public class Cons_updateChatParticipants { + public var participants: Api.ChatParticipants + public init(participants: Api.ChatParticipants) { + self.participants = participants + } + } + public class Cons_updateChatUserTyping { + public var chatId: Int64 + public var fromId: Api.Peer + public var action: Api.SendMessageAction + public init(chatId: Int64, fromId: Api.Peer, action: Api.SendMessageAction) { + self.chatId = chatId + self.fromId = fromId + self.action = action + } + } + public class Cons_updateDcOptions { + public var dcOptions: [Api.DcOption] + public init(dcOptions: [Api.DcOption]) { + self.dcOptions = dcOptions + } + } + public class Cons_updateDeleteChannelMessages { + public var channelId: Int64 + public var messages: [Int32] + public var pts: Int32 + public var ptsCount: Int32 + public init(channelId: Int64, messages: [Int32], pts: Int32, ptsCount: Int32) { + self.channelId = channelId + self.messages = messages + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateDeleteGroupCallMessages { + public var call: Api.InputGroupCall + public var messages: [Int32] + public init(call: Api.InputGroupCall, messages: [Int32]) { + self.call = call + self.messages = messages + } + } + public class Cons_updateDeleteMessages { + public var messages: [Int32] + public var pts: Int32 + public var ptsCount: Int32 + public init(messages: [Int32], pts: Int32, ptsCount: Int32) { + self.messages = messages + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateDeleteQuickReply { + public var shortcutId: Int32 + public init(shortcutId: Int32) { + self.shortcutId = shortcutId + } + } + public class Cons_updateDeleteQuickReplyMessages { + public var shortcutId: Int32 + public var messages: [Int32] + public init(shortcutId: Int32, messages: [Int32]) { + self.shortcutId = shortcutId + self.messages = messages + } + } + public class Cons_updateDeleteScheduledMessages { + public var flags: Int32 + public var peer: Api.Peer + public var messages: [Int32] + public var sentMessages: [Int32]? + public init(flags: Int32, peer: Api.Peer, messages: [Int32], sentMessages: [Int32]?) { + self.flags = flags + self.peer = peer + self.messages = messages + self.sentMessages = sentMessages + } + } + public class Cons_updateDialogFilter { + public var flags: Int32 + public var id: Int32 + public var filter: Api.DialogFilter? + public init(flags: Int32, id: Int32, filter: Api.DialogFilter?) { + self.flags = flags + self.id = id + self.filter = filter + } + } + public class Cons_updateDialogFilterOrder { + public var order: [Int32] + public init(order: [Int32]) { + self.order = order + } + } + public class Cons_updateDialogPinned { + public var flags: Int32 + public var folderId: Int32? + public var peer: Api.DialogPeer + public init(flags: Int32, folderId: Int32?, peer: Api.DialogPeer) { + self.flags = flags + self.folderId = folderId + self.peer = peer + } + } + public class Cons_updateDialogUnreadMark { + public var flags: Int32 + public var peer: Api.DialogPeer + public var savedPeerId: Api.Peer? + public init(flags: Int32, peer: Api.DialogPeer, savedPeerId: Api.Peer?) { + self.flags = flags + self.peer = peer + self.savedPeerId = savedPeerId + } + } + public class Cons_updateDraftMessage { + public var flags: Int32 + public var peer: Api.Peer + public var topMsgId: Int32? + public var savedPeerId: Api.Peer? + public var draft: Api.DraftMessage + public init(flags: Int32, peer: Api.Peer, topMsgId: Int32?, savedPeerId: Api.Peer?, draft: Api.DraftMessage) { + self.flags = flags + self.peer = peer + self.topMsgId = topMsgId + self.savedPeerId = savedPeerId + self.draft = draft + } + } + public class Cons_updateEditChannelMessage { + public var message: Api.Message + public var pts: Int32 + public var ptsCount: Int32 + public init(message: Api.Message, pts: Int32, ptsCount: Int32) { + self.message = message + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateEditMessage { + public var message: Api.Message + public var pts: Int32 + public var ptsCount: Int32 + public init(message: Api.Message, pts: Int32, ptsCount: Int32) { + self.message = message + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateEmojiGameInfo { + public var info: Api.messages.EmojiGameInfo + public init(info: Api.messages.EmojiGameInfo) { + self.info = info + } + } + public class Cons_updateEncryptedChatTyping { + public var chatId: Int32 + public init(chatId: Int32) { + self.chatId = chatId + } + } + public class Cons_updateEncryptedMessagesRead { + public var chatId: Int32 + public var maxDate: Int32 + public var date: Int32 + public init(chatId: Int32, maxDate: Int32, date: Int32) { + self.chatId = chatId + self.maxDate = maxDate + self.date = date + } + } + public class Cons_updateEncryption { + public var chat: Api.EncryptedChat + public var date: Int32 + public init(chat: Api.EncryptedChat, date: Int32) { + self.chat = chat + self.date = date + } + } + public class Cons_updateFolderPeers { + public var folderPeers: [Api.FolderPeer] + public var pts: Int32 + public var ptsCount: Int32 + public init(folderPeers: [Api.FolderPeer], pts: Int32, ptsCount: Int32) { + self.folderPeers = folderPeers + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateGeoLiveViewed { + public var peer: Api.Peer + public var msgId: Int32 + public init(peer: Api.Peer, msgId: Int32) { + self.peer = peer + self.msgId = msgId + } + } + public class Cons_updateGroupCall { + public var flags: Int32 + public var peer: Api.Peer? + public var call: Api.GroupCall + public init(flags: Int32, peer: Api.Peer?, call: Api.GroupCall) { + self.flags = flags + self.peer = peer + self.call = call + } + } + public class Cons_updateGroupCallChainBlocks { + public var call: Api.InputGroupCall + public var subChainId: Int32 + public var blocks: [Buffer] + public var nextOffset: Int32 + public init(call: Api.InputGroupCall, subChainId: Int32, blocks: [Buffer], nextOffset: Int32) { + self.call = call + self.subChainId = subChainId + self.blocks = blocks + self.nextOffset = nextOffset + } + } + public class Cons_updateGroupCallConnection { + public var flags: Int32 + public var params: Api.DataJSON + public init(flags: Int32, params: Api.DataJSON) { + self.flags = flags + self.params = params + } + } + public class Cons_updateGroupCallEncryptedMessage { + public var call: Api.InputGroupCall + public var fromId: Api.Peer + public var encryptedMessage: Buffer + public init(call: Api.InputGroupCall, fromId: Api.Peer, encryptedMessage: Buffer) { + self.call = call + self.fromId = fromId + self.encryptedMessage = encryptedMessage + } + } + public class Cons_updateGroupCallMessage { + public var call: Api.InputGroupCall + public var message: Api.GroupCallMessage + public init(call: Api.InputGroupCall, message: Api.GroupCallMessage) { + self.call = call + self.message = message + } + } + public class Cons_updateGroupCallParticipants { + public var call: Api.InputGroupCall + public var participants: [Api.GroupCallParticipant] + public var version: Int32 + public init(call: Api.InputGroupCall, participants: [Api.GroupCallParticipant], version: Int32) { + self.call = call + self.participants = participants + self.version = version + } + } + public class Cons_updateInlineBotCallbackQuery { + public var flags: Int32 + public var queryId: Int64 + public var userId: Int64 + public var msgId: Api.InputBotInlineMessageID + public var chatInstance: Int64 + public var data: Buffer? + public var gameShortName: String? + public init(flags: Int32, queryId: Int64, userId: Int64, msgId: Api.InputBotInlineMessageID, chatInstance: Int64, data: Buffer?, gameShortName: String?) { + self.flags = flags + self.queryId = queryId + self.userId = userId + self.msgId = msgId + self.chatInstance = chatInstance + self.data = data + self.gameShortName = gameShortName + } + } + public class Cons_updateLangPack { + public var difference: Api.LangPackDifference + public init(difference: Api.LangPackDifference) { + self.difference = difference + } + } + public class Cons_updateLangPackTooLong { + public var langCode: String + public init(langCode: String) { + self.langCode = langCode + } + } + public class Cons_updateMessageExtendedMedia { + public var peer: Api.Peer + public var msgId: Int32 + public var extendedMedia: [Api.MessageExtendedMedia] + public init(peer: Api.Peer, msgId: Int32, extendedMedia: [Api.MessageExtendedMedia]) { + self.peer = peer + self.msgId = msgId + self.extendedMedia = extendedMedia + } + } + public class Cons_updateMessageID { + public var id: Int32 + public var randomId: Int64 + public init(id: Int32, randomId: Int64) { + self.id = id + self.randomId = randomId + } + } + public class Cons_updateMessagePoll { + public var flags: Int32 + public var pollId: Int64 + public var poll: Api.Poll? + public var results: Api.PollResults + public init(flags: Int32, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) { + self.flags = flags + self.pollId = pollId + self.poll = poll + self.results = results + } + } + public class Cons_updateMessagePollVote { + public var pollId: Int64 + public var peer: Api.Peer + public var options: [Buffer] + public var qts: Int32 + public init(pollId: Int64, peer: Api.Peer, options: [Buffer], qts: Int32) { + self.pollId = pollId + self.peer = peer + self.options = options + self.qts = qts + } + } + public class Cons_updateMessageReactions { + public var flags: Int32 + public var peer: Api.Peer + public var msgId: Int32 + public var topMsgId: Int32? + public var savedPeerId: Api.Peer? + public var reactions: Api.MessageReactions + public init(flags: Int32, peer: Api.Peer, msgId: Int32, topMsgId: Int32?, savedPeerId: Api.Peer?, reactions: Api.MessageReactions) { + self.flags = flags + self.peer = peer + self.msgId = msgId + self.topMsgId = topMsgId + self.savedPeerId = savedPeerId + self.reactions = reactions + } + } + public class Cons_updateMonoForumNoPaidException { + public var flags: Int32 + public var channelId: Int64 + public var savedPeerId: Api.Peer + public init(flags: Int32, channelId: Int64, savedPeerId: Api.Peer) { + self.flags = flags + self.channelId = channelId + self.savedPeerId = savedPeerId + } + } + public class Cons_updateMoveStickerSetToTop { + public var flags: Int32 + public var stickerset: Int64 + public init(flags: Int32, stickerset: Int64) { + self.flags = flags + self.stickerset = stickerset + } + } + public class Cons_updateNewAuthorization { + public var flags: Int32 + public var hash: Int64 + public var date: Int32? + public var device: String? + public var location: String? + public init(flags: Int32, hash: Int64, date: Int32?, device: String?, location: String?) { + self.flags = flags + self.hash = hash + self.date = date + self.device = device + self.location = location + } + } + public class Cons_updateNewChannelMessage { + public var message: Api.Message + public var pts: Int32 + public var ptsCount: Int32 + public init(message: Api.Message, pts: Int32, ptsCount: Int32) { + self.message = message + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateNewEncryptedMessage { + public var message: Api.EncryptedMessage + public var qts: Int32 + public init(message: Api.EncryptedMessage, qts: Int32) { + self.message = message + self.qts = qts + } + } + public class Cons_updateNewMessage { + public var message: Api.Message + public var pts: Int32 + public var ptsCount: Int32 + public init(message: Api.Message, pts: Int32, ptsCount: Int32) { + self.message = message + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateNewQuickReply { + public var quickReply: Api.QuickReply + public init(quickReply: Api.QuickReply) { + self.quickReply = quickReply + } + } + public class Cons_updateNewScheduledMessage { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_updateNewStickerSet { + public var stickerset: Api.messages.StickerSet + public init(stickerset: Api.messages.StickerSet) { + self.stickerset = stickerset + } + } + public class Cons_updateNewStoryReaction { + public var storyId: Int32 + public var peer: Api.Peer + public var reaction: Api.Reaction + public init(storyId: Int32, peer: Api.Peer, reaction: Api.Reaction) { + self.storyId = storyId + self.peer = peer + self.reaction = reaction + } + } + public class Cons_updateNotifySettings { + public var peer: Api.NotifyPeer + public var notifySettings: Api.PeerNotifySettings + public init(peer: Api.NotifyPeer, notifySettings: Api.PeerNotifySettings) { + self.peer = peer + self.notifySettings = notifySettings + } + } + public class Cons_updatePaidReactionPrivacy { + public var `private`: Api.PaidReactionPrivacy + public init(`private`: Api.PaidReactionPrivacy) { + self.`private` = `private` + } + } + public class Cons_updatePeerBlocked { + public var flags: Int32 + public var peerId: Api.Peer + public init(flags: Int32, peerId: Api.Peer) { + self.flags = flags + self.peerId = peerId + } + } + public class Cons_updatePeerHistoryTTL { + public var flags: Int32 + public var peer: Api.Peer + public var ttlPeriod: Int32? + public init(flags: Int32, peer: Api.Peer, ttlPeriod: Int32?) { + self.flags = flags + self.peer = peer + self.ttlPeriod = ttlPeriod + } + } + public class Cons_updatePeerLocated { + public var peers: [Api.PeerLocated] + public init(peers: [Api.PeerLocated]) { + self.peers = peers + } + } + public class Cons_updatePeerSettings { + public var peer: Api.Peer + public var settings: Api.PeerSettings + public init(peer: Api.Peer, settings: Api.PeerSettings) { + self.peer = peer + self.settings = settings + } + } + public class Cons_updatePeerWallpaper { + public var flags: Int32 + public var peer: Api.Peer + public var wallpaper: Api.WallPaper? + public init(flags: Int32, peer: Api.Peer, wallpaper: Api.WallPaper?) { + self.flags = flags + self.peer = peer + self.wallpaper = wallpaper + } + } + public class Cons_updatePendingJoinRequests { + public var peer: Api.Peer + public var requestsPending: Int32 + public var recentRequesters: [Int64] + public init(peer: Api.Peer, requestsPending: Int32, recentRequesters: [Int64]) { + self.peer = peer + self.requestsPending = requestsPending + self.recentRequesters = recentRequesters + } + } + public class Cons_updatePhoneCall { + public var phoneCall: Api.PhoneCall + public init(phoneCall: Api.PhoneCall) { + self.phoneCall = phoneCall + } + } + public class Cons_updatePhoneCallSignalingData { + public var phoneCallId: Int64 + public var data: Buffer + public init(phoneCallId: Int64, data: Buffer) { + self.phoneCallId = phoneCallId + self.data = data + } + } + public class Cons_updatePinnedChannelMessages { + public var flags: Int32 + public var channelId: Int64 + public var messages: [Int32] + public var pts: Int32 + public var ptsCount: Int32 + public init(flags: Int32, channelId: Int64, messages: [Int32], pts: Int32, ptsCount: Int32) { + self.flags = flags + self.channelId = channelId + self.messages = messages + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updatePinnedDialogs { + public var flags: Int32 + public var folderId: Int32? + public var order: [Api.DialogPeer]? + public init(flags: Int32, folderId: Int32?, order: [Api.DialogPeer]?) { + self.flags = flags + self.folderId = folderId + self.order = order + } + } + public class Cons_updatePinnedForumTopic { + public var flags: Int32 + public var peer: Api.Peer + public var topicId: Int32 + public init(flags: Int32, peer: Api.Peer, topicId: Int32) { + self.flags = flags + self.peer = peer + self.topicId = topicId + } + } + public class Cons_updatePinnedForumTopics { + public var flags: Int32 + public var peer: Api.Peer + public var order: [Int32]? + public init(flags: Int32, peer: Api.Peer, order: [Int32]?) { + self.flags = flags + self.peer = peer + self.order = order + } + } + public class Cons_updatePinnedMessages { + public var flags: Int32 + public var peer: Api.Peer + public var messages: [Int32] + public var pts: Int32 + public var ptsCount: Int32 + public init(flags: Int32, peer: Api.Peer, messages: [Int32], pts: Int32, ptsCount: Int32) { + self.flags = flags + self.peer = peer + self.messages = messages + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updatePinnedSavedDialogs { + public var flags: Int32 + public var order: [Api.DialogPeer]? + public init(flags: Int32, order: [Api.DialogPeer]?) { + self.flags = flags + self.order = order + } + } + public class Cons_updatePrivacy { + public var key: Api.PrivacyKey + public var rules: [Api.PrivacyRule] + public init(key: Api.PrivacyKey, rules: [Api.PrivacyRule]) { + self.key = key + self.rules = rules + } + } + public class Cons_updateQuickReplies { + public var quickReplies: [Api.QuickReply] + public init(quickReplies: [Api.QuickReply]) { + self.quickReplies = quickReplies + } + } + public class Cons_updateQuickReplyMessage { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_updateReadChannelDiscussionInbox { + public var flags: Int32 + public var channelId: Int64 + public var topMsgId: Int32 + public var readMaxId: Int32 + public var broadcastId: Int64? + public var broadcastPost: Int32? + public init(flags: Int32, channelId: Int64, topMsgId: Int32, readMaxId: Int32, broadcastId: Int64?, broadcastPost: Int32?) { + self.flags = flags + self.channelId = channelId + self.topMsgId = topMsgId + self.readMaxId = readMaxId + self.broadcastId = broadcastId + self.broadcastPost = broadcastPost + } + } + public class Cons_updateReadChannelDiscussionOutbox { + public var channelId: Int64 + public var topMsgId: Int32 + public var readMaxId: Int32 + public init(channelId: Int64, topMsgId: Int32, readMaxId: Int32) { + self.channelId = channelId + self.topMsgId = topMsgId + self.readMaxId = readMaxId + } + } + public class Cons_updateReadChannelInbox { + public var flags: Int32 + public var folderId: Int32? + public var channelId: Int64 + public var maxId: Int32 + public var stillUnreadCount: Int32 + public var pts: Int32 + public init(flags: Int32, folderId: Int32?, channelId: Int64, maxId: Int32, stillUnreadCount: Int32, pts: Int32) { + self.flags = flags + self.folderId = folderId + self.channelId = channelId + self.maxId = maxId + self.stillUnreadCount = stillUnreadCount + self.pts = pts + } + } + public class Cons_updateReadChannelOutbox { + public var channelId: Int64 + public var maxId: Int32 + public init(channelId: Int64, maxId: Int32) { + self.channelId = channelId + self.maxId = maxId + } + } + public class Cons_updateReadHistoryInbox { + public var flags: Int32 + public var folderId: Int32? + public var peer: Api.Peer + public var topMsgId: Int32? + public var maxId: Int32 + public var stillUnreadCount: Int32 + public var pts: Int32 + public var ptsCount: Int32 + public init(flags: Int32, folderId: Int32?, peer: Api.Peer, topMsgId: Int32?, maxId: Int32, stillUnreadCount: Int32, pts: Int32, ptsCount: Int32) { + self.flags = flags + self.folderId = folderId + self.peer = peer + self.topMsgId = topMsgId + self.maxId = maxId + self.stillUnreadCount = stillUnreadCount + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateReadHistoryOutbox { + public var peer: Api.Peer + public var maxId: Int32 + public var pts: Int32 + public var ptsCount: Int32 + public init(peer: Api.Peer, maxId: Int32, pts: Int32, ptsCount: Int32) { + self.peer = peer + self.maxId = maxId + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateReadMessagesContents { + public var flags: Int32 + public var messages: [Int32] + public var pts: Int32 + public var ptsCount: Int32 + public var date: Int32? + public init(flags: Int32, messages: [Int32], pts: Int32, ptsCount: Int32, date: Int32?) { + self.flags = flags + self.messages = messages + self.pts = pts + self.ptsCount = ptsCount + self.date = date + } + } + public class Cons_updateReadMonoForumInbox { + public var channelId: Int64 + public var savedPeerId: Api.Peer + public var readMaxId: Int32 + public init(channelId: Int64, savedPeerId: Api.Peer, readMaxId: Int32) { + self.channelId = channelId + self.savedPeerId = savedPeerId + self.readMaxId = readMaxId + } + } + public class Cons_updateReadMonoForumOutbox { + public var channelId: Int64 + public var savedPeerId: Api.Peer + public var readMaxId: Int32 + public init(channelId: Int64, savedPeerId: Api.Peer, readMaxId: Int32) { + self.channelId = channelId + self.savedPeerId = savedPeerId + self.readMaxId = readMaxId + } + } + public class Cons_updateReadStories { + public var peer: Api.Peer + public var maxId: Int32 + public init(peer: Api.Peer, maxId: Int32) { + self.peer = peer + self.maxId = maxId + } + } + public class Cons_updateSavedDialogPinned { + public var flags: Int32 + public var peer: Api.DialogPeer + public init(flags: Int32, peer: Api.DialogPeer) { + self.flags = flags + self.peer = peer + } + } + public class Cons_updateSentPhoneCode { + public var sentCode: Api.auth.SentCode + public init(sentCode: Api.auth.SentCode) { + self.sentCode = sentCode + } + } + public class Cons_updateSentStoryReaction { + public var peer: Api.Peer + public var storyId: Int32 + public var reaction: Api.Reaction + public init(peer: Api.Peer, storyId: Int32, reaction: Api.Reaction) { + self.peer = peer + self.storyId = storyId + self.reaction = reaction + } + } + public class Cons_updateServiceNotification { + public var flags: Int32 + public var inboxDate: Int32? + public var type: String + public var message: String + public var media: Api.MessageMedia + public var entities: [Api.MessageEntity] + public init(flags: Int32, inboxDate: Int32?, type: String, message: String, media: Api.MessageMedia, entities: [Api.MessageEntity]) { + self.flags = flags + self.inboxDate = inboxDate + self.type = type + self.message = message + self.media = media + self.entities = entities + } + } + public class Cons_updateSmsJob { + public var jobId: String + public init(jobId: String) { + self.jobId = jobId + } + } + public class Cons_updateStarGiftAuctionState { + public var giftId: Int64 + public var state: Api.StarGiftAuctionState + public init(giftId: Int64, state: Api.StarGiftAuctionState) { + self.giftId = giftId + self.state = state + } + } + public class Cons_updateStarGiftAuctionUserState { + public var giftId: Int64 + public var userState: Api.StarGiftAuctionUserState + public init(giftId: Int64, userState: Api.StarGiftAuctionUserState) { + self.giftId = giftId + self.userState = userState + } + } + public class Cons_updateStarsBalance { + public var balance: Api.StarsAmount + public init(balance: Api.StarsAmount) { + self.balance = balance + } + } + public class Cons_updateStarsRevenueStatus { + public var peer: Api.Peer + public var status: Api.StarsRevenueStatus + public init(peer: Api.Peer, status: Api.StarsRevenueStatus) { + self.peer = peer + self.status = status + } + } + public class Cons_updateStickerSets { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_updateStickerSetsOrder { + public var flags: Int32 + public var order: [Int64] + public init(flags: Int32, order: [Int64]) { + self.flags = flags + self.order = order + } + } + public class Cons_updateStoriesStealthMode { + public var stealthMode: Api.StoriesStealthMode + public init(stealthMode: Api.StoriesStealthMode) { + self.stealthMode = stealthMode + } + } + public class Cons_updateStory { + public var peer: Api.Peer + public var story: Api.StoryItem + public init(peer: Api.Peer, story: Api.StoryItem) { + self.peer = peer + self.story = story + } + } + public class Cons_updateStoryID { + public var id: Int32 + public var randomId: Int64 + public init(id: Int32, randomId: Int64) { + self.id = id + self.randomId = randomId + } + } + public class Cons_updateTheme { + public var theme: Api.Theme + public init(theme: Api.Theme) { + self.theme = theme + } + } + public class Cons_updateTranscribedAudio { + public var flags: Int32 + public var peer: Api.Peer + public var msgId: Int32 + public var transcriptionId: Int64 + public var text: String + public init(flags: Int32, peer: Api.Peer, msgId: Int32, transcriptionId: Int64, text: String) { + self.flags = flags + self.peer = peer + self.msgId = msgId + self.transcriptionId = transcriptionId + self.text = text + } + } + public class Cons_updateUser { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + } + public class Cons_updateUserEmojiStatus { + public var userId: Int64 + public var emojiStatus: Api.EmojiStatus + public init(userId: Int64, emojiStatus: Api.EmojiStatus) { + self.userId = userId + self.emojiStatus = emojiStatus + } + } + public class Cons_updateUserName { + public var userId: Int64 + public var firstName: String + public var lastName: String + public var usernames: [Api.Username] + public init(userId: Int64, firstName: String, lastName: String, usernames: [Api.Username]) { + self.userId = userId + self.firstName = firstName + self.lastName = lastName + self.usernames = usernames + } + } + public class Cons_updateUserPhone { + public var userId: Int64 + public var phone: String + public init(userId: Int64, phone: String) { + self.userId = userId + self.phone = phone + } + } + public class Cons_updateUserStatus { + public var userId: Int64 + public var status: Api.UserStatus + public init(userId: Int64, status: Api.UserStatus) { + self.userId = userId + self.status = status + } + } + public class Cons_updateUserTyping { + public var flags: Int32 + public var userId: Int64 + public var topMsgId: Int32? + public var action: Api.SendMessageAction + public init(flags: Int32, userId: Int64, topMsgId: Int32?, action: Api.SendMessageAction) { + self.flags = flags + self.userId = userId + self.topMsgId = topMsgId + self.action = action + } + } + public class Cons_updateWebPage { + public var webpage: Api.WebPage + public var pts: Int32 + public var ptsCount: Int32 + public init(webpage: Api.WebPage, pts: Int32, ptsCount: Int32) { + self.webpage = webpage + self.pts = pts + self.ptsCount = ptsCount + } + } + public class Cons_updateWebViewResultSent { + public var queryId: Int64 + public init(queryId: Int64) { + self.queryId = queryId + } + } case updateAttachMenuBots case updateAutoSaveSettings - case updateBotBusinessConnect(connection: Api.BotBusinessConnection, qts: Int32) - case updateBotCallbackQuery(flags: Int32, queryId: Int64, userId: Int64, peer: Api.Peer, msgId: Int32, chatInstance: Int64, data: Buffer?, gameShortName: String?) - case updateBotChatBoost(peer: Api.Peer, boost: Api.Boost, qts: Int32) - case updateBotChatInviteRequester(peer: Api.Peer, date: Int32, userId: Int64, about: String, invite: Api.ExportedChatInvite, qts: Int32) - case updateBotCommands(peer: Api.Peer, botId: Int64, commands: [Api.BotCommand]) - case updateBotDeleteBusinessMessage(connectionId: String, peer: Api.Peer, messages: [Int32], qts: Int32) - case updateBotEditBusinessMessage(flags: Int32, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, qts: Int32) - case updateBotInlineQuery(flags: Int32, queryId: Int64, userId: Int64, query: String, geo: Api.GeoPoint?, peerType: Api.InlineQueryPeerType?, offset: String) - case updateBotInlineSend(flags: Int32, userId: Int64, query: String, geo: Api.GeoPoint?, id: String, msgId: Api.InputBotInlineMessageID?) - case updateBotMenuButton(botId: Int64, button: Api.BotMenuButton) - case updateBotMessageReaction(peer: Api.Peer, msgId: Int32, date: Int32, actor: Api.Peer, oldReactions: [Api.Reaction], newReactions: [Api.Reaction], qts: Int32) - case updateBotMessageReactions(peer: Api.Peer, msgId: Int32, date: Int32, reactions: [Api.ReactionCount], qts: Int32) - case updateBotNewBusinessMessage(flags: Int32, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, qts: Int32) - case updateBotPrecheckoutQuery(flags: Int32, queryId: Int64, userId: Int64, payload: Buffer, info: Api.PaymentRequestedInfo?, shippingOptionId: String?, currency: String, totalAmount: Int64) - case updateBotPurchasedPaidMedia(userId: Int64, payload: String, qts: Int32) - case updateBotShippingQuery(queryId: Int64, userId: Int64, payload: Buffer, shippingAddress: Api.PostAddress) - case updateBotStopped(userId: Int64, date: Int32, stopped: Api.Bool, qts: Int32) - case updateBotWebhookJSON(data: Api.DataJSON) - case updateBotWebhookJSONQuery(queryId: Int64, data: Api.DataJSON, timeout: Int32) - case updateBusinessBotCallbackQuery(flags: Int32, queryId: Int64, userId: Int64, connectionId: String, message: Api.Message, replyToMessage: Api.Message?, chatInstance: Int64, data: Buffer?) - case updateChannel(channelId: Int64) - case updateChannelAvailableMessages(channelId: Int64, availableMinId: Int32) - case updateChannelMessageForwards(channelId: Int64, id: Int32, forwards: Int32) - case updateChannelMessageViews(channelId: Int64, id: Int32, views: Int32) - case updateChannelParticipant(flags: Int32, channelId: Int64, date: Int32, actorId: Int64, userId: Int64, prevParticipant: Api.ChannelParticipant?, newParticipant: Api.ChannelParticipant?, invite: Api.ExportedChatInvite?, qts: Int32) - case updateChannelReadMessagesContents(flags: Int32, channelId: Int64, topMsgId: Int32?, savedPeerId: Api.Peer?, messages: [Int32]) - case updateChannelTooLong(flags: Int32, channelId: Int64, pts: Int32?) - case updateChannelUserTyping(flags: Int32, channelId: Int64, topMsgId: Int32?, fromId: Api.Peer, action: Api.SendMessageAction) - case updateChannelViewForumAsMessages(channelId: Int64, enabled: Api.Bool) - case updateChannelWebPage(channelId: Int64, webpage: Api.WebPage, pts: Int32, ptsCount: Int32) - case updateChat(chatId: Int64) - case updateChatDefaultBannedRights(peer: Api.Peer, defaultBannedRights: Api.ChatBannedRights, version: Int32) - case updateChatParticipant(flags: Int32, chatId: Int64, date: Int32, actorId: Int64, userId: Int64, prevParticipant: Api.ChatParticipant?, newParticipant: Api.ChatParticipant?, invite: Api.ExportedChatInvite?, qts: Int32) - case updateChatParticipantAdd(chatId: Int64, userId: Int64, inviterId: Int64, date: Int32, version: Int32) - case updateChatParticipantAdmin(chatId: Int64, userId: Int64, isAdmin: Api.Bool, version: Int32) - case updateChatParticipantDelete(chatId: Int64, userId: Int64, version: Int32) - case updateChatParticipants(participants: Api.ChatParticipants) - case updateChatUserTyping(chatId: Int64, fromId: Api.Peer, action: Api.SendMessageAction) + case updateBotBusinessConnect(Cons_updateBotBusinessConnect) + case updateBotCallbackQuery(Cons_updateBotCallbackQuery) + case updateBotChatBoost(Cons_updateBotChatBoost) + case updateBotChatInviteRequester(Cons_updateBotChatInviteRequester) + case updateBotCommands(Cons_updateBotCommands) + case updateBotDeleteBusinessMessage(Cons_updateBotDeleteBusinessMessage) + case updateBotEditBusinessMessage(Cons_updateBotEditBusinessMessage) + case updateBotInlineQuery(Cons_updateBotInlineQuery) + case updateBotInlineSend(Cons_updateBotInlineSend) + case updateBotMenuButton(Cons_updateBotMenuButton) + case updateBotMessageReaction(Cons_updateBotMessageReaction) + case updateBotMessageReactions(Cons_updateBotMessageReactions) + case updateBotNewBusinessMessage(Cons_updateBotNewBusinessMessage) + case updateBotPrecheckoutQuery(Cons_updateBotPrecheckoutQuery) + case updateBotPurchasedPaidMedia(Cons_updateBotPurchasedPaidMedia) + case updateBotShippingQuery(Cons_updateBotShippingQuery) + case updateBotStopped(Cons_updateBotStopped) + case updateBotWebhookJSON(Cons_updateBotWebhookJSON) + case updateBotWebhookJSONQuery(Cons_updateBotWebhookJSONQuery) + case updateBusinessBotCallbackQuery(Cons_updateBusinessBotCallbackQuery) + case updateChannel(Cons_updateChannel) + case updateChannelAvailableMessages(Cons_updateChannelAvailableMessages) + case updateChannelMessageForwards(Cons_updateChannelMessageForwards) + case updateChannelMessageViews(Cons_updateChannelMessageViews) + case updateChannelParticipant(Cons_updateChannelParticipant) + case updateChannelReadMessagesContents(Cons_updateChannelReadMessagesContents) + case updateChannelTooLong(Cons_updateChannelTooLong) + case updateChannelUserTyping(Cons_updateChannelUserTyping) + case updateChannelViewForumAsMessages(Cons_updateChannelViewForumAsMessages) + case updateChannelWebPage(Cons_updateChannelWebPage) + case updateChat(Cons_updateChat) + case updateChatDefaultBannedRights(Cons_updateChatDefaultBannedRights) + case updateChatParticipant(Cons_updateChatParticipant) + case updateChatParticipantAdd(Cons_updateChatParticipantAdd) + case updateChatParticipantAdmin(Cons_updateChatParticipantAdmin) + case updateChatParticipantDelete(Cons_updateChatParticipantDelete) + case updateChatParticipants(Cons_updateChatParticipants) + case updateChatUserTyping(Cons_updateChatUserTyping) case updateConfig case updateContactsReset - case updateDcOptions(dcOptions: [Api.DcOption]) - case updateDeleteChannelMessages(channelId: Int64, messages: [Int32], pts: Int32, ptsCount: Int32) - case updateDeleteGroupCallMessages(call: Api.InputGroupCall, messages: [Int32]) - case updateDeleteMessages(messages: [Int32], pts: Int32, ptsCount: Int32) - case updateDeleteQuickReply(shortcutId: Int32) - case updateDeleteQuickReplyMessages(shortcutId: Int32, messages: [Int32]) - case updateDeleteScheduledMessages(flags: Int32, peer: Api.Peer, messages: [Int32], sentMessages: [Int32]?) - case updateDialogFilter(flags: Int32, id: Int32, filter: Api.DialogFilter?) - case updateDialogFilterOrder(order: [Int32]) + case updateDcOptions(Cons_updateDcOptions) + case updateDeleteChannelMessages(Cons_updateDeleteChannelMessages) + case updateDeleteGroupCallMessages(Cons_updateDeleteGroupCallMessages) + case updateDeleteMessages(Cons_updateDeleteMessages) + case updateDeleteQuickReply(Cons_updateDeleteQuickReply) + case updateDeleteQuickReplyMessages(Cons_updateDeleteQuickReplyMessages) + case updateDeleteScheduledMessages(Cons_updateDeleteScheduledMessages) + case updateDialogFilter(Cons_updateDialogFilter) + case updateDialogFilterOrder(Cons_updateDialogFilterOrder) case updateDialogFilters - case updateDialogPinned(flags: Int32, folderId: Int32?, peer: Api.DialogPeer) - case updateDialogUnreadMark(flags: Int32, peer: Api.DialogPeer, savedPeerId: Api.Peer?) - case updateDraftMessage(flags: Int32, peer: Api.Peer, topMsgId: Int32?, savedPeerId: Api.Peer?, draft: Api.DraftMessage) - case updateEditChannelMessage(message: Api.Message, pts: Int32, ptsCount: Int32) - case updateEditMessage(message: Api.Message, pts: Int32, ptsCount: Int32) - case updateEmojiGameInfo(info: Api.messages.EmojiGameInfo) - case updateEncryptedChatTyping(chatId: Int32) - case updateEncryptedMessagesRead(chatId: Int32, maxDate: Int32, date: Int32) - case updateEncryption(chat: Api.EncryptedChat, date: Int32) + case updateDialogPinned(Cons_updateDialogPinned) + case updateDialogUnreadMark(Cons_updateDialogUnreadMark) + case updateDraftMessage(Cons_updateDraftMessage) + case updateEditChannelMessage(Cons_updateEditChannelMessage) + case updateEditMessage(Cons_updateEditMessage) + case updateEmojiGameInfo(Cons_updateEmojiGameInfo) + case updateEncryptedChatTyping(Cons_updateEncryptedChatTyping) + case updateEncryptedMessagesRead(Cons_updateEncryptedMessagesRead) + case updateEncryption(Cons_updateEncryption) case updateFavedStickers - case updateFolderPeers(folderPeers: [Api.FolderPeer], pts: Int32, ptsCount: Int32) - case updateGeoLiveViewed(peer: Api.Peer, msgId: Int32) - case updateGroupCall(flags: Int32, peer: Api.Peer?, call: Api.GroupCall) - case updateGroupCallChainBlocks(call: Api.InputGroupCall, subChainId: Int32, blocks: [Buffer], nextOffset: Int32) - case updateGroupCallConnection(flags: Int32, params: Api.DataJSON) - case updateGroupCallEncryptedMessage(call: Api.InputGroupCall, fromId: Api.Peer, encryptedMessage: Buffer) - case updateGroupCallMessage(call: Api.InputGroupCall, message: Api.GroupCallMessage) - case updateGroupCallParticipants(call: Api.InputGroupCall, participants: [Api.GroupCallParticipant], version: Int32) - case updateInlineBotCallbackQuery(flags: Int32, queryId: Int64, userId: Int64, msgId: Api.InputBotInlineMessageID, chatInstance: Int64, data: Buffer?, gameShortName: String?) - case updateLangPack(difference: Api.LangPackDifference) - case updateLangPackTooLong(langCode: String) + case updateFolderPeers(Cons_updateFolderPeers) + case updateGeoLiveViewed(Cons_updateGeoLiveViewed) + case updateGroupCall(Cons_updateGroupCall) + case updateGroupCallChainBlocks(Cons_updateGroupCallChainBlocks) + case updateGroupCallConnection(Cons_updateGroupCallConnection) + case updateGroupCallEncryptedMessage(Cons_updateGroupCallEncryptedMessage) + case updateGroupCallMessage(Cons_updateGroupCallMessage) + case updateGroupCallParticipants(Cons_updateGroupCallParticipants) + case updateInlineBotCallbackQuery(Cons_updateInlineBotCallbackQuery) + case updateLangPack(Cons_updateLangPack) + case updateLangPackTooLong(Cons_updateLangPackTooLong) case updateLoginToken - case updateMessageExtendedMedia(peer: Api.Peer, msgId: Int32, extendedMedia: [Api.MessageExtendedMedia]) - case updateMessageID(id: Int32, randomId: Int64) - case updateMessagePoll(flags: Int32, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) - case updateMessagePollVote(pollId: Int64, peer: Api.Peer, options: [Buffer], qts: Int32) - case updateMessageReactions(flags: Int32, peer: Api.Peer, msgId: Int32, topMsgId: Int32?, savedPeerId: Api.Peer?, reactions: Api.MessageReactions) - case updateMonoForumNoPaidException(flags: Int32, channelId: Int64, savedPeerId: Api.Peer) - case updateMoveStickerSetToTop(flags: Int32, stickerset: Int64) - case updateNewAuthorization(flags: Int32, hash: Int64, date: Int32?, device: String?, location: String?) - case updateNewChannelMessage(message: Api.Message, pts: Int32, ptsCount: Int32) - case updateNewEncryptedMessage(message: Api.EncryptedMessage, qts: Int32) - case updateNewMessage(message: Api.Message, pts: Int32, ptsCount: Int32) - case updateNewQuickReply(quickReply: Api.QuickReply) - case updateNewScheduledMessage(message: Api.Message) - case updateNewStickerSet(stickerset: Api.messages.StickerSet) - case updateNewStoryReaction(storyId: Int32, peer: Api.Peer, reaction: Api.Reaction) - case updateNotifySettings(peer: Api.NotifyPeer, notifySettings: Api.PeerNotifySettings) - case updatePaidReactionPrivacy(private: Api.PaidReactionPrivacy) - case updatePeerBlocked(flags: Int32, peerId: Api.Peer) - case updatePeerHistoryTTL(flags: Int32, peer: Api.Peer, ttlPeriod: Int32?) - case updatePeerLocated(peers: [Api.PeerLocated]) - case updatePeerSettings(peer: Api.Peer, settings: Api.PeerSettings) - case updatePeerWallpaper(flags: Int32, peer: Api.Peer, wallpaper: Api.WallPaper?) - case updatePendingJoinRequests(peer: Api.Peer, requestsPending: Int32, recentRequesters: [Int64]) - case updatePhoneCall(phoneCall: Api.PhoneCall) - case updatePhoneCallSignalingData(phoneCallId: Int64, data: Buffer) - case updatePinnedChannelMessages(flags: Int32, channelId: Int64, messages: [Int32], pts: Int32, ptsCount: Int32) - case updatePinnedDialogs(flags: Int32, folderId: Int32?, order: [Api.DialogPeer]?) - case updatePinnedForumTopic(flags: Int32, peer: Api.Peer, topicId: Int32) - case updatePinnedForumTopics(flags: Int32, peer: Api.Peer, order: [Int32]?) - case updatePinnedMessages(flags: Int32, peer: Api.Peer, messages: [Int32], pts: Int32, ptsCount: Int32) - case updatePinnedSavedDialogs(flags: Int32, order: [Api.DialogPeer]?) - case updatePrivacy(key: Api.PrivacyKey, rules: [Api.PrivacyRule]) + case updateMessageExtendedMedia(Cons_updateMessageExtendedMedia) + case updateMessageID(Cons_updateMessageID) + case updateMessagePoll(Cons_updateMessagePoll) + case updateMessagePollVote(Cons_updateMessagePollVote) + case updateMessageReactions(Cons_updateMessageReactions) + case updateMonoForumNoPaidException(Cons_updateMonoForumNoPaidException) + case updateMoveStickerSetToTop(Cons_updateMoveStickerSetToTop) + case updateNewAuthorization(Cons_updateNewAuthorization) + case updateNewChannelMessage(Cons_updateNewChannelMessage) + case updateNewEncryptedMessage(Cons_updateNewEncryptedMessage) + case updateNewMessage(Cons_updateNewMessage) + case updateNewQuickReply(Cons_updateNewQuickReply) + case updateNewScheduledMessage(Cons_updateNewScheduledMessage) + case updateNewStickerSet(Cons_updateNewStickerSet) + case updateNewStoryReaction(Cons_updateNewStoryReaction) + case updateNotifySettings(Cons_updateNotifySettings) + case updatePaidReactionPrivacy(Cons_updatePaidReactionPrivacy) + case updatePeerBlocked(Cons_updatePeerBlocked) + case updatePeerHistoryTTL(Cons_updatePeerHistoryTTL) + case updatePeerLocated(Cons_updatePeerLocated) + case updatePeerSettings(Cons_updatePeerSettings) + case updatePeerWallpaper(Cons_updatePeerWallpaper) + case updatePendingJoinRequests(Cons_updatePendingJoinRequests) + case updatePhoneCall(Cons_updatePhoneCall) + case updatePhoneCallSignalingData(Cons_updatePhoneCallSignalingData) + case updatePinnedChannelMessages(Cons_updatePinnedChannelMessages) + case updatePinnedDialogs(Cons_updatePinnedDialogs) + case updatePinnedForumTopic(Cons_updatePinnedForumTopic) + case updatePinnedForumTopics(Cons_updatePinnedForumTopics) + case updatePinnedMessages(Cons_updatePinnedMessages) + case updatePinnedSavedDialogs(Cons_updatePinnedSavedDialogs) + case updatePrivacy(Cons_updatePrivacy) case updatePtsChanged - case updateQuickReplies(quickReplies: [Api.QuickReply]) - case updateQuickReplyMessage(message: Api.Message) - case updateReadChannelDiscussionInbox(flags: Int32, channelId: Int64, topMsgId: Int32, readMaxId: Int32, broadcastId: Int64?, broadcastPost: Int32?) - case updateReadChannelDiscussionOutbox(channelId: Int64, topMsgId: Int32, readMaxId: Int32) - case updateReadChannelInbox(flags: Int32, folderId: Int32?, channelId: Int64, maxId: Int32, stillUnreadCount: Int32, pts: Int32) - case updateReadChannelOutbox(channelId: Int64, maxId: Int32) + case updateQuickReplies(Cons_updateQuickReplies) + case updateQuickReplyMessage(Cons_updateQuickReplyMessage) + case updateReadChannelDiscussionInbox(Cons_updateReadChannelDiscussionInbox) + case updateReadChannelDiscussionOutbox(Cons_updateReadChannelDiscussionOutbox) + case updateReadChannelInbox(Cons_updateReadChannelInbox) + case updateReadChannelOutbox(Cons_updateReadChannelOutbox) case updateReadFeaturedEmojiStickers case updateReadFeaturedStickers - case updateReadHistoryInbox(flags: Int32, folderId: Int32?, peer: Api.Peer, topMsgId: Int32?, maxId: Int32, stillUnreadCount: Int32, pts: Int32, ptsCount: Int32) - case updateReadHistoryOutbox(peer: Api.Peer, maxId: Int32, pts: Int32, ptsCount: Int32) - case updateReadMessagesContents(flags: Int32, messages: [Int32], pts: Int32, ptsCount: Int32, date: Int32?) - case updateReadMonoForumInbox(channelId: Int64, savedPeerId: Api.Peer, readMaxId: Int32) - case updateReadMonoForumOutbox(channelId: Int64, savedPeerId: Api.Peer, readMaxId: Int32) - case updateReadStories(peer: Api.Peer, maxId: Int32) + case updateReadHistoryInbox(Cons_updateReadHistoryInbox) + case updateReadHistoryOutbox(Cons_updateReadHistoryOutbox) + case updateReadMessagesContents(Cons_updateReadMessagesContents) + case updateReadMonoForumInbox(Cons_updateReadMonoForumInbox) + case updateReadMonoForumOutbox(Cons_updateReadMonoForumOutbox) + case updateReadStories(Cons_updateReadStories) case updateRecentEmojiStatuses case updateRecentReactions case updateRecentStickers - case updateSavedDialogPinned(flags: Int32, peer: Api.DialogPeer) + case updateSavedDialogPinned(Cons_updateSavedDialogPinned) case updateSavedGifs case updateSavedReactionTags case updateSavedRingtones - case updateSentPhoneCode(sentCode: Api.auth.SentCode) - case updateSentStoryReaction(peer: Api.Peer, storyId: Int32, reaction: Api.Reaction) - case updateServiceNotification(flags: Int32, inboxDate: Int32?, type: String, message: String, media: Api.MessageMedia, entities: [Api.MessageEntity]) - case updateSmsJob(jobId: String) - case updateStarGiftAuctionState(giftId: Int64, state: Api.StarGiftAuctionState) - case updateStarGiftAuctionUserState(giftId: Int64, userState: Api.StarGiftAuctionUserState) + case updateSentPhoneCode(Cons_updateSentPhoneCode) + case updateSentStoryReaction(Cons_updateSentStoryReaction) + case updateServiceNotification(Cons_updateServiceNotification) + case updateSmsJob(Cons_updateSmsJob) + case updateStarGiftAuctionState(Cons_updateStarGiftAuctionState) + case updateStarGiftAuctionUserState(Cons_updateStarGiftAuctionUserState) case updateStarGiftCraftFail - case updateStarsBalance(balance: Api.StarsAmount) - case updateStarsRevenueStatus(peer: Api.Peer, status: Api.StarsRevenueStatus) - case updateStickerSets(flags: Int32) - case updateStickerSetsOrder(flags: Int32, order: [Int64]) - case updateStoriesStealthMode(stealthMode: Api.StoriesStealthMode) - case updateStory(peer: Api.Peer, story: Api.StoryItem) - case updateStoryID(id: Int32, randomId: Int64) - case updateTheme(theme: Api.Theme) - case updateTranscribedAudio(flags: Int32, peer: Api.Peer, msgId: Int32, transcriptionId: Int64, text: String) - case updateUser(userId: Int64) - case updateUserEmojiStatus(userId: Int64, emojiStatus: Api.EmojiStatus) - case updateUserName(userId: Int64, firstName: String, lastName: String, usernames: [Api.Username]) - case updateUserPhone(userId: Int64, phone: String) - case updateUserStatus(userId: Int64, status: Api.UserStatus) - case updateUserTyping(flags: Int32, userId: Int64, topMsgId: Int32?, action: Api.SendMessageAction) - case updateWebPage(webpage: Api.WebPage, pts: Int32, ptsCount: Int32) - case updateWebViewResultSent(queryId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .updateAttachMenuBots: - if boxed { - buffer.appendInt32(397910539) - } - - break - case .updateAutoSaveSettings: - if boxed { - buffer.appendInt32(-335171433) - } - - break - case .updateBotBusinessConnect(let connection, let qts): - if boxed { - buffer.appendInt32(-1964652166) - } - connection.serialize(buffer, true) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotCallbackQuery(let flags, let queryId, let userId, let peer, let msgId, let chatInstance, let data, let gameShortName): - if boxed { - buffer.appendInt32(-1177566067) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(chatInstance, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(data!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(gameShortName!, buffer: buffer, boxed: false)} - break - case .updateBotChatBoost(let peer, let boost, let qts): - if boxed { - buffer.appendInt32(-1873947492) - } - peer.serialize(buffer, true) - boost.serialize(buffer, true) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotChatInviteRequester(let peer, let date, let userId, let about, let invite, let qts): - if boxed { - buffer.appendInt32(299870598) - } - peer.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(about, buffer: buffer, boxed: false) - invite.serialize(buffer, true) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotCommands(let peer, let botId, let commands): - if boxed { - buffer.appendInt32(1299263278) - } - peer.serialize(buffer, true) - serializeInt64(botId, buffer: buffer, boxed: false) + case updateStarsBalance(Cons_updateStarsBalance) + case updateStarsRevenueStatus(Cons_updateStarsRevenueStatus) + case updateStickerSets(Cons_updateStickerSets) + case updateStickerSetsOrder(Cons_updateStickerSetsOrder) + case updateStoriesStealthMode(Cons_updateStoriesStealthMode) + case updateStory(Cons_updateStory) + case updateStoryID(Cons_updateStoryID) + case updateTheme(Cons_updateTheme) + case updateTranscribedAudio(Cons_updateTranscribedAudio) + case updateUser(Cons_updateUser) + case updateUserEmojiStatus(Cons_updateUserEmojiStatus) + case updateUserName(Cons_updateUserName) + case updateUserPhone(Cons_updateUserPhone) + case updateUserStatus(Cons_updateUserStatus) + case updateUserTyping(Cons_updateUserTyping) + case updateWebPage(Cons_updateWebPage) + case updateWebViewResultSent(Cons_updateWebViewResultSent) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .updateAttachMenuBots: + if boxed { + buffer.appendInt32(397910539) + } + break + case .updateAutoSaveSettings: + if boxed { + buffer.appendInt32(-335171433) + } + break + case .updateBotBusinessConnect(let _data): + if boxed { + buffer.appendInt32(-1964652166) + } + _data.connection.serialize(buffer, true) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotCallbackQuery(let _data): + if boxed { + buffer.appendInt32(-1177566067) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.chatInstance, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.data!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.gameShortName!, buffer: buffer, boxed: false) + } + break + case .updateBotChatBoost(let _data): + if boxed { + buffer.appendInt32(-1873947492) + } + _data.peer.serialize(buffer, true) + _data.boost.serialize(buffer, true) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotChatInviteRequester(let _data): + if boxed { + buffer.appendInt32(299870598) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.about, buffer: buffer, boxed: false) + _data.invite.serialize(buffer, true) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotCommands(let _data): + if boxed { + buffer.appendInt32(1299263278) + } + _data.peer.serialize(buffer, true) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.commands.count)) + for item in _data.commands { + item.serialize(buffer, true) + } + break + case .updateBotDeleteBusinessMessage(let _data): + if boxed { + buffer.appendInt32(-1607821266) + } + serializeString(_data.connectionId, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotEditBusinessMessage(let _data): + if boxed { + buffer.appendInt32(132077692) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.connectionId, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.replyToMessage!.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotInlineQuery(let _data): + if boxed { + buffer.appendInt32(1232025500) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.query, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.geo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.peerType!.serialize(buffer, true) + } + serializeString(_data.offset, buffer: buffer, boxed: false) + break + case .updateBotInlineSend(let _data): + if boxed { + buffer.appendInt32(317794823) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.query, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.geo!.serialize(buffer, true) + } + serializeString(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.msgId!.serialize(buffer, true) + } + break + case .updateBotMenuButton(let _data): + if boxed { + buffer.appendInt32(347625491) + } + serializeInt64(_data.botId, buffer: buffer, boxed: false) + _data.button.serialize(buffer, true) + break + case .updateBotMessageReaction(let _data): + if boxed { + buffer.appendInt32(-1407069234) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.actor.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.oldReactions.count)) + for item in _data.oldReactions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newReactions.count)) + for item in _data.newReactions { + item.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotMessageReactions(let _data): + if boxed { + buffer.appendInt32(164329305) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotNewBusinessMessage(let _data): + if boxed { + buffer.appendInt32(-1646578564) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.connectionId, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.replyToMessage!.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotPrecheckoutQuery(let _data): + if boxed { + buffer.appendInt32(-1934976362) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeBytes(_data.payload, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.info!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.shippingOptionId!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + break + case .updateBotPurchasedPaidMedia(let _data): + if boxed { + buffer.appendInt32(675009298) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.payload, buffer: buffer, boxed: false) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotShippingQuery(let _data): + if boxed { + buffer.appendInt32(-1246823043) + } + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeBytes(_data.payload, buffer: buffer, boxed: false) + _data.shippingAddress.serialize(buffer, true) + break + case .updateBotStopped(let _data): + if boxed { + buffer.appendInt32(-997782967) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.stopped.serialize(buffer, true) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateBotWebhookJSON(let _data): + if boxed { + buffer.appendInt32(-2095595325) + } + _data.data.serialize(buffer, true) + break + case .updateBotWebhookJSONQuery(let _data): + if boxed { + buffer.appendInt32(-1684914010) + } + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + _data.data.serialize(buffer, true) + serializeInt32(_data.timeout, buffer: buffer, boxed: false) + break + case .updateBusinessBotCallbackQuery(let _data): + if boxed { + buffer.appendInt32(513998247) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.connectionId, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyToMessage!.serialize(buffer, true) + } + serializeInt64(_data.chatInstance, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.data!, buffer: buffer, boxed: false) + } + break + case .updateChannel(let _data): + if boxed { + buffer.appendInt32(1666927625) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + break + case .updateChannelAvailableMessages(let _data): + if boxed { + buffer.appendInt32(-1304443240) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.availableMinId, buffer: buffer, boxed: false) + break + case .updateChannelMessageForwards(let _data): + if boxed { + buffer.appendInt32(-761649164) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.forwards, buffer: buffer, boxed: false) + break + case .updateChannelMessageViews(let _data): + if boxed { + buffer.appendInt32(-232346616) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.views, buffer: buffer, boxed: false) + break + case .updateChannelParticipant(let _data): + if boxed { + buffer.appendInt32(-1738720581) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.actorId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.prevParticipant!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.newParticipant!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.invite!.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateChannelReadMessagesContents(let _data): + if boxed { + buffer.appendInt32(636691703) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .updateChannelTooLong(let _data): + if boxed { + buffer.appendInt32(277713951) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.pts!, buffer: buffer, boxed: false) + } + break + case .updateChannelUserTyping(let _data): + if boxed { + buffer.appendInt32(-1937192669) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + _data.fromId.serialize(buffer, true) + _data.action.serialize(buffer, true) + break + case .updateChannelViewForumAsMessages(let _data): + if boxed { + buffer.appendInt32(129403168) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + _data.enabled.serialize(buffer, true) + break + case .updateChannelWebPage(let _data): + if boxed { + buffer.appendInt32(791390623) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + _data.webpage.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateChat(let _data): + if boxed { + buffer.appendInt32(-124097970) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + break + case .updateChatDefaultBannedRights(let _data): + if boxed { + buffer.appendInt32(1421875280) + } + _data.peer.serialize(buffer, true) + _data.defaultBannedRights.serialize(buffer, true) + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .updateChatParticipant(let _data): + if boxed { + buffer.appendInt32(-796432838) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.actorId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.prevParticipant!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.newParticipant!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.invite!.serialize(buffer, true) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateChatParticipantAdd(let _data): + if boxed { + buffer.appendInt32(1037718609) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.inviterId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .updateChatParticipantAdmin(let _data): + if boxed { + buffer.appendInt32(-674602590) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.isAdmin.serialize(buffer, true) + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .updateChatParticipantDelete(let _data): + if boxed { + buffer.appendInt32(-483443337) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .updateChatParticipants(let _data): + if boxed { + buffer.appendInt32(125178264) + } + _data.participants.serialize(buffer, true) + break + case .updateChatUserTyping(let _data): + if boxed { + buffer.appendInt32(-2092401936) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + _data.fromId.serialize(buffer, true) + _data.action.serialize(buffer, true) + break + case .updateConfig: + if boxed { + buffer.appendInt32(-1574314746) + } + break + case .updateContactsReset: + if boxed { + buffer.appendInt32(1887741886) + } + break + case .updateDcOptions(let _data): + if boxed { + buffer.appendInt32(-1906403213) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dcOptions.count)) + for item in _data.dcOptions { + item.serialize(buffer, true) + } + break + case .updateDeleteChannelMessages(let _data): + if boxed { + buffer.appendInt32(-1020437742) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateDeleteGroupCallMessages(let _data): + if boxed { + buffer.appendInt32(1048963372) + } + _data.call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .updateDeleteMessages(let _data): + if boxed { + buffer.appendInt32(-1576161051) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateDeleteQuickReply(let _data): + if boxed { + buffer.appendInt32(1407644140) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + break + case .updateDeleteQuickReplyMessages(let _data): + if boxed { + buffer.appendInt32(1450174413) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .updateDeleteScheduledMessages(let _data): + if boxed { + buffer.appendInt32(-223929981) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(commands.count)) - for item in commands { - item.serialize(buffer, true) - } - break - case .updateBotDeleteBusinessMessage(let connectionId, let peer, let messages, let qts): - if boxed { - buffer.appendInt32(-1607821266) - } - serializeString(connectionId, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { + buffer.appendInt32(Int32(_data.sentMessages!.count)) + for item in _data.sentMessages! { serializeInt32(item, buffer: buffer, boxed: false) } - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotEditBusinessMessage(let flags, let connectionId, let message, let replyToMessage, let qts): - if boxed { - buffer.appendInt32(132077692) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(connectionId, buffer: buffer, boxed: false) - message.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyToMessage!.serialize(buffer, true)} - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotInlineQuery(let flags, let queryId, let userId, let query, let geo, let peerType, let offset): - if boxed { - buffer.appendInt32(1232025500) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(query, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {geo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {peerType!.serialize(buffer, true)} - serializeString(offset, buffer: buffer, boxed: false) - break - case .updateBotInlineSend(let flags, let userId, let query, let geo, let id, let msgId): - if boxed { - buffer.appendInt32(317794823) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(query, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {geo!.serialize(buffer, true)} - serializeString(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {msgId!.serialize(buffer, true)} - break - case .updateBotMenuButton(let botId, let button): - if boxed { - buffer.appendInt32(347625491) - } - serializeInt64(botId, buffer: buffer, boxed: false) - button.serialize(buffer, true) - break - case .updateBotMessageReaction(let peer, let msgId, let date, let actor, let oldReactions, let newReactions, let qts): - if boxed { - buffer.appendInt32(-1407069234) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - actor.serialize(buffer, true) + } + break + case .updateDialogFilter(let _data): + if boxed { + buffer.appendInt32(654302845) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.filter!.serialize(buffer, true) + } + break + case .updateDialogFilterOrder(let _data): + if boxed { + buffer.appendInt32(-1512627963) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.order.count)) + for item in _data.order { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .updateDialogFilters: + if boxed { + buffer.appendInt32(889491791) + } + break + case .updateDialogPinned(let _data): + if boxed { + buffer.appendInt32(1852826908) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + _data.peer.serialize(buffer, true) + break + case .updateDialogUnreadMark(let _data): + if boxed { + buffer.appendInt32(-1235684802) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + break + case .updateDraftMessage(let _data): + if boxed { + buffer.appendInt32(-302247650) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + _data.draft.serialize(buffer, true) + break + case .updateEditChannelMessage(let _data): + if boxed { + buffer.appendInt32(457133559) + } + _data.message.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateEditMessage(let _data): + if boxed { + buffer.appendInt32(-469536605) + } + _data.message.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateEmojiGameInfo(let _data): + if boxed { + buffer.appendInt32(-73640838) + } + _data.info.serialize(buffer, true) + break + case .updateEncryptedChatTyping(let _data): + if boxed { + buffer.appendInt32(386986326) + } + serializeInt32(_data.chatId, buffer: buffer, boxed: false) + break + case .updateEncryptedMessagesRead(let _data): + if boxed { + buffer.appendInt32(956179895) + } + serializeInt32(_data.chatId, buffer: buffer, boxed: false) + serializeInt32(_data.maxDate, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .updateEncryption(let _data): + if boxed { + buffer.appendInt32(-1264392051) + } + _data.chat.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .updateFavedStickers: + if boxed { + buffer.appendInt32(-451831443) + } + break + case .updateFolderPeers(let _data): + if boxed { + buffer.appendInt32(422972864) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.folderPeers.count)) + for item in _data.folderPeers { + item.serialize(buffer, true) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateGeoLiveViewed(let _data): + if boxed { + buffer.appendInt32(-2027964103) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + break + case .updateGroupCall(let _data): + if boxed { + buffer.appendInt32(-1658710304) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.peer!.serialize(buffer, true) + } + _data.call.serialize(buffer, true) + break + case .updateGroupCallChainBlocks(let _data): + if boxed { + buffer.appendInt32(-1535694705) + } + _data.call.serialize(buffer, true) + serializeInt32(_data.subChainId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + serializeBytes(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.nextOffset, buffer: buffer, boxed: false) + break + case .updateGroupCallConnection(let _data): + if boxed { + buffer.appendInt32(192428418) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.params.serialize(buffer, true) + break + case .updateGroupCallEncryptedMessage(let _data): + if boxed { + buffer.appendInt32(-917002394) + } + _data.call.serialize(buffer, true) + _data.fromId.serialize(buffer, true) + serializeBytes(_data.encryptedMessage, buffer: buffer, boxed: false) + break + case .updateGroupCallMessage(let _data): + if boxed { + buffer.appendInt32(-667783411) + } + _data.call.serialize(buffer, true) + _data.message.serialize(buffer, true) + break + case .updateGroupCallParticipants(let _data): + if boxed { + buffer.appendInt32(-219423922) + } + _data.call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .updateInlineBotCallbackQuery(let _data): + if boxed { + buffer.appendInt32(1763610706) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.msgId.serialize(buffer, true) + serializeInt64(_data.chatInstance, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.data!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.gameShortName!, buffer: buffer, boxed: false) + } + break + case .updateLangPack(let _data): + if boxed { + buffer.appendInt32(1442983757) + } + _data.difference.serialize(buffer, true) + break + case .updateLangPackTooLong(let _data): + if boxed { + buffer.appendInt32(1180041828) + } + serializeString(_data.langCode, buffer: buffer, boxed: false) + break + case .updateLoginToken: + if boxed { + buffer.appendInt32(1448076945) + } + break + case .updateMessageExtendedMedia(let _data): + if boxed { + buffer.appendInt32(-710666460) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.extendedMedia.count)) + for item in _data.extendedMedia { + item.serialize(buffer, true) + } + break + case .updateMessageID(let _data): + if boxed { + buffer.appendInt32(1318109142) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + break + case .updateMessagePoll(let _data): + if boxed { + buffer.appendInt32(-1398708869) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.pollId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.poll!.serialize(buffer, true) + } + _data.results.serialize(buffer, true) + break + case .updateMessagePollVote(let _data): + if boxed { + buffer.appendInt32(619974263) + } + serializeInt64(_data.pollId, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.options.count)) + for item in _data.options { + serializeBytes(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateMessageReactions(let _data): + if boxed { + buffer.appendInt32(506035194) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.savedPeerId!.serialize(buffer, true) + } + _data.reactions.serialize(buffer, true) + break + case .updateMonoForumNoPaidException(let _data): + if boxed { + buffer.appendInt32(-1618924792) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + _data.savedPeerId.serialize(buffer, true) + break + case .updateMoveStickerSetToTop(let _data): + if boxed { + buffer.appendInt32(-2030252155) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.stickerset, buffer: buffer, boxed: false) + break + case .updateNewAuthorization(let _data): + if boxed { + buffer.appendInt32(-1991136273) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.device!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.location!, buffer: buffer, boxed: false) + } + break + case .updateNewChannelMessage(let _data): + if boxed { + buffer.appendInt32(1656358105) + } + _data.message.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateNewEncryptedMessage(let _data): + if boxed { + buffer.appendInt32(314359194) + } + _data.message.serialize(buffer, true) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + break + case .updateNewMessage(let _data): + if boxed { + buffer.appendInt32(522914557) + } + _data.message.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateNewQuickReply(let _data): + if boxed { + buffer.appendInt32(-180508905) + } + _data.quickReply.serialize(buffer, true) + break + case .updateNewScheduledMessage(let _data): + if boxed { + buffer.appendInt32(967122427) + } + _data.message.serialize(buffer, true) + break + case .updateNewStickerSet(let _data): + if boxed { + buffer.appendInt32(1753886890) + } + _data.stickerset.serialize(buffer, true) + break + case .updateNewStoryReaction(let _data): + if boxed { + buffer.appendInt32(405070859) + } + serializeInt32(_data.storyId, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + _data.reaction.serialize(buffer, true) + break + case .updateNotifySettings(let _data): + if boxed { + buffer.appendInt32(-1094555409) + } + _data.peer.serialize(buffer, true) + _data.notifySettings.serialize(buffer, true) + break + case .updatePaidReactionPrivacy(let _data): + if boxed { + buffer.appendInt32(-1955438642) + } + _data.`private`.serialize(buffer, true) + break + case .updatePeerBlocked(let _data): + if boxed { + buffer.appendInt32(-337610926) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peerId.serialize(buffer, true) + break + case .updatePeerHistoryTTL(let _data): + if boxed { + buffer.appendInt32(-1147422299) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + case .updatePeerLocated(let _data): + if boxed { + buffer.appendInt32(-1263546448) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + break + case .updatePeerSettings(let _data): + if boxed { + buffer.appendInt32(1786671974) + } + _data.peer.serialize(buffer, true) + _data.settings.serialize(buffer, true) + break + case .updatePeerWallpaper(let _data): + if boxed { + buffer.appendInt32(-1371598819) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + break + case .updatePendingJoinRequests(let _data): + if boxed { + buffer.appendInt32(1885586395) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.requestsPending, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentRequesters.count)) + for item in _data.recentRequesters { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .updatePhoneCall(let _data): + if boxed { + buffer.appendInt32(-1425052898) + } + _data.phoneCall.serialize(buffer, true) + break + case .updatePhoneCallSignalingData(let _data): + if boxed { + buffer.appendInt32(643940105) + } + serializeInt64(_data.phoneCallId, buffer: buffer, boxed: false) + serializeBytes(_data.data, buffer: buffer, boxed: false) + break + case .updatePinnedChannelMessages(let _data): + if boxed { + buffer.appendInt32(1538885128) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updatePinnedDialogs(let _data): + if boxed { + buffer.appendInt32(-99664734) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(oldReactions.count)) - for item in oldReactions { + buffer.appendInt32(Int32(_data.order!.count)) + for item in _data.order! { item.serialize(buffer, true) } + } + break + case .updatePinnedForumTopic(let _data): + if boxed { + buffer.appendInt32(1748708434) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.topicId, buffer: buffer, boxed: false) + break + case .updatePinnedForumTopics(let _data): + if boxed { + buffer.appendInt32(-554613808) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newReactions.count)) - for item in newReactions { - item.serialize(buffer, true) - } - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotMessageReactions(let peer, let msgId, let date, let reactions, let qts): - if boxed { - buffer.appendInt32(164329305) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotNewBusinessMessage(let flags, let connectionId, let message, let replyToMessage, let qts): - if boxed { - buffer.appendInt32(-1646578564) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(connectionId, buffer: buffer, boxed: false) - message.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyToMessage!.serialize(buffer, true)} - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotPrecheckoutQuery(let flags, let queryId, let userId, let payload, let info, let shippingOptionId, let currency, let totalAmount): - if boxed { - buffer.appendInt32(-1934976362) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeBytes(payload, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {info!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(shippingOptionId!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - break - case .updateBotPurchasedPaidMedia(let userId, let payload, let qts): - if boxed { - buffer.appendInt32(675009298) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(payload, buffer: buffer, boxed: false) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotShippingQuery(let queryId, let userId, let payload, let shippingAddress): - if boxed { - buffer.appendInt32(-1246823043) - } - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeBytes(payload, buffer: buffer, boxed: false) - shippingAddress.serialize(buffer, true) - break - case .updateBotStopped(let userId, let date, let stopped, let qts): - if boxed { - buffer.appendInt32(-997782967) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - stopped.serialize(buffer, true) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateBotWebhookJSON(let data): - if boxed { - buffer.appendInt32(-2095595325) - } - data.serialize(buffer, true) - break - case .updateBotWebhookJSONQuery(let queryId, let data, let timeout): - if boxed { - buffer.appendInt32(-1684914010) - } - serializeInt64(queryId, buffer: buffer, boxed: false) - data.serialize(buffer, true) - serializeInt32(timeout, buffer: buffer, boxed: false) - break - case .updateBusinessBotCallbackQuery(let flags, let queryId, let userId, let connectionId, let message, let replyToMessage, let chatInstance, let data): - if boxed { - buffer.appendInt32(513998247) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(connectionId, buffer: buffer, boxed: false) - message.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {replyToMessage!.serialize(buffer, true)} - serializeInt64(chatInstance, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(data!, buffer: buffer, boxed: false)} - break - case .updateChannel(let channelId): - if boxed { - buffer.appendInt32(1666927625) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - break - case .updateChannelAvailableMessages(let channelId, let availableMinId): - if boxed { - buffer.appendInt32(-1304443240) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(availableMinId, buffer: buffer, boxed: false) - break - case .updateChannelMessageForwards(let channelId, let id, let forwards): - if boxed { - buffer.appendInt32(-761649164) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(forwards, buffer: buffer, boxed: false) - break - case .updateChannelMessageViews(let channelId, let id, let views): - if boxed { - buffer.appendInt32(-232346616) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(views, buffer: buffer, boxed: false) - break - case .updateChannelParticipant(let flags, let channelId, let date, let actorId, let userId, let prevParticipant, let newParticipant, let invite, let qts): - if boxed { - buffer.appendInt32(-1738720581) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(actorId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {prevParticipant!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {newParticipant!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {invite!.serialize(buffer, true)} - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateChannelReadMessagesContents(let flags, let channelId, let topMsgId, let savedPeerId, let messages): - if boxed { - buffer.appendInt32(636691703) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { + buffer.appendInt32(Int32(_data.order!.count)) + for item in _data.order! { serializeInt32(item, buffer: buffer, boxed: false) } - break - case .updateChannelTooLong(let flags, let channelId, let pts): - if boxed { - buffer.appendInt32(277713951) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(pts!, buffer: buffer, boxed: false)} - break - case .updateChannelUserTyping(let flags, let channelId, let topMsgId, let fromId, let action): - if boxed { - buffer.appendInt32(-1937192669) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - fromId.serialize(buffer, true) - action.serialize(buffer, true) - break - case .updateChannelViewForumAsMessages(let channelId, let enabled): - if boxed { - buffer.appendInt32(129403168) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - enabled.serialize(buffer, true) - break - case .updateChannelWebPage(let channelId, let webpage, let pts, let ptsCount): - if boxed { - buffer.appendInt32(791390623) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - webpage.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateChat(let chatId): - if boxed { - buffer.appendInt32(-124097970) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - break - case .updateChatDefaultBannedRights(let peer, let defaultBannedRights, let version): - if boxed { - buffer.appendInt32(1421875280) - } - peer.serialize(buffer, true) - defaultBannedRights.serialize(buffer, true) - serializeInt32(version, buffer: buffer, boxed: false) - break - case .updateChatParticipant(let flags, let chatId, let date, let actorId, let userId, let prevParticipant, let newParticipant, let invite, let qts): - if boxed { - buffer.appendInt32(-796432838) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(actorId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {prevParticipant!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {newParticipant!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {invite!.serialize(buffer, true)} - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateChatParticipantAdd(let chatId, let userId, let inviterId, let date, let version): - if boxed { - buffer.appendInt32(1037718609) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(inviterId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - break - case .updateChatParticipantAdmin(let chatId, let userId, let isAdmin, let version): - if boxed { - buffer.appendInt32(-674602590) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - isAdmin.serialize(buffer, true) - serializeInt32(version, buffer: buffer, boxed: false) - break - case .updateChatParticipantDelete(let chatId, let userId, let version): - if boxed { - buffer.appendInt32(-483443337) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - break - case .updateChatParticipants(let participants): - if boxed { - buffer.appendInt32(125178264) - } - participants.serialize(buffer, true) - break - case .updateChatUserTyping(let chatId, let fromId, let action): - if boxed { - buffer.appendInt32(-2092401936) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - fromId.serialize(buffer, true) - action.serialize(buffer, true) - break - case .updateConfig: - if boxed { - buffer.appendInt32(-1574314746) - } - - break - case .updateContactsReset: - if boxed { - buffer.appendInt32(1887741886) - } - - break - case .updateDcOptions(let dcOptions): - if boxed { - buffer.appendInt32(-1906403213) - } + } + break + case .updatePinnedMessages(let _data): + if boxed { + buffer.appendInt32(-309990731) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updatePinnedSavedDialogs(let _data): + if boxed { + buffer.appendInt32(1751942566) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dcOptions.count)) - for item in dcOptions { + buffer.appendInt32(Int32(_data.order!.count)) + for item in _data.order! { item.serialize(buffer, true) } - break - case .updateDeleteChannelMessages(let channelId, let messages, let pts, let ptsCount): - if boxed { - buffer.appendInt32(-1020437742) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateDeleteGroupCallMessages(let call, let messages): - if boxed { - buffer.appendInt32(1048963372) - } - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .updateDeleteMessages(let messages, let pts, let ptsCount): - if boxed { - buffer.appendInt32(-1576161051) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateDeleteQuickReply(let shortcutId): - if boxed { - buffer.appendInt32(1407644140) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - break - case .updateDeleteQuickReplyMessages(let shortcutId, let messages): - if boxed { - buffer.appendInt32(1450174413) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .updateDeleteScheduledMessages(let flags, let peer, let messages, let sentMessages): - if boxed { - buffer.appendInt32(-223929981) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sentMessages!.count)) - for item in sentMessages! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - break - case .updateDialogFilter(let flags, let id, let filter): - if boxed { - buffer.appendInt32(654302845) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {filter!.serialize(buffer, true)} - break - case .updateDialogFilterOrder(let order): - if boxed { - buffer.appendInt32(-1512627963) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .updateDialogFilters: - if boxed { - buffer.appendInt32(889491791) - } - - break - case .updateDialogPinned(let flags, let folderId, let peer): - if boxed { - buffer.appendInt32(1852826908) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - peer.serialize(buffer, true) - break - case .updateDialogUnreadMark(let flags, let peer, let savedPeerId): - if boxed { - buffer.appendInt32(-1235684802) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - break - case .updateDraftMessage(let flags, let peer, let topMsgId, let savedPeerId, let draft): - if boxed { - buffer.appendInt32(-302247650) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - draft.serialize(buffer, true) - break - case .updateEditChannelMessage(let message, let pts, let ptsCount): - if boxed { - buffer.appendInt32(457133559) - } - message.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateEditMessage(let message, let pts, let ptsCount): - if boxed { - buffer.appendInt32(-469536605) - } - message.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateEmojiGameInfo(let info): - if boxed { - buffer.appendInt32(-73640838) - } - info.serialize(buffer, true) - break - case .updateEncryptedChatTyping(let chatId): - if boxed { - buffer.appendInt32(386986326) - } - serializeInt32(chatId, buffer: buffer, boxed: false) - break - case .updateEncryptedMessagesRead(let chatId, let maxDate, let date): - if boxed { - buffer.appendInt32(956179895) - } - serializeInt32(chatId, buffer: buffer, boxed: false) - serializeInt32(maxDate, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .updateEncryption(let chat, let date): - if boxed { - buffer.appendInt32(-1264392051) - } - chat.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .updateFavedStickers: - if boxed { - buffer.appendInt32(-451831443) - } - - break - case .updateFolderPeers(let folderPeers, let pts, let ptsCount): - if boxed { - buffer.appendInt32(422972864) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(folderPeers.count)) - for item in folderPeers { - item.serialize(buffer, true) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateGeoLiveViewed(let peer, let msgId): - if boxed { - buffer.appendInt32(-2027964103) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - break - case .updateGroupCall(let flags, let peer, let call): - if boxed { - buffer.appendInt32(-1658710304) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {peer!.serialize(buffer, true)} - call.serialize(buffer, true) - break - case .updateGroupCallChainBlocks(let call, let subChainId, let blocks, let nextOffset): - if boxed { - buffer.appendInt32(-1535694705) - } - call.serialize(buffer, true) - serializeInt32(subChainId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocks.count)) - for item in blocks { - serializeBytes(item, buffer: buffer, boxed: false) - } - serializeInt32(nextOffset, buffer: buffer, boxed: false) - break - case .updateGroupCallConnection(let flags, let params): - if boxed { - buffer.appendInt32(192428418) - } - serializeInt32(flags, buffer: buffer, boxed: false) - params.serialize(buffer, true) - break - case .updateGroupCallEncryptedMessage(let call, let fromId, let encryptedMessage): - if boxed { - buffer.appendInt32(-917002394) - } - call.serialize(buffer, true) - fromId.serialize(buffer, true) - serializeBytes(encryptedMessage, buffer: buffer, boxed: false) - break - case .updateGroupCallMessage(let call, let message): - if boxed { - buffer.appendInt32(-667783411) - } - call.serialize(buffer, true) - message.serialize(buffer, true) - break - case .updateGroupCallParticipants(let call, let participants, let version): - if boxed { - buffer.appendInt32(-219423922) - } - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants.count)) - for item in participants { - item.serialize(buffer, true) - } - serializeInt32(version, buffer: buffer, boxed: false) - break - case .updateInlineBotCallbackQuery(let flags, let queryId, let userId, let msgId, let chatInstance, let data, let gameShortName): - if boxed { - buffer.appendInt32(1763610706) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - msgId.serialize(buffer, true) - serializeInt64(chatInstance, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(data!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(gameShortName!, buffer: buffer, boxed: false)} - break - case .updateLangPack(let difference): - if boxed { - buffer.appendInt32(1442983757) - } - difference.serialize(buffer, true) - break - case .updateLangPackTooLong(let langCode): - if boxed { - buffer.appendInt32(1180041828) - } - serializeString(langCode, buffer: buffer, boxed: false) - break - case .updateLoginToken: - if boxed { - buffer.appendInt32(1448076945) - } - - break - case .updateMessageExtendedMedia(let peer, let msgId, let extendedMedia): - if boxed { - buffer.appendInt32(-710666460) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(extendedMedia.count)) - for item in extendedMedia { - item.serialize(buffer, true) - } - break - case .updateMessageID(let id, let randomId): - if boxed { - buffer.appendInt32(1318109142) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - break - case .updateMessagePoll(let flags, let pollId, let poll, let results): - if boxed { - buffer.appendInt32(-1398708869) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(pollId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {poll!.serialize(buffer, true)} - results.serialize(buffer, true) - break - case .updateMessagePollVote(let pollId, let peer, let options, let qts): - if boxed { - buffer.appendInt32(619974263) - } - serializeInt64(pollId, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(options.count)) - for item in options { - serializeBytes(item, buffer: buffer, boxed: false) - } - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateMessageReactions(let flags, let peer, let msgId, let topMsgId, let savedPeerId, let reactions): - if boxed { - buffer.appendInt32(506035194) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - reactions.serialize(buffer, true) - break - case .updateMonoForumNoPaidException(let flags, let channelId, let savedPeerId): - if boxed { - buffer.appendInt32(-1618924792) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - savedPeerId.serialize(buffer, true) - break - case .updateMoveStickerSetToTop(let flags, let stickerset): - if boxed { - buffer.appendInt32(-2030252155) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(stickerset, buffer: buffer, boxed: false) - break - case .updateNewAuthorization(let flags, let hash, let date, let device, let location): - if boxed { - buffer.appendInt32(-1991136273) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(date!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(device!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(location!, buffer: buffer, boxed: false)} - break - case .updateNewChannelMessage(let message, let pts, let ptsCount): - if boxed { - buffer.appendInt32(1656358105) - } - message.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateNewEncryptedMessage(let message, let qts): - if boxed { - buffer.appendInt32(314359194) - } - message.serialize(buffer, true) - serializeInt32(qts, buffer: buffer, boxed: false) - break - case .updateNewMessage(let message, let pts, let ptsCount): - if boxed { - buffer.appendInt32(522914557) - } - message.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateNewQuickReply(let quickReply): - if boxed { - buffer.appendInt32(-180508905) - } - quickReply.serialize(buffer, true) - break - case .updateNewScheduledMessage(let message): - if boxed { - buffer.appendInt32(967122427) - } - message.serialize(buffer, true) - break - case .updateNewStickerSet(let stickerset): - if boxed { - buffer.appendInt32(1753886890) - } - stickerset.serialize(buffer, true) - break - case .updateNewStoryReaction(let storyId, let peer, let reaction): - if boxed { - buffer.appendInt32(405070859) - } - serializeInt32(storyId, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - reaction.serialize(buffer, true) - break - case .updateNotifySettings(let peer, let notifySettings): - if boxed { - buffer.appendInt32(-1094555409) - } - peer.serialize(buffer, true) - notifySettings.serialize(buffer, true) - break - case .updatePaidReactionPrivacy(let `private`): - if boxed { - buffer.appendInt32(-1955438642) - } - `private`.serialize(buffer, true) - break - case .updatePeerBlocked(let flags, let peerId): - if boxed { - buffer.appendInt32(-337610926) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peerId.serialize(buffer, true) - break - case .updatePeerHistoryTTL(let flags, let peer, let ttlPeriod): - if boxed { - buffer.appendInt32(-1147422299) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - case .updatePeerLocated(let peers): - if boxed { - buffer.appendInt32(-1263546448) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - break - case .updatePeerSettings(let peer, let settings): - if boxed { - buffer.appendInt32(1786671974) - } - peer.serialize(buffer, true) - settings.serialize(buffer, true) - break - case .updatePeerWallpaper(let flags, let peer, let wallpaper): - if boxed { - buffer.appendInt32(-1371598819) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {wallpaper!.serialize(buffer, true)} - break - case .updatePendingJoinRequests(let peer, let requestsPending, let recentRequesters): - if boxed { - buffer.appendInt32(1885586395) - } - peer.serialize(buffer, true) - serializeInt32(requestsPending, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentRequesters.count)) - for item in recentRequesters { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .updatePhoneCall(let phoneCall): - if boxed { - buffer.appendInt32(-1425052898) - } - phoneCall.serialize(buffer, true) - break - case .updatePhoneCallSignalingData(let phoneCallId, let data): - if boxed { - buffer.appendInt32(643940105) - } - serializeInt64(phoneCallId, buffer: buffer, boxed: false) - serializeBytes(data, buffer: buffer, boxed: false) - break - case .updatePinnedChannelMessages(let flags, let channelId, let messages, let pts, let ptsCount): - if boxed { - buffer.appendInt32(1538885128) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updatePinnedDialogs(let flags, let folderId, let order): - if boxed { - buffer.appendInt32(-99664734) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order!.count)) - for item in order! { - item.serialize(buffer, true) - }} - break - case .updatePinnedForumTopic(let flags, let peer, let topicId): - if boxed { - buffer.appendInt32(1748708434) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topicId, buffer: buffer, boxed: false) - break - case .updatePinnedForumTopics(let flags, let peer, let order): - if boxed { - buffer.appendInt32(-554613808) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order!.count)) - for item in order! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - break - case .updatePinnedMessages(let flags, let peer, let messages, let pts, let ptsCount): - if boxed { - buffer.appendInt32(-309990731) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updatePinnedSavedDialogs(let flags, let order): - if boxed { - buffer.appendInt32(1751942566) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order!.count)) - for item in order! { - item.serialize(buffer, true) - }} - break - case .updatePrivacy(let key, let rules): - if boxed { - buffer.appendInt32(-298113238) - } - key.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rules.count)) - for item in rules { - item.serialize(buffer, true) - } - break - case .updatePtsChanged: - if boxed { - buffer.appendInt32(861169551) - } - - break - case .updateQuickReplies(let quickReplies): - if boxed { - buffer.appendInt32(-112784718) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(quickReplies.count)) - for item in quickReplies { - item.serialize(buffer, true) - } - break - case .updateQuickReplyMessage(let message): - if boxed { - buffer.appendInt32(1040518415) - } - message.serialize(buffer, true) - break - case .updateReadChannelDiscussionInbox(let flags, let channelId, let topMsgId, let readMaxId, let broadcastId, let broadcastPost): - if boxed { - buffer.appendInt32(-693004986) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(topMsgId, buffer: buffer, boxed: false) - serializeInt32(readMaxId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(broadcastId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(broadcastPost!, buffer: buffer, boxed: false)} - break - case .updateReadChannelDiscussionOutbox(let channelId, let topMsgId, let readMaxId): - if boxed { - buffer.appendInt32(1767677564) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(topMsgId, buffer: buffer, boxed: false) - serializeInt32(readMaxId, buffer: buffer, boxed: false) - break - case .updateReadChannelInbox(let flags, let folderId, let channelId, let maxId, let stillUnreadCount, let pts): - if boxed { - buffer.appendInt32(-1842450928) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(stillUnreadCount, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - break - case .updateReadChannelOutbox(let channelId, let maxId): - if boxed { - buffer.appendInt32(-1218471511) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - break - case .updateReadFeaturedEmojiStickers: - if boxed { - buffer.appendInt32(-78886548) - } - - break - case .updateReadFeaturedStickers: - if boxed { - buffer.appendInt32(1461528386) - } - - break - case .updateReadHistoryInbox(let flags, let folderId, let peer, let topMsgId, let maxId, let stillUnreadCount, let pts, let ptsCount): - if boxed { - buffer.appendInt32(-1635468135) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(stillUnreadCount, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateReadHistoryOutbox(let peer, let maxId, let pts, let ptsCount): - if boxed { - buffer.appendInt32(791617983) - } - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateReadMessagesContents(let flags, let messages, let pts, let ptsCount, let date): - if boxed { - buffer.appendInt32(-131960447) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(date!, buffer: buffer, boxed: false)} - break - case .updateReadMonoForumInbox(let channelId, let savedPeerId, let readMaxId): - if boxed { - buffer.appendInt32(2008081266) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - savedPeerId.serialize(buffer, true) - serializeInt32(readMaxId, buffer: buffer, boxed: false) - break - case .updateReadMonoForumOutbox(let channelId, let savedPeerId, let readMaxId): - if boxed { - buffer.appendInt32(-1532521610) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - savedPeerId.serialize(buffer, true) - serializeInt32(readMaxId, buffer: buffer, boxed: false) - break - case .updateReadStories(let peer, let maxId): - if boxed { - buffer.appendInt32(-145845461) - } - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - break - case .updateRecentEmojiStatuses: - if boxed { - buffer.appendInt32(821314523) - } - - break - case .updateRecentReactions: - if boxed { - buffer.appendInt32(1870160884) - } - - break - case .updateRecentStickers: - if boxed { - buffer.appendInt32(-1706939360) - } - - break - case .updateSavedDialogPinned(let flags, let peer): - if boxed { - buffer.appendInt32(-1364222348) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - break - case .updateSavedGifs: - if boxed { - buffer.appendInt32(-1821035490) - } - - break - case .updateSavedReactionTags: - if boxed { - buffer.appendInt32(969307186) - } - - break - case .updateSavedRingtones: - if boxed { - buffer.appendInt32(1960361625) - } - - break - case .updateSentPhoneCode(let sentCode): - if boxed { - buffer.appendInt32(1347068303) - } - sentCode.serialize(buffer, true) - break - case .updateSentStoryReaction(let peer, let storyId, let reaction): - if boxed { - buffer.appendInt32(2103604867) - } - peer.serialize(buffer, true) - serializeInt32(storyId, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - break - case .updateServiceNotification(let flags, let inboxDate, let type, let message, let media, let entities): - if boxed { - buffer.appendInt32(-337352679) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(inboxDate!, buffer: buffer, boxed: false)} - serializeString(type, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - media.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - break - case .updateSmsJob(let jobId): - if boxed { - buffer.appendInt32(-245208620) - } - serializeString(jobId, buffer: buffer, boxed: false) - break - case .updateStarGiftAuctionState(let giftId, let state): - if boxed { - buffer.appendInt32(1222788802) - } - serializeInt64(giftId, buffer: buffer, boxed: false) - state.serialize(buffer, true) - break - case .updateStarGiftAuctionUserState(let giftId, let userState): - if boxed { - buffer.appendInt32(-598150370) - } - serializeInt64(giftId, buffer: buffer, boxed: false) - userState.serialize(buffer, true) - break - case .updateStarGiftCraftFail: - if boxed { - buffer.appendInt32(-1408818108) - } - - break - case .updateStarsBalance(let balance): - if boxed { - buffer.appendInt32(1317053305) - } - balance.serialize(buffer, true) - break - case .updateStarsRevenueStatus(let peer, let status): - if boxed { - buffer.appendInt32(-1518030823) - } - peer.serialize(buffer, true) - status.serialize(buffer, true) - break - case .updateStickerSets(let flags): - if boxed { - buffer.appendInt32(834816008) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .updateStickerSetsOrder(let flags, let order): - if boxed { - buffer.appendInt32(196268545) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .updateStoriesStealthMode(let stealthMode): - if boxed { - buffer.appendInt32(738741697) - } - stealthMode.serialize(buffer, true) - break - case .updateStory(let peer, let story): - if boxed { - buffer.appendInt32(1974712216) - } - peer.serialize(buffer, true) - story.serialize(buffer, true) - break - case .updateStoryID(let id, let randomId): - if boxed { - buffer.appendInt32(468923833) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - break - case .updateTheme(let theme): - if boxed { - buffer.appendInt32(-2112423005) - } - theme.serialize(buffer, true) - break - case .updateTranscribedAudio(let flags, let peer, let msgId, let transcriptionId, let text): - if boxed { - buffer.appendInt32(8703322) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(transcriptionId, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - break - case .updateUser(let userId): - if boxed { - buffer.appendInt32(542282808) - } - serializeInt64(userId, buffer: buffer, boxed: false) - break - case .updateUserEmojiStatus(let userId, let emojiStatus): - if boxed { - buffer.appendInt32(674706841) - } - serializeInt64(userId, buffer: buffer, boxed: false) - emojiStatus.serialize(buffer, true) - break - case .updateUserName(let userId, let firstName, let lastName, let usernames): - if boxed { - buffer.appendInt32(-1484486364) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(usernames.count)) - for item in usernames { - item.serialize(buffer, true) - } - break - case .updateUserPhone(let userId, let phone): - if boxed { - buffer.appendInt32(88680979) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(phone, buffer: buffer, boxed: false) - break - case .updateUserStatus(let userId, let status): - if boxed { - buffer.appendInt32(-440534818) - } - serializeInt64(userId, buffer: buffer, boxed: false) - status.serialize(buffer, true) - break - case .updateUserTyping(let flags, let userId, let topMsgId, let action): - if boxed { - buffer.appendInt32(706199388) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - action.serialize(buffer, true) - break - case .updateWebPage(let webpage, let pts, let ptsCount): - if boxed { - buffer.appendInt32(2139689491) - } - webpage.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - case .updateWebViewResultSent(let queryId): - if boxed { - buffer.appendInt32(361936797) - } - serializeInt64(queryId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .updateAttachMenuBots: + } + break + case .updatePrivacy(let _data): + if boxed { + buffer.appendInt32(-298113238) + } + _data.key.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rules.count)) + for item in _data.rules { + item.serialize(buffer, true) + } + break + case .updatePtsChanged: + if boxed { + buffer.appendInt32(861169551) + } + break + case .updateQuickReplies(let _data): + if boxed { + buffer.appendInt32(-112784718) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.quickReplies.count)) + for item in _data.quickReplies { + item.serialize(buffer, true) + } + break + case .updateQuickReplyMessage(let _data): + if boxed { + buffer.appendInt32(1040518415) + } + _data.message.serialize(buffer, true) + break + case .updateReadChannelDiscussionInbox(let _data): + if boxed { + buffer.appendInt32(-693004986) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.topMsgId, buffer: buffer, boxed: false) + serializeInt32(_data.readMaxId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.broadcastId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.broadcastPost!, buffer: buffer, boxed: false) + } + break + case .updateReadChannelDiscussionOutbox(let _data): + if boxed { + buffer.appendInt32(1767677564) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.topMsgId, buffer: buffer, boxed: false) + serializeInt32(_data.readMaxId, buffer: buffer, boxed: false) + break + case .updateReadChannelInbox(let _data): + if boxed { + buffer.appendInt32(-1842450928) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + serializeInt32(_data.stillUnreadCount, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + break + case .updateReadChannelOutbox(let _data): + if boxed { + buffer.appendInt32(-1218471511) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + break + case .updateReadFeaturedEmojiStickers: + if boxed { + buffer.appendInt32(-78886548) + } + break + case .updateReadFeaturedStickers: + if boxed { + buffer.appendInt32(1461528386) + } + break + case .updateReadHistoryInbox(let _data): + if boxed { + buffer.appendInt32(-1635468135) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + _data.peer.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + serializeInt32(_data.stillUnreadCount, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateReadHistoryOutbox(let _data): + if boxed { + buffer.appendInt32(791617983) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateReadMessagesContents(let _data): + if boxed { + buffer.appendInt32(-131960447) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) + } + break + case .updateReadMonoForumInbox(let _data): + if boxed { + buffer.appendInt32(2008081266) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + _data.savedPeerId.serialize(buffer, true) + serializeInt32(_data.readMaxId, buffer: buffer, boxed: false) + break + case .updateReadMonoForumOutbox(let _data): + if boxed { + buffer.appendInt32(-1532521610) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + _data.savedPeerId.serialize(buffer, true) + serializeInt32(_data.readMaxId, buffer: buffer, boxed: false) + break + case .updateReadStories(let _data): + if boxed { + buffer.appendInt32(-145845461) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) + break + case .updateRecentEmojiStatuses: + if boxed { + buffer.appendInt32(821314523) + } + break + case .updateRecentReactions: + if boxed { + buffer.appendInt32(1870160884) + } + break + case .updateRecentStickers: + if boxed { + buffer.appendInt32(-1706939360) + } + break + case .updateSavedDialogPinned(let _data): + if boxed { + buffer.appendInt32(-1364222348) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + break + case .updateSavedGifs: + if boxed { + buffer.appendInt32(-1821035490) + } + break + case .updateSavedReactionTags: + if boxed { + buffer.appendInt32(969307186) + } + break + case .updateSavedRingtones: + if boxed { + buffer.appendInt32(1960361625) + } + break + case .updateSentPhoneCode(let _data): + if boxed { + buffer.appendInt32(1347068303) + } + _data.sentCode.serialize(buffer, true) + break + case .updateSentStoryReaction(let _data): + if boxed { + buffer.appendInt32(2103604867) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.storyId, buffer: buffer, boxed: false) + _data.reaction.serialize(buffer, true) + break + case .updateServiceNotification(let _data): + if boxed { + buffer.appendInt32(-337352679) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.inboxDate!, buffer: buffer, boxed: false) + } + serializeString(_data.type, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + _data.media.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities.count)) + for item in _data.entities { + item.serialize(buffer, true) + } + break + case .updateSmsJob(let _data): + if boxed { + buffer.appendInt32(-245208620) + } + serializeString(_data.jobId, buffer: buffer, boxed: false) + break + case .updateStarGiftAuctionState(let _data): + if boxed { + buffer.appendInt32(1222788802) + } + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + _data.state.serialize(buffer, true) + break + case .updateStarGiftAuctionUserState(let _data): + if boxed { + buffer.appendInt32(-598150370) + } + serializeInt64(_data.giftId, buffer: buffer, boxed: false) + _data.userState.serialize(buffer, true) + break + case .updateStarGiftCraftFail: + if boxed { + buffer.appendInt32(-1408818108) + } + break + case .updateStarsBalance(let _data): + if boxed { + buffer.appendInt32(1317053305) + } + _data.balance.serialize(buffer, true) + break + case .updateStarsRevenueStatus(let _data): + if boxed { + buffer.appendInt32(-1518030823) + } + _data.peer.serialize(buffer, true) + _data.status.serialize(buffer, true) + break + case .updateStickerSets(let _data): + if boxed { + buffer.appendInt32(834816008) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .updateStickerSetsOrder(let _data): + if boxed { + buffer.appendInt32(196268545) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.order.count)) + for item in _data.order { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .updateStoriesStealthMode(let _data): + if boxed { + buffer.appendInt32(738741697) + } + _data.stealthMode.serialize(buffer, true) + break + case .updateStory(let _data): + if boxed { + buffer.appendInt32(1974712216) + } + _data.peer.serialize(buffer, true) + _data.story.serialize(buffer, true) + break + case .updateStoryID(let _data): + if boxed { + buffer.appendInt32(468923833) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + break + case .updateTheme(let _data): + if boxed { + buffer.appendInt32(-2112423005) + } + _data.theme.serialize(buffer, true) + break + case .updateTranscribedAudio(let _data): + if boxed { + buffer.appendInt32(8703322) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.transcriptionId, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .updateUser(let _data): + if boxed { + buffer.appendInt32(542282808) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .updateUserEmojiStatus(let _data): + if boxed { + buffer.appendInt32(674706841) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.emojiStatus.serialize(buffer, true) + break + case .updateUserName(let _data): + if boxed { + buffer.appendInt32(-1484486364) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.usernames.count)) + for item in _data.usernames { + item.serialize(buffer, true) + } + break + case .updateUserPhone(let _data): + if boxed { + buffer.appendInt32(88680979) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.phone, buffer: buffer, boxed: false) + break + case .updateUserStatus(let _data): + if boxed { + buffer.appendInt32(-440534818) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.status.serialize(buffer, true) + break + case .updateUserTyping(let _data): + if boxed { + buffer.appendInt32(706199388) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + _data.action.serialize(buffer, true) + break + case .updateWebPage(let _data): + if boxed { + buffer.appendInt32(2139689491) + } + _data.webpage.serialize(buffer, true) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + case .updateWebViewResultSent(let _data): + if boxed { + buffer.appendInt32(361936797) + } + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .updateAttachMenuBots: return ("updateAttachMenuBots", []) - case .updateAutoSaveSettings: + case .updateAutoSaveSettings: return ("updateAutoSaveSettings", []) - case .updateBotBusinessConnect(let connection, let qts): - return ("updateBotBusinessConnect", [("connection", connection as Any), ("qts", qts as Any)]) - case .updateBotCallbackQuery(let flags, let queryId, let userId, let peer, let msgId, let chatInstance, let data, let gameShortName): - return ("updateBotCallbackQuery", [("flags", flags as Any), ("queryId", queryId as Any), ("userId", userId as Any), ("peer", peer as Any), ("msgId", msgId as Any), ("chatInstance", chatInstance as Any), ("data", data as Any), ("gameShortName", gameShortName as Any)]) - case .updateBotChatBoost(let peer, let boost, let qts): - return ("updateBotChatBoost", [("peer", peer as Any), ("boost", boost as Any), ("qts", qts as Any)]) - case .updateBotChatInviteRequester(let peer, let date, let userId, let about, let invite, let qts): - return ("updateBotChatInviteRequester", [("peer", peer as Any), ("date", date as Any), ("userId", userId as Any), ("about", about as Any), ("invite", invite as Any), ("qts", qts as Any)]) - case .updateBotCommands(let peer, let botId, let commands): - return ("updateBotCommands", [("peer", peer as Any), ("botId", botId as Any), ("commands", commands as Any)]) - case .updateBotDeleteBusinessMessage(let connectionId, let peer, let messages, let qts): - return ("updateBotDeleteBusinessMessage", [("connectionId", connectionId as Any), ("peer", peer as Any), ("messages", messages as Any), ("qts", qts as Any)]) - case .updateBotEditBusinessMessage(let flags, let connectionId, let message, let replyToMessage, let qts): - return ("updateBotEditBusinessMessage", [("flags", flags as Any), ("connectionId", connectionId as Any), ("message", message as Any), ("replyToMessage", replyToMessage as Any), ("qts", qts as Any)]) - case .updateBotInlineQuery(let flags, let queryId, let userId, let query, let geo, let peerType, let offset): - return ("updateBotInlineQuery", [("flags", flags as Any), ("queryId", queryId as Any), ("userId", userId as Any), ("query", query as Any), ("geo", geo as Any), ("peerType", peerType as Any), ("offset", offset as Any)]) - case .updateBotInlineSend(let flags, let userId, let query, let geo, let id, let msgId): - return ("updateBotInlineSend", [("flags", flags as Any), ("userId", userId as Any), ("query", query as Any), ("geo", geo as Any), ("id", id as Any), ("msgId", msgId as Any)]) - case .updateBotMenuButton(let botId, let button): - return ("updateBotMenuButton", [("botId", botId as Any), ("button", button as Any)]) - case .updateBotMessageReaction(let peer, let msgId, let date, let actor, let oldReactions, let newReactions, let qts): - return ("updateBotMessageReaction", [("peer", peer as Any), ("msgId", msgId as Any), ("date", date as Any), ("actor", actor as Any), ("oldReactions", oldReactions as Any), ("newReactions", newReactions as Any), ("qts", qts as Any)]) - case .updateBotMessageReactions(let peer, let msgId, let date, let reactions, let qts): - return ("updateBotMessageReactions", [("peer", peer as Any), ("msgId", msgId as Any), ("date", date as Any), ("reactions", reactions as Any), ("qts", qts as Any)]) - case .updateBotNewBusinessMessage(let flags, let connectionId, let message, let replyToMessage, let qts): - return ("updateBotNewBusinessMessage", [("flags", flags as Any), ("connectionId", connectionId as Any), ("message", message as Any), ("replyToMessage", replyToMessage as Any), ("qts", qts as Any)]) - case .updateBotPrecheckoutQuery(let flags, let queryId, let userId, let payload, let info, let shippingOptionId, let currency, let totalAmount): - return ("updateBotPrecheckoutQuery", [("flags", flags as Any), ("queryId", queryId as Any), ("userId", userId as Any), ("payload", payload as Any), ("info", info as Any), ("shippingOptionId", shippingOptionId as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any)]) - case .updateBotPurchasedPaidMedia(let userId, let payload, let qts): - return ("updateBotPurchasedPaidMedia", [("userId", userId as Any), ("payload", payload as Any), ("qts", qts as Any)]) - case .updateBotShippingQuery(let queryId, let userId, let payload, let shippingAddress): - return ("updateBotShippingQuery", [("queryId", queryId as Any), ("userId", userId as Any), ("payload", payload as Any), ("shippingAddress", shippingAddress as Any)]) - case .updateBotStopped(let userId, let date, let stopped, let qts): - return ("updateBotStopped", [("userId", userId as Any), ("date", date as Any), ("stopped", stopped as Any), ("qts", qts as Any)]) - case .updateBotWebhookJSON(let data): - return ("updateBotWebhookJSON", [("data", data as Any)]) - case .updateBotWebhookJSONQuery(let queryId, let data, let timeout): - return ("updateBotWebhookJSONQuery", [("queryId", queryId as Any), ("data", data as Any), ("timeout", timeout as Any)]) - case .updateBusinessBotCallbackQuery(let flags, let queryId, let userId, let connectionId, let message, let replyToMessage, let chatInstance, let data): - return ("updateBusinessBotCallbackQuery", [("flags", flags as Any), ("queryId", queryId as Any), ("userId", userId as Any), ("connectionId", connectionId as Any), ("message", message as Any), ("replyToMessage", replyToMessage as Any), ("chatInstance", chatInstance as Any), ("data", data as Any)]) - case .updateChannel(let channelId): - return ("updateChannel", [("channelId", channelId as Any)]) - case .updateChannelAvailableMessages(let channelId, let availableMinId): - return ("updateChannelAvailableMessages", [("channelId", channelId as Any), ("availableMinId", availableMinId as Any)]) - case .updateChannelMessageForwards(let channelId, let id, let forwards): - return ("updateChannelMessageForwards", [("channelId", channelId as Any), ("id", id as Any), ("forwards", forwards as Any)]) - case .updateChannelMessageViews(let channelId, let id, let views): - return ("updateChannelMessageViews", [("channelId", channelId as Any), ("id", id as Any), ("views", views as Any)]) - case .updateChannelParticipant(let flags, let channelId, let date, let actorId, let userId, let prevParticipant, let newParticipant, let invite, let qts): - return ("updateChannelParticipant", [("flags", flags as Any), ("channelId", channelId as Any), ("date", date as Any), ("actorId", actorId as Any), ("userId", userId as Any), ("prevParticipant", prevParticipant as Any), ("newParticipant", newParticipant as Any), ("invite", invite as Any), ("qts", qts as Any)]) - case .updateChannelReadMessagesContents(let flags, let channelId, let topMsgId, let savedPeerId, let messages): - return ("updateChannelReadMessagesContents", [("flags", flags as Any), ("channelId", channelId as Any), ("topMsgId", topMsgId as Any), ("savedPeerId", savedPeerId as Any), ("messages", messages as Any)]) - case .updateChannelTooLong(let flags, let channelId, let pts): - return ("updateChannelTooLong", [("flags", flags as Any), ("channelId", channelId as Any), ("pts", pts as Any)]) - case .updateChannelUserTyping(let flags, let channelId, let topMsgId, let fromId, let action): - return ("updateChannelUserTyping", [("flags", flags as Any), ("channelId", channelId as Any), ("topMsgId", topMsgId as Any), ("fromId", fromId as Any), ("action", action as Any)]) - case .updateChannelViewForumAsMessages(let channelId, let enabled): - return ("updateChannelViewForumAsMessages", [("channelId", channelId as Any), ("enabled", enabled as Any)]) - case .updateChannelWebPage(let channelId, let webpage, let pts, let ptsCount): - return ("updateChannelWebPage", [("channelId", channelId as Any), ("webpage", webpage as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateChat(let chatId): - return ("updateChat", [("chatId", chatId as Any)]) - case .updateChatDefaultBannedRights(let peer, let defaultBannedRights, let version): - return ("updateChatDefaultBannedRights", [("peer", peer as Any), ("defaultBannedRights", defaultBannedRights as Any), ("version", version as Any)]) - case .updateChatParticipant(let flags, let chatId, let date, let actorId, let userId, let prevParticipant, let newParticipant, let invite, let qts): - return ("updateChatParticipant", [("flags", flags as Any), ("chatId", chatId as Any), ("date", date as Any), ("actorId", actorId as Any), ("userId", userId as Any), ("prevParticipant", prevParticipant as Any), ("newParticipant", newParticipant as Any), ("invite", invite as Any), ("qts", qts as Any)]) - case .updateChatParticipantAdd(let chatId, let userId, let inviterId, let date, let version): - return ("updateChatParticipantAdd", [("chatId", chatId as Any), ("userId", userId as Any), ("inviterId", inviterId as Any), ("date", date as Any), ("version", version as Any)]) - case .updateChatParticipantAdmin(let chatId, let userId, let isAdmin, let version): - return ("updateChatParticipantAdmin", [("chatId", chatId as Any), ("userId", userId as Any), ("isAdmin", isAdmin as Any), ("version", version as Any)]) - case .updateChatParticipantDelete(let chatId, let userId, let version): - return ("updateChatParticipantDelete", [("chatId", chatId as Any), ("userId", userId as Any), ("version", version as Any)]) - case .updateChatParticipants(let participants): - return ("updateChatParticipants", [("participants", participants as Any)]) - case .updateChatUserTyping(let chatId, let fromId, let action): - return ("updateChatUserTyping", [("chatId", chatId as Any), ("fromId", fromId as Any), ("action", action as Any)]) - case .updateConfig: + case .updateBotBusinessConnect(let _data): + return ("updateBotBusinessConnect", [("connection", _data.connection as Any), ("qts", _data.qts as Any)]) + case .updateBotCallbackQuery(let _data): + return ("updateBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any), ("gameShortName", _data.gameShortName as Any)]) + case .updateBotChatBoost(let _data): + return ("updateBotChatBoost", [("peer", _data.peer as Any), ("boost", _data.boost as Any), ("qts", _data.qts as Any)]) + case .updateBotChatInviteRequester(let _data): + return ("updateBotChatInviteRequester", [("peer", _data.peer as Any), ("date", _data.date as Any), ("userId", _data.userId as Any), ("about", _data.about as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + case .updateBotCommands(let _data): + return ("updateBotCommands", [("peer", _data.peer as Any), ("botId", _data.botId as Any), ("commands", _data.commands as Any)]) + case .updateBotDeleteBusinessMessage(let _data): + return ("updateBotDeleteBusinessMessage", [("connectionId", _data.connectionId as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("qts", _data.qts as Any)]) + case .updateBotEditBusinessMessage(let _data): + return ("updateBotEditBusinessMessage", [("flags", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("qts", _data.qts as Any)]) + case .updateBotInlineQuery(let _data): + return ("updateBotInlineQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("query", _data.query as Any), ("geo", _data.geo as Any), ("peerType", _data.peerType as Any), ("offset", _data.offset as Any)]) + case .updateBotInlineSend(let _data): + return ("updateBotInlineSend", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("query", _data.query as Any), ("geo", _data.geo as Any), ("id", _data.id as Any), ("msgId", _data.msgId as Any)]) + case .updateBotMenuButton(let _data): + return ("updateBotMenuButton", [("botId", _data.botId as Any), ("button", _data.button as Any)]) + case .updateBotMessageReaction(let _data): + return ("updateBotMessageReaction", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("date", _data.date as Any), ("actor", _data.actor as Any), ("oldReactions", _data.oldReactions as Any), ("newReactions", _data.newReactions as Any), ("qts", _data.qts as Any)]) + case .updateBotMessageReactions(let _data): + return ("updateBotMessageReactions", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("date", _data.date as Any), ("reactions", _data.reactions as Any), ("qts", _data.qts as Any)]) + case .updateBotNewBusinessMessage(let _data): + return ("updateBotNewBusinessMessage", [("flags", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("qts", _data.qts as Any)]) + case .updateBotPrecheckoutQuery(let _data): + return ("updateBotPrecheckoutQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("payload", _data.payload as Any), ("info", _data.info as Any), ("shippingOptionId", _data.shippingOptionId as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any)]) + case .updateBotPurchasedPaidMedia(let _data): + return ("updateBotPurchasedPaidMedia", [("userId", _data.userId as Any), ("payload", _data.payload as Any), ("qts", _data.qts as Any)]) + case .updateBotShippingQuery(let _data): + return ("updateBotShippingQuery", [("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("payload", _data.payload as Any), ("shippingAddress", _data.shippingAddress as Any)]) + case .updateBotStopped(let _data): + return ("updateBotStopped", [("userId", _data.userId as Any), ("date", _data.date as Any), ("stopped", _data.stopped as Any), ("qts", _data.qts as Any)]) + case .updateBotWebhookJSON(let _data): + return ("updateBotWebhookJSON", [("data", _data.data as Any)]) + case .updateBotWebhookJSONQuery(let _data): + return ("updateBotWebhookJSONQuery", [("queryId", _data.queryId as Any), ("data", _data.data as Any), ("timeout", _data.timeout as Any)]) + case .updateBusinessBotCallbackQuery(let _data): + return ("updateBusinessBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any)]) + case .updateChannel(let _data): + return ("updateChannel", [("channelId", _data.channelId as Any)]) + case .updateChannelAvailableMessages(let _data): + return ("updateChannelAvailableMessages", [("channelId", _data.channelId as Any), ("availableMinId", _data.availableMinId as Any)]) + case .updateChannelMessageForwards(let _data): + return ("updateChannelMessageForwards", [("channelId", _data.channelId as Any), ("id", _data.id as Any), ("forwards", _data.forwards as Any)]) + case .updateChannelMessageViews(let _data): + return ("updateChannelMessageViews", [("channelId", _data.channelId as Any), ("id", _data.id as Any), ("views", _data.views as Any)]) + case .updateChannelParticipant(let _data): + return ("updateChannelParticipant", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("date", _data.date as Any), ("actorId", _data.actorId as Any), ("userId", _data.userId as Any), ("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + case .updateChannelReadMessagesContents(let _data): + return ("updateChannelReadMessagesContents", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("messages", _data.messages as Any)]) + case .updateChannelTooLong(let _data): + return ("updateChannelTooLong", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("pts", _data.pts as Any)]) + case .updateChannelUserTyping(let _data): + return ("updateChannelUserTyping", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("fromId", _data.fromId as Any), ("action", _data.action as Any)]) + case .updateChannelViewForumAsMessages(let _data): + return ("updateChannelViewForumAsMessages", [("channelId", _data.channelId as Any), ("enabled", _data.enabled as Any)]) + case .updateChannelWebPage(let _data): + return ("updateChannelWebPage", [("channelId", _data.channelId as Any), ("webpage", _data.webpage as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateChat(let _data): + return ("updateChat", [("chatId", _data.chatId as Any)]) + case .updateChatDefaultBannedRights(let _data): + return ("updateChatDefaultBannedRights", [("peer", _data.peer as Any), ("defaultBannedRights", _data.defaultBannedRights as Any), ("version", _data.version as Any)]) + case .updateChatParticipant(let _data): + return ("updateChatParticipant", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("actorId", _data.actorId as Any), ("userId", _data.userId as Any), ("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + case .updateChatParticipantAdd(let _data): + return ("updateChatParticipantAdd", [("chatId", _data.chatId as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("version", _data.version as Any)]) + case .updateChatParticipantAdmin(let _data): + return ("updateChatParticipantAdmin", [("chatId", _data.chatId as Any), ("userId", _data.userId as Any), ("isAdmin", _data.isAdmin as Any), ("version", _data.version as Any)]) + case .updateChatParticipantDelete(let _data): + return ("updateChatParticipantDelete", [("chatId", _data.chatId as Any), ("userId", _data.userId as Any), ("version", _data.version as Any)]) + case .updateChatParticipants(let _data): + return ("updateChatParticipants", [("participants", _data.participants as Any)]) + case .updateChatUserTyping(let _data): + return ("updateChatUserTyping", [("chatId", _data.chatId as Any), ("fromId", _data.fromId as Any), ("action", _data.action as Any)]) + case .updateConfig: return ("updateConfig", []) - case .updateContactsReset: + case .updateContactsReset: return ("updateContactsReset", []) - case .updateDcOptions(let dcOptions): - return ("updateDcOptions", [("dcOptions", dcOptions as Any)]) - case .updateDeleteChannelMessages(let channelId, let messages, let pts, let ptsCount): - return ("updateDeleteChannelMessages", [("channelId", channelId as Any), ("messages", messages as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateDeleteGroupCallMessages(let call, let messages): - return ("updateDeleteGroupCallMessages", [("call", call as Any), ("messages", messages as Any)]) - case .updateDeleteMessages(let messages, let pts, let ptsCount): - return ("updateDeleteMessages", [("messages", messages as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateDeleteQuickReply(let shortcutId): - return ("updateDeleteQuickReply", [("shortcutId", shortcutId as Any)]) - case .updateDeleteQuickReplyMessages(let shortcutId, let messages): - return ("updateDeleteQuickReplyMessages", [("shortcutId", shortcutId as Any), ("messages", messages as Any)]) - case .updateDeleteScheduledMessages(let flags, let peer, let messages, let sentMessages): - return ("updateDeleteScheduledMessages", [("flags", flags as Any), ("peer", peer as Any), ("messages", messages as Any), ("sentMessages", sentMessages as Any)]) - case .updateDialogFilter(let flags, let id, let filter): - return ("updateDialogFilter", [("flags", flags as Any), ("id", id as Any), ("filter", filter as Any)]) - case .updateDialogFilterOrder(let order): - return ("updateDialogFilterOrder", [("order", order as Any)]) - case .updateDialogFilters: + case .updateDcOptions(let _data): + return ("updateDcOptions", [("dcOptions", _data.dcOptions as Any)]) + case .updateDeleteChannelMessages(let _data): + return ("updateDeleteChannelMessages", [("channelId", _data.channelId as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateDeleteGroupCallMessages(let _data): + return ("updateDeleteGroupCallMessages", [("call", _data.call as Any), ("messages", _data.messages as Any)]) + case .updateDeleteMessages(let _data): + return ("updateDeleteMessages", [("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateDeleteQuickReply(let _data): + return ("updateDeleteQuickReply", [("shortcutId", _data.shortcutId as Any)]) + case .updateDeleteQuickReplyMessages(let _data): + return ("updateDeleteQuickReplyMessages", [("shortcutId", _data.shortcutId as Any), ("messages", _data.messages as Any)]) + case .updateDeleteScheduledMessages(let _data): + return ("updateDeleteScheduledMessages", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("sentMessages", _data.sentMessages as Any)]) + case .updateDialogFilter(let _data): + return ("updateDialogFilter", [("flags", _data.flags as Any), ("id", _data.id as Any), ("filter", _data.filter as Any)]) + case .updateDialogFilterOrder(let _data): + return ("updateDialogFilterOrder", [("order", _data.order as Any)]) + case .updateDialogFilters: return ("updateDialogFilters", []) - case .updateDialogPinned(let flags, let folderId, let peer): - return ("updateDialogPinned", [("flags", flags as Any), ("folderId", folderId as Any), ("peer", peer as Any)]) - case .updateDialogUnreadMark(let flags, let peer, let savedPeerId): - return ("updateDialogUnreadMark", [("flags", flags as Any), ("peer", peer as Any), ("savedPeerId", savedPeerId as Any)]) - case .updateDraftMessage(let flags, let peer, let topMsgId, let savedPeerId, let draft): - return ("updateDraftMessage", [("flags", flags as Any), ("peer", peer as Any), ("topMsgId", topMsgId as Any), ("savedPeerId", savedPeerId as Any), ("draft", draft as Any)]) - case .updateEditChannelMessage(let message, let pts, let ptsCount): - return ("updateEditChannelMessage", [("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateEditMessage(let message, let pts, let ptsCount): - return ("updateEditMessage", [("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateEmojiGameInfo(let info): - return ("updateEmojiGameInfo", [("info", info as Any)]) - case .updateEncryptedChatTyping(let chatId): - return ("updateEncryptedChatTyping", [("chatId", chatId as Any)]) - case .updateEncryptedMessagesRead(let chatId, let maxDate, let date): - return ("updateEncryptedMessagesRead", [("chatId", chatId as Any), ("maxDate", maxDate as Any), ("date", date as Any)]) - case .updateEncryption(let chat, let date): - return ("updateEncryption", [("chat", chat as Any), ("date", date as Any)]) - case .updateFavedStickers: + case .updateDialogPinned(let _data): + return ("updateDialogPinned", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("peer", _data.peer as Any)]) + case .updateDialogUnreadMark(let _data): + return ("updateDialogUnreadMark", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("savedPeerId", _data.savedPeerId as Any)]) + case .updateDraftMessage(let _data): + return ("updateDraftMessage", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("draft", _data.draft as Any)]) + case .updateEditChannelMessage(let _data): + return ("updateEditChannelMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateEditMessage(let _data): + return ("updateEditMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateEmojiGameInfo(let _data): + return ("updateEmojiGameInfo", [("info", _data.info as Any)]) + case .updateEncryptedChatTyping(let _data): + return ("updateEncryptedChatTyping", [("chatId", _data.chatId as Any)]) + case .updateEncryptedMessagesRead(let _data): + return ("updateEncryptedMessagesRead", [("chatId", _data.chatId as Any), ("maxDate", _data.maxDate as Any), ("date", _data.date as Any)]) + case .updateEncryption(let _data): + return ("updateEncryption", [("chat", _data.chat as Any), ("date", _data.date as Any)]) + case .updateFavedStickers: return ("updateFavedStickers", []) - case .updateFolderPeers(let folderPeers, let pts, let ptsCount): - return ("updateFolderPeers", [("folderPeers", folderPeers as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateGeoLiveViewed(let peer, let msgId): - return ("updateGeoLiveViewed", [("peer", peer as Any), ("msgId", msgId as Any)]) - case .updateGroupCall(let flags, let peer, let call): - return ("updateGroupCall", [("flags", flags as Any), ("peer", peer as Any), ("call", call as Any)]) - case .updateGroupCallChainBlocks(let call, let subChainId, let blocks, let nextOffset): - return ("updateGroupCallChainBlocks", [("call", call as Any), ("subChainId", subChainId as Any), ("blocks", blocks as Any), ("nextOffset", nextOffset as Any)]) - case .updateGroupCallConnection(let flags, let params): - return ("updateGroupCallConnection", [("flags", flags as Any), ("params", params as Any)]) - case .updateGroupCallEncryptedMessage(let call, let fromId, let encryptedMessage): - return ("updateGroupCallEncryptedMessage", [("call", call as Any), ("fromId", fromId as Any), ("encryptedMessage", encryptedMessage as Any)]) - case .updateGroupCallMessage(let call, let message): - return ("updateGroupCallMessage", [("call", call as Any), ("message", message as Any)]) - case .updateGroupCallParticipants(let call, let participants, let version): - return ("updateGroupCallParticipants", [("call", call as Any), ("participants", participants as Any), ("version", version as Any)]) - case .updateInlineBotCallbackQuery(let flags, let queryId, let userId, let msgId, let chatInstance, let data, let gameShortName): - return ("updateInlineBotCallbackQuery", [("flags", flags as Any), ("queryId", queryId as Any), ("userId", userId as Any), ("msgId", msgId as Any), ("chatInstance", chatInstance as Any), ("data", data as Any), ("gameShortName", gameShortName as Any)]) - case .updateLangPack(let difference): - return ("updateLangPack", [("difference", difference as Any)]) - case .updateLangPackTooLong(let langCode): - return ("updateLangPackTooLong", [("langCode", langCode as Any)]) - case .updateLoginToken: + case .updateFolderPeers(let _data): + return ("updateFolderPeers", [("folderPeers", _data.folderPeers as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateGeoLiveViewed(let _data): + return ("updateGeoLiveViewed", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any)]) + case .updateGroupCall(let _data): + return ("updateGroupCall", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("call", _data.call as Any)]) + case .updateGroupCallChainBlocks(let _data): + return ("updateGroupCallChainBlocks", [("call", _data.call as Any), ("subChainId", _data.subChainId as Any), ("blocks", _data.blocks as Any), ("nextOffset", _data.nextOffset as Any)]) + case .updateGroupCallConnection(let _data): + return ("updateGroupCallConnection", [("flags", _data.flags as Any), ("params", _data.params as Any)]) + case .updateGroupCallEncryptedMessage(let _data): + return ("updateGroupCallEncryptedMessage", [("call", _data.call as Any), ("fromId", _data.fromId as Any), ("encryptedMessage", _data.encryptedMessage as Any)]) + case .updateGroupCallMessage(let _data): + return ("updateGroupCallMessage", [("call", _data.call as Any), ("message", _data.message as Any)]) + case .updateGroupCallParticipants(let _data): + return ("updateGroupCallParticipants", [("call", _data.call as Any), ("participants", _data.participants as Any), ("version", _data.version as Any)]) + case .updateInlineBotCallbackQuery(let _data): + return ("updateInlineBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("msgId", _data.msgId as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any), ("gameShortName", _data.gameShortName as Any)]) + case .updateLangPack(let _data): + return ("updateLangPack", [("difference", _data.difference as Any)]) + case .updateLangPackTooLong(let _data): + return ("updateLangPackTooLong", [("langCode", _data.langCode as Any)]) + case .updateLoginToken: return ("updateLoginToken", []) - case .updateMessageExtendedMedia(let peer, let msgId, let extendedMedia): - return ("updateMessageExtendedMedia", [("peer", peer as Any), ("msgId", msgId as Any), ("extendedMedia", extendedMedia as Any)]) - case .updateMessageID(let id, let randomId): - return ("updateMessageID", [("id", id as Any), ("randomId", randomId as Any)]) - case .updateMessagePoll(let flags, let pollId, let poll, let results): - return ("updateMessagePoll", [("flags", flags as Any), ("pollId", pollId as Any), ("poll", poll as Any), ("results", results as Any)]) - case .updateMessagePollVote(let pollId, let peer, let options, let qts): - return ("updateMessagePollVote", [("pollId", pollId as Any), ("peer", peer as Any), ("options", options as Any), ("qts", qts as Any)]) - case .updateMessageReactions(let flags, let peer, let msgId, let topMsgId, let savedPeerId, let reactions): - return ("updateMessageReactions", [("flags", flags as Any), ("peer", peer as Any), ("msgId", msgId as Any), ("topMsgId", topMsgId as Any), ("savedPeerId", savedPeerId as Any), ("reactions", reactions as Any)]) - case .updateMonoForumNoPaidException(let flags, let channelId, let savedPeerId): - return ("updateMonoForumNoPaidException", [("flags", flags as Any), ("channelId", channelId as Any), ("savedPeerId", savedPeerId as Any)]) - case .updateMoveStickerSetToTop(let flags, let stickerset): - return ("updateMoveStickerSetToTop", [("flags", flags as Any), ("stickerset", stickerset as Any)]) - case .updateNewAuthorization(let flags, let hash, let date, let device, let location): - return ("updateNewAuthorization", [("flags", flags as Any), ("hash", hash as Any), ("date", date as Any), ("device", device as Any), ("location", location as Any)]) - case .updateNewChannelMessage(let message, let pts, let ptsCount): - return ("updateNewChannelMessage", [("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateNewEncryptedMessage(let message, let qts): - return ("updateNewEncryptedMessage", [("message", message as Any), ("qts", qts as Any)]) - case .updateNewMessage(let message, let pts, let ptsCount): - return ("updateNewMessage", [("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateNewQuickReply(let quickReply): - return ("updateNewQuickReply", [("quickReply", quickReply as Any)]) - case .updateNewScheduledMessage(let message): - return ("updateNewScheduledMessage", [("message", message as Any)]) - case .updateNewStickerSet(let stickerset): - return ("updateNewStickerSet", [("stickerset", stickerset as Any)]) - case .updateNewStoryReaction(let storyId, let peer, let reaction): - return ("updateNewStoryReaction", [("storyId", storyId as Any), ("peer", peer as Any), ("reaction", reaction as Any)]) - case .updateNotifySettings(let peer, let notifySettings): - return ("updateNotifySettings", [("peer", peer as Any), ("notifySettings", notifySettings as Any)]) - case .updatePaidReactionPrivacy(let `private`): - return ("updatePaidReactionPrivacy", [("`private`", `private` as Any)]) - case .updatePeerBlocked(let flags, let peerId): - return ("updatePeerBlocked", [("flags", flags as Any), ("peerId", peerId as Any)]) - case .updatePeerHistoryTTL(let flags, let peer, let ttlPeriod): - return ("updatePeerHistoryTTL", [("flags", flags as Any), ("peer", peer as Any), ("ttlPeriod", ttlPeriod as Any)]) - case .updatePeerLocated(let peers): - return ("updatePeerLocated", [("peers", peers as Any)]) - case .updatePeerSettings(let peer, let settings): - return ("updatePeerSettings", [("peer", peer as Any), ("settings", settings as Any)]) - case .updatePeerWallpaper(let flags, let peer, let wallpaper): - return ("updatePeerWallpaper", [("flags", flags as Any), ("peer", peer as Any), ("wallpaper", wallpaper as Any)]) - case .updatePendingJoinRequests(let peer, let requestsPending, let recentRequesters): - return ("updatePendingJoinRequests", [("peer", peer as Any), ("requestsPending", requestsPending as Any), ("recentRequesters", recentRequesters as Any)]) - case .updatePhoneCall(let phoneCall): - return ("updatePhoneCall", [("phoneCall", phoneCall as Any)]) - case .updatePhoneCallSignalingData(let phoneCallId, let data): - return ("updatePhoneCallSignalingData", [("phoneCallId", phoneCallId as Any), ("data", data as Any)]) - case .updatePinnedChannelMessages(let flags, let channelId, let messages, let pts, let ptsCount): - return ("updatePinnedChannelMessages", [("flags", flags as Any), ("channelId", channelId as Any), ("messages", messages as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updatePinnedDialogs(let flags, let folderId, let order): - return ("updatePinnedDialogs", [("flags", flags as Any), ("folderId", folderId as Any), ("order", order as Any)]) - case .updatePinnedForumTopic(let flags, let peer, let topicId): - return ("updatePinnedForumTopic", [("flags", flags as Any), ("peer", peer as Any), ("topicId", topicId as Any)]) - case .updatePinnedForumTopics(let flags, let peer, let order): - return ("updatePinnedForumTopics", [("flags", flags as Any), ("peer", peer as Any), ("order", order as Any)]) - case .updatePinnedMessages(let flags, let peer, let messages, let pts, let ptsCount): - return ("updatePinnedMessages", [("flags", flags as Any), ("peer", peer as Any), ("messages", messages as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updatePinnedSavedDialogs(let flags, let order): - return ("updatePinnedSavedDialogs", [("flags", flags as Any), ("order", order as Any)]) - case .updatePrivacy(let key, let rules): - return ("updatePrivacy", [("key", key as Any), ("rules", rules as Any)]) - case .updatePtsChanged: + case .updateMessageExtendedMedia(let _data): + return ("updateMessageExtendedMedia", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("extendedMedia", _data.extendedMedia as Any)]) + case .updateMessageID(let _data): + return ("updateMessageID", [("id", _data.id as Any), ("randomId", _data.randomId as Any)]) + case .updateMessagePoll(let _data): + return ("updateMessagePoll", [("flags", _data.flags as Any), ("pollId", _data.pollId as Any), ("poll", _data.poll as Any), ("results", _data.results as Any)]) + case .updateMessagePollVote(let _data): + return ("updateMessagePollVote", [("pollId", _data.pollId as Any), ("peer", _data.peer as Any), ("options", _data.options as Any), ("qts", _data.qts as Any)]) + case .updateMessageReactions(let _data): + return ("updateMessageReactions", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("reactions", _data.reactions as Any)]) + case .updateMonoForumNoPaidException(let _data): + return ("updateMonoForumNoPaidException", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any)]) + case .updateMoveStickerSetToTop(let _data): + return ("updateMoveStickerSetToTop", [("flags", _data.flags as Any), ("stickerset", _data.stickerset as Any)]) + case .updateNewAuthorization(let _data): + return ("updateNewAuthorization", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("date", _data.date as Any), ("device", _data.device as Any), ("location", _data.location as Any)]) + case .updateNewChannelMessage(let _data): + return ("updateNewChannelMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateNewEncryptedMessage(let _data): + return ("updateNewEncryptedMessage", [("message", _data.message as Any), ("qts", _data.qts as Any)]) + case .updateNewMessage(let _data): + return ("updateNewMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateNewQuickReply(let _data): + return ("updateNewQuickReply", [("quickReply", _data.quickReply as Any)]) + case .updateNewScheduledMessage(let _data): + return ("updateNewScheduledMessage", [("message", _data.message as Any)]) + case .updateNewStickerSet(let _data): + return ("updateNewStickerSet", [("stickerset", _data.stickerset as Any)]) + case .updateNewStoryReaction(let _data): + return ("updateNewStoryReaction", [("storyId", _data.storyId as Any), ("peer", _data.peer as Any), ("reaction", _data.reaction as Any)]) + case .updateNotifySettings(let _data): + return ("updateNotifySettings", [("peer", _data.peer as Any), ("notifySettings", _data.notifySettings as Any)]) + case .updatePaidReactionPrivacy(let _data): + return ("updatePaidReactionPrivacy", [("`private`", _data.`private` as Any)]) + case .updatePeerBlocked(let _data): + return ("updatePeerBlocked", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any)]) + case .updatePeerHistoryTTL(let _data): + return ("updatePeerHistoryTTL", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + case .updatePeerLocated(let _data): + return ("updatePeerLocated", [("peers", _data.peers as Any)]) + case .updatePeerSettings(let _data): + return ("updatePeerSettings", [("peer", _data.peer as Any), ("settings", _data.settings as Any)]) + case .updatePeerWallpaper(let _data): + return ("updatePeerWallpaper", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("wallpaper", _data.wallpaper as Any)]) + case .updatePendingJoinRequests(let _data): + return ("updatePendingJoinRequests", [("peer", _data.peer as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any)]) + case .updatePhoneCall(let _data): + return ("updatePhoneCall", [("phoneCall", _data.phoneCall as Any)]) + case .updatePhoneCallSignalingData(let _data): + return ("updatePhoneCallSignalingData", [("phoneCallId", _data.phoneCallId as Any), ("data", _data.data as Any)]) + case .updatePinnedChannelMessages(let _data): + return ("updatePinnedChannelMessages", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updatePinnedDialogs(let _data): + return ("updatePinnedDialogs", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("order", _data.order as Any)]) + case .updatePinnedForumTopic(let _data): + return ("updatePinnedForumTopic", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topicId", _data.topicId as Any)]) + case .updatePinnedForumTopics(let _data): + return ("updatePinnedForumTopics", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("order", _data.order as Any)]) + case .updatePinnedMessages(let _data): + return ("updatePinnedMessages", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updatePinnedSavedDialogs(let _data): + return ("updatePinnedSavedDialogs", [("flags", _data.flags as Any), ("order", _data.order as Any)]) + case .updatePrivacy(let _data): + return ("updatePrivacy", [("key", _data.key as Any), ("rules", _data.rules as Any)]) + case .updatePtsChanged: return ("updatePtsChanged", []) - case .updateQuickReplies(let quickReplies): - return ("updateQuickReplies", [("quickReplies", quickReplies as Any)]) - case .updateQuickReplyMessage(let message): - return ("updateQuickReplyMessage", [("message", message as Any)]) - case .updateReadChannelDiscussionInbox(let flags, let channelId, let topMsgId, let readMaxId, let broadcastId, let broadcastPost): - return ("updateReadChannelDiscussionInbox", [("flags", flags as Any), ("channelId", channelId as Any), ("topMsgId", topMsgId as Any), ("readMaxId", readMaxId as Any), ("broadcastId", broadcastId as Any), ("broadcastPost", broadcastPost as Any)]) - case .updateReadChannelDiscussionOutbox(let channelId, let topMsgId, let readMaxId): - return ("updateReadChannelDiscussionOutbox", [("channelId", channelId as Any), ("topMsgId", topMsgId as Any), ("readMaxId", readMaxId as Any)]) - case .updateReadChannelInbox(let flags, let folderId, let channelId, let maxId, let stillUnreadCount, let pts): - return ("updateReadChannelInbox", [("flags", flags as Any), ("folderId", folderId as Any), ("channelId", channelId as Any), ("maxId", maxId as Any), ("stillUnreadCount", stillUnreadCount as Any), ("pts", pts as Any)]) - case .updateReadChannelOutbox(let channelId, let maxId): - return ("updateReadChannelOutbox", [("channelId", channelId as Any), ("maxId", maxId as Any)]) - case .updateReadFeaturedEmojiStickers: + case .updateQuickReplies(let _data): + return ("updateQuickReplies", [("quickReplies", _data.quickReplies as Any)]) + case .updateQuickReplyMessage(let _data): + return ("updateQuickReplyMessage", [("message", _data.message as Any)]) + case .updateReadChannelDiscussionInbox(let _data): + return ("updateReadChannelDiscussionInbox", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("readMaxId", _data.readMaxId as Any), ("broadcastId", _data.broadcastId as Any), ("broadcastPost", _data.broadcastPost as Any)]) + case .updateReadChannelDiscussionOutbox(let _data): + return ("updateReadChannelDiscussionOutbox", [("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("readMaxId", _data.readMaxId as Any)]) + case .updateReadChannelInbox(let _data): + return ("updateReadChannelInbox", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("channelId", _data.channelId as Any), ("maxId", _data.maxId as Any), ("stillUnreadCount", _data.stillUnreadCount as Any), ("pts", _data.pts as Any)]) + case .updateReadChannelOutbox(let _data): + return ("updateReadChannelOutbox", [("channelId", _data.channelId as Any), ("maxId", _data.maxId as Any)]) + case .updateReadFeaturedEmojiStickers: return ("updateReadFeaturedEmojiStickers", []) - case .updateReadFeaturedStickers: + case .updateReadFeaturedStickers: return ("updateReadFeaturedStickers", []) - case .updateReadHistoryInbox(let flags, let folderId, let peer, let topMsgId, let maxId, let stillUnreadCount, let pts, let ptsCount): - return ("updateReadHistoryInbox", [("flags", flags as Any), ("folderId", folderId as Any), ("peer", peer as Any), ("topMsgId", topMsgId as Any), ("maxId", maxId as Any), ("stillUnreadCount", stillUnreadCount as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateReadHistoryOutbox(let peer, let maxId, let pts, let ptsCount): - return ("updateReadHistoryOutbox", [("peer", peer as Any), ("maxId", maxId as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateReadMessagesContents(let flags, let messages, let pts, let ptsCount, let date): - return ("updateReadMessagesContents", [("flags", flags as Any), ("messages", messages as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any), ("date", date as Any)]) - case .updateReadMonoForumInbox(let channelId, let savedPeerId, let readMaxId): - return ("updateReadMonoForumInbox", [("channelId", channelId as Any), ("savedPeerId", savedPeerId as Any), ("readMaxId", readMaxId as Any)]) - case .updateReadMonoForumOutbox(let channelId, let savedPeerId, let readMaxId): - return ("updateReadMonoForumOutbox", [("channelId", channelId as Any), ("savedPeerId", savedPeerId as Any), ("readMaxId", readMaxId as Any)]) - case .updateReadStories(let peer, let maxId): - return ("updateReadStories", [("peer", peer as Any), ("maxId", maxId as Any)]) - case .updateRecentEmojiStatuses: + case .updateReadHistoryInbox(let _data): + return ("updateReadHistoryInbox", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any), ("maxId", _data.maxId as Any), ("stillUnreadCount", _data.stillUnreadCount as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateReadHistoryOutbox(let _data): + return ("updateReadHistoryOutbox", [("peer", _data.peer as Any), ("maxId", _data.maxId as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateReadMessagesContents(let _data): + return ("updateReadMessagesContents", [("flags", _data.flags as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any)]) + case .updateReadMonoForumInbox(let _data): + return ("updateReadMonoForumInbox", [("channelId", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any), ("readMaxId", _data.readMaxId as Any)]) + case .updateReadMonoForumOutbox(let _data): + return ("updateReadMonoForumOutbox", [("channelId", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any), ("readMaxId", _data.readMaxId as Any)]) + case .updateReadStories(let _data): + return ("updateReadStories", [("peer", _data.peer as Any), ("maxId", _data.maxId as Any)]) + case .updateRecentEmojiStatuses: return ("updateRecentEmojiStatuses", []) - case .updateRecentReactions: + case .updateRecentReactions: return ("updateRecentReactions", []) - case .updateRecentStickers: + case .updateRecentStickers: return ("updateRecentStickers", []) - case .updateSavedDialogPinned(let flags, let peer): - return ("updateSavedDialogPinned", [("flags", flags as Any), ("peer", peer as Any)]) - case .updateSavedGifs: + case .updateSavedDialogPinned(let _data): + return ("updateSavedDialogPinned", [("flags", _data.flags as Any), ("peer", _data.peer as Any)]) + case .updateSavedGifs: return ("updateSavedGifs", []) - case .updateSavedReactionTags: + case .updateSavedReactionTags: return ("updateSavedReactionTags", []) - case .updateSavedRingtones: + case .updateSavedRingtones: return ("updateSavedRingtones", []) - case .updateSentPhoneCode(let sentCode): - return ("updateSentPhoneCode", [("sentCode", sentCode as Any)]) - case .updateSentStoryReaction(let peer, let storyId, let reaction): - return ("updateSentStoryReaction", [("peer", peer as Any), ("storyId", storyId as Any), ("reaction", reaction as Any)]) - case .updateServiceNotification(let flags, let inboxDate, let type, let message, let media, let entities): - return ("updateServiceNotification", [("flags", flags as Any), ("inboxDate", inboxDate as Any), ("type", type as Any), ("message", message as Any), ("media", media as Any), ("entities", entities as Any)]) - case .updateSmsJob(let jobId): - return ("updateSmsJob", [("jobId", jobId as Any)]) - case .updateStarGiftAuctionState(let giftId, let state): - return ("updateStarGiftAuctionState", [("giftId", giftId as Any), ("state", state as Any)]) - case .updateStarGiftAuctionUserState(let giftId, let userState): - return ("updateStarGiftAuctionUserState", [("giftId", giftId as Any), ("userState", userState as Any)]) - case .updateStarGiftCraftFail: + case .updateSentPhoneCode(let _data): + return ("updateSentPhoneCode", [("sentCode", _data.sentCode as Any)]) + case .updateSentStoryReaction(let _data): + return ("updateSentStoryReaction", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any), ("reaction", _data.reaction as Any)]) + case .updateServiceNotification(let _data): + return ("updateServiceNotification", [("flags", _data.flags as Any), ("inboxDate", _data.inboxDate as Any), ("type", _data.type as Any), ("message", _data.message as Any), ("media", _data.media as Any), ("entities", _data.entities as Any)]) + case .updateSmsJob(let _data): + return ("updateSmsJob", [("jobId", _data.jobId as Any)]) + case .updateStarGiftAuctionState(let _data): + return ("updateStarGiftAuctionState", [("giftId", _data.giftId as Any), ("state", _data.state as Any)]) + case .updateStarGiftAuctionUserState(let _data): + return ("updateStarGiftAuctionUserState", [("giftId", _data.giftId as Any), ("userState", _data.userState as Any)]) + case .updateStarGiftCraftFail: return ("updateStarGiftCraftFail", []) - case .updateStarsBalance(let balance): - return ("updateStarsBalance", [("balance", balance as Any)]) - case .updateStarsRevenueStatus(let peer, let status): - return ("updateStarsRevenueStatus", [("peer", peer as Any), ("status", status as Any)]) - case .updateStickerSets(let flags): - return ("updateStickerSets", [("flags", flags as Any)]) - case .updateStickerSetsOrder(let flags, let order): - return ("updateStickerSetsOrder", [("flags", flags as Any), ("order", order as Any)]) - case .updateStoriesStealthMode(let stealthMode): - return ("updateStoriesStealthMode", [("stealthMode", stealthMode as Any)]) - case .updateStory(let peer, let story): - return ("updateStory", [("peer", peer as Any), ("story", story as Any)]) - case .updateStoryID(let id, let randomId): - return ("updateStoryID", [("id", id as Any), ("randomId", randomId as Any)]) - case .updateTheme(let theme): - return ("updateTheme", [("theme", theme as Any)]) - case .updateTranscribedAudio(let flags, let peer, let msgId, let transcriptionId, let text): - return ("updateTranscribedAudio", [("flags", flags as Any), ("peer", peer as Any), ("msgId", msgId as Any), ("transcriptionId", transcriptionId as Any), ("text", text as Any)]) - case .updateUser(let userId): - return ("updateUser", [("userId", userId as Any)]) - case .updateUserEmojiStatus(let userId, let emojiStatus): - return ("updateUserEmojiStatus", [("userId", userId as Any), ("emojiStatus", emojiStatus as Any)]) - case .updateUserName(let userId, let firstName, let lastName, let usernames): - return ("updateUserName", [("userId", userId as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("usernames", usernames as Any)]) - case .updateUserPhone(let userId, let phone): - return ("updateUserPhone", [("userId", userId as Any), ("phone", phone as Any)]) - case .updateUserStatus(let userId, let status): - return ("updateUserStatus", [("userId", userId as Any), ("status", status as Any)]) - case .updateUserTyping(let flags, let userId, let topMsgId, let action): - return ("updateUserTyping", [("flags", flags as Any), ("userId", userId as Any), ("topMsgId", topMsgId as Any), ("action", action as Any)]) - case .updateWebPage(let webpage, let pts, let ptsCount): - return ("updateWebPage", [("webpage", webpage as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - case .updateWebViewResultSent(let queryId): - return ("updateWebViewResultSent", [("queryId", queryId as Any)]) - } - } - + case .updateStarsBalance(let _data): + return ("updateStarsBalance", [("balance", _data.balance as Any)]) + case .updateStarsRevenueStatus(let _data): + return ("updateStarsRevenueStatus", [("peer", _data.peer as Any), ("status", _data.status as Any)]) + case .updateStickerSets(let _data): + return ("updateStickerSets", [("flags", _data.flags as Any)]) + case .updateStickerSetsOrder(let _data): + return ("updateStickerSetsOrder", [("flags", _data.flags as Any), ("order", _data.order as Any)]) + case .updateStoriesStealthMode(let _data): + return ("updateStoriesStealthMode", [("stealthMode", _data.stealthMode as Any)]) + case .updateStory(let _data): + return ("updateStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) + case .updateStoryID(let _data): + return ("updateStoryID", [("id", _data.id as Any), ("randomId", _data.randomId as Any)]) + case .updateTheme(let _data): + return ("updateTheme", [("theme", _data.theme as Any)]) + case .updateTranscribedAudio(let _data): + return ("updateTranscribedAudio", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("transcriptionId", _data.transcriptionId as Any), ("text", _data.text as Any)]) + case .updateUser(let _data): + return ("updateUser", [("userId", _data.userId as Any)]) + case .updateUserEmojiStatus(let _data): + return ("updateUserEmojiStatus", [("userId", _data.userId as Any), ("emojiStatus", _data.emojiStatus as Any)]) + case .updateUserName(let _data): + return ("updateUserName", [("userId", _data.userId as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("usernames", _data.usernames as Any)]) + case .updateUserPhone(let _data): + return ("updateUserPhone", [("userId", _data.userId as Any), ("phone", _data.phone as Any)]) + case .updateUserStatus(let _data): + return ("updateUserStatus", [("userId", _data.userId as Any), ("status", _data.status as Any)]) + case .updateUserTyping(let _data): + return ("updateUserTyping", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("topMsgId", _data.topMsgId as Any), ("action", _data.action as Any)]) + case .updateWebPage(let _data): + return ("updateWebPage", [("webpage", _data.webpage as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + case .updateWebViewResultSent(let _data): + return ("updateWebViewResultSent", [("queryId", _data.queryId as Any)]) + } + } + public static func parse_updateAttachMenuBots(_ reader: BufferReader) -> Update? { return Api.Update.updateAttachMenuBots } @@ -1807,7 +3270,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateBotBusinessConnect(connection: _1!, qts: _2!) + return Api.Update.updateBotBusinessConnect(Cons_updateBotBusinessConnect(connection: _1!, qts: _2!)) } else { return nil @@ -1829,9 +3292,13 @@ public extension Api { var _6: Int64? _6 = reader.readInt64() var _7: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_7 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = parseBytes(reader) + } var _8: String? - if Int(_1!) & Int(1 << 1) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _8 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1841,7 +3308,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 1) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Update.updateBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, peer: _4!, msgId: _5!, chatInstance: _6!, data: _7, gameShortName: _8) + return Api.Update.updateBotCallbackQuery(Cons_updateBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, peer: _4!, msgId: _5!, chatInstance: _6!, data: _7, gameShortName: _8)) } else { return nil @@ -1862,7 +3329,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateBotChatBoost(peer: _1!, boost: _2!, qts: _3!) + return Api.Update.updateBotChatBoost(Cons_updateBotChatBoost(peer: _1!, boost: _2!, qts: _3!)) } else { return nil @@ -1892,7 +3359,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateBotChatInviteRequester(peer: _1!, date: _2!, userId: _3!, about: _4!, invite: _5!, qts: _6!) + return Api.Update.updateBotChatInviteRequester(Cons_updateBotChatInviteRequester(peer: _1!, date: _2!, userId: _3!, about: _4!, invite: _5!, qts: _6!)) } else { return nil @@ -1913,7 +3380,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateBotCommands(peer: _1!, botId: _2!, commands: _3!) + return Api.Update.updateBotCommands(Cons_updateBotCommands(peer: _1!, botId: _2!, commands: _3!)) } else { return nil @@ -1937,7 +3404,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotDeleteBusinessMessage(connectionId: _1!, peer: _2!, messages: _3!, qts: _4!) + return Api.Update.updateBotDeleteBusinessMessage(Cons_updateBotDeleteBusinessMessage(connectionId: _1!, peer: _2!, messages: _3!, qts: _4!)) } else { return nil @@ -1953,9 +3420,11 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.Message } var _4: Api.Message? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Message - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Message + } + } var _5: Int32? _5 = reader.readInt32() let _c1 = _1 != nil @@ -1964,7 +3433,7 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotEditBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!) + return Api.Update.updateBotEditBusinessMessage(Cons_updateBotEditBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) } else { return nil @@ -1980,13 +3449,17 @@ public extension Api { var _4: String? _4 = parseString(reader) var _5: Api.GeoPoint? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + } var _6: Api.InlineQueryPeerType? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InlineQueryPeerType - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InlineQueryPeerType + } + } var _7: String? _7 = parseString(reader) let _c1 = _1 != nil @@ -1997,7 +3470,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateBotInlineQuery(flags: _1!, queryId: _2!, userId: _3!, query: _4!, geo: _5, peerType: _6, offset: _7!) + return Api.Update.updateBotInlineQuery(Cons_updateBotInlineQuery(flags: _1!, queryId: _2!, userId: _3!, query: _4!, geo: _5, peerType: _6, offset: _7!)) } else { return nil @@ -2011,15 +3484,19 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.GeoPoint? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + } var _5: String? _5 = parseString(reader) var _6: Api.InputBotInlineMessageID? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2027,7 +3504,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateBotInlineSend(flags: _1!, userId: _2!, query: _3!, geo: _4, id: _5!, msgId: _6) + return Api.Update.updateBotInlineSend(Cons_updateBotInlineSend(flags: _1!, userId: _2!, query: _3!, geo: _4, id: _5!, msgId: _6)) } else { return nil @@ -2043,7 +3520,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateBotMenuButton(botId: _1!, button: _2!) + return Api.Update.updateBotMenuButton(Cons_updateBotMenuButton(botId: _1!, button: _2!)) } else { return nil @@ -2080,7 +3557,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateBotMessageReaction(peer: _1!, msgId: _2!, date: _3!, actor: _4!, oldReactions: _5!, newReactions: _6!, qts: _7!) + return Api.Update.updateBotMessageReaction(Cons_updateBotMessageReaction(peer: _1!, msgId: _2!, date: _3!, actor: _4!, oldReactions: _5!, newReactions: _6!, qts: _7!)) } else { return nil @@ -2107,7 +3584,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotMessageReactions(peer: _1!, msgId: _2!, date: _3!, reactions: _4!, qts: _5!) + return Api.Update.updateBotMessageReactions(Cons_updateBotMessageReactions(peer: _1!, msgId: _2!, date: _3!, reactions: _4!, qts: _5!)) } else { return nil @@ -2123,9 +3600,11 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.Message } var _4: Api.Message? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Message - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Message + } + } var _5: Int32? _5 = reader.readInt32() let _c1 = _1 != nil @@ -2134,7 +3613,7 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotNewBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!) + return Api.Update.updateBotNewBusinessMessage(Cons_updateBotNewBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) } else { return nil @@ -2150,11 +3629,15 @@ public extension Api { var _4: Buffer? _4 = parseBytes(reader) var _5: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } var _6: String? - if Int(_1!) & Int(1 << 1) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = parseString(reader) + } var _7: String? _7 = parseString(reader) var _8: Int64? @@ -2168,7 +3651,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Update.updateBotPrecheckoutQuery(flags: _1!, queryId: _2!, userId: _3!, payload: _4!, info: _5, shippingOptionId: _6, currency: _7!, totalAmount: _8!) + return Api.Update.updateBotPrecheckoutQuery(Cons_updateBotPrecheckoutQuery(flags: _1!, queryId: _2!, userId: _3!, payload: _4!, info: _5, shippingOptionId: _6, currency: _7!, totalAmount: _8!)) } else { return nil @@ -2185,7 +3668,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateBotPurchasedPaidMedia(userId: _1!, payload: _2!, qts: _3!) + return Api.Update.updateBotPurchasedPaidMedia(Cons_updateBotPurchasedPaidMedia(userId: _1!, payload: _2!, qts: _3!)) } else { return nil @@ -2207,7 +3690,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotShippingQuery(queryId: _1!, userId: _2!, payload: _3!, shippingAddress: _4!) + return Api.Update.updateBotShippingQuery(Cons_updateBotShippingQuery(queryId: _1!, userId: _2!, payload: _3!, shippingAddress: _4!)) } else { return nil @@ -2229,7 +3712,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotStopped(userId: _1!, date: _2!, stopped: _3!, qts: _4!) + return Api.Update.updateBotStopped(Cons_updateBotStopped(userId: _1!, date: _2!, stopped: _3!, qts: _4!)) } else { return nil @@ -2242,7 +3725,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateBotWebhookJSON(data: _1!) + return Api.Update.updateBotWebhookJSON(Cons_updateBotWebhookJSON(data: _1!)) } else { return nil @@ -2261,7 +3744,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateBotWebhookJSONQuery(queryId: _1!, data: _2!, timeout: _3!) + return Api.Update.updateBotWebhookJSONQuery(Cons_updateBotWebhookJSONQuery(queryId: _1!, data: _2!, timeout: _3!)) } else { return nil @@ -2281,13 +3764,17 @@ public extension Api { _5 = Api.parse(reader, signature: signature) as? Api.Message } var _6: Api.Message? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Message - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Message + } + } var _7: Int64? _7 = reader.readInt64() var _8: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_8 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _8 = parseBytes(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2297,7 +3784,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 0) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Update.updateBusinessBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, connectionId: _4!, message: _5!, replyToMessage: _6, chatInstance: _7!, data: _8) + return Api.Update.updateBusinessBotCallbackQuery(Cons_updateBusinessBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, connectionId: _4!, message: _5!, replyToMessage: _6, chatInstance: _7!, data: _8)) } else { return nil @@ -2308,7 +3795,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Update.updateChannel(channelId: _1!) + return Api.Update.updateChannel(Cons_updateChannel(channelId: _1!)) } else { return nil @@ -2322,7 +3809,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateChannelAvailableMessages(channelId: _1!, availableMinId: _2!) + return Api.Update.updateChannelAvailableMessages(Cons_updateChannelAvailableMessages(channelId: _1!, availableMinId: _2!)) } else { return nil @@ -2339,7 +3826,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChannelMessageForwards(channelId: _1!, id: _2!, forwards: _3!) + return Api.Update.updateChannelMessageForwards(Cons_updateChannelMessageForwards(channelId: _1!, id: _2!, forwards: _3!)) } else { return nil @@ -2356,7 +3843,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChannelMessageViews(channelId: _1!, id: _2!, views: _3!) + return Api.Update.updateChannelMessageViews(Cons_updateChannelMessageViews(channelId: _1!, id: _2!, views: _3!)) } else { return nil @@ -2374,17 +3861,23 @@ public extension Api { var _5: Int64? _5 = reader.readInt64() var _6: Api.ChannelParticipant? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant + } + } var _7: Api.ChannelParticipant? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant + } + } var _8: Api.ExportedChatInvite? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + } var _9: Int32? _9 = reader.readInt32() let _c1 = _1 != nil @@ -2397,7 +3890,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Update.updateChannelParticipant(flags: _1!, channelId: _2!, date: _3!, actorId: _4!, userId: _5!, prevParticipant: _6, newParticipant: _7, invite: _8, qts: _9!) + return Api.Update.updateChannelParticipant(Cons_updateChannelParticipant(flags: _1!, channelId: _2!, date: _3!, actorId: _4!, userId: _5!, prevParticipant: _6, newParticipant: _7, invite: _8, qts: _9!)) } else { return nil @@ -2409,11 +3902,15 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _5: [Int32]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) @@ -2424,7 +3921,7 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChannelReadMessagesContents(flags: _1!, channelId: _2!, topMsgId: _3, savedPeerId: _4, messages: _5!) + return Api.Update.updateChannelReadMessagesContents(Cons_updateChannelReadMessagesContents(flags: _1!, channelId: _2!, topMsgId: _3, savedPeerId: _4, messages: _5!)) } else { return nil @@ -2436,12 +3933,14 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChannelTooLong(flags: _1!, channelId: _2!, pts: _3) + return Api.Update.updateChannelTooLong(Cons_updateChannelTooLong(flags: _1!, channelId: _2!, pts: _3)) } else { return nil @@ -2453,7 +3952,9 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.Peer? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.Peer @@ -2468,7 +3969,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChannelUserTyping(flags: _1!, channelId: _2!, topMsgId: _3, fromId: _4!, action: _5!) + return Api.Update.updateChannelUserTyping(Cons_updateChannelUserTyping(flags: _1!, channelId: _2!, topMsgId: _3, fromId: _4!, action: _5!)) } else { return nil @@ -2484,7 +3985,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateChannelViewForumAsMessages(channelId: _1!, enabled: _2!) + return Api.Update.updateChannelViewForumAsMessages(Cons_updateChannelViewForumAsMessages(channelId: _1!, enabled: _2!)) } else { return nil @@ -2506,7 +4007,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateChannelWebPage(channelId: _1!, webpage: _2!, pts: _3!, ptsCount: _4!) + return Api.Update.updateChannelWebPage(Cons_updateChannelWebPage(channelId: _1!, webpage: _2!, pts: _3!, ptsCount: _4!)) } else { return nil @@ -2517,7 +4018,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Update.updateChat(chatId: _1!) + return Api.Update.updateChat(Cons_updateChat(chatId: _1!)) } else { return nil @@ -2538,7 +4039,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChatDefaultBannedRights(peer: _1!, defaultBannedRights: _2!, version: _3!) + return Api.Update.updateChatDefaultBannedRights(Cons_updateChatDefaultBannedRights(peer: _1!, defaultBannedRights: _2!, version: _3!)) } else { return nil @@ -2556,17 +4057,23 @@ public extension Api { var _5: Int64? _5 = reader.readInt64() var _6: Api.ChatParticipant? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ChatParticipant - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ChatParticipant + } + } var _7: Api.ChatParticipant? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.ChatParticipant - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.ChatParticipant + } + } var _8: Api.ExportedChatInvite? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + } var _9: Int32? _9 = reader.readInt32() let _c1 = _1 != nil @@ -2579,7 +4086,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Update.updateChatParticipant(flags: _1!, chatId: _2!, date: _3!, actorId: _4!, userId: _5!, prevParticipant: _6, newParticipant: _7, invite: _8, qts: _9!) + return Api.Update.updateChatParticipant(Cons_updateChatParticipant(flags: _1!, chatId: _2!, date: _3!, actorId: _4!, userId: _5!, prevParticipant: _6, newParticipant: _7, invite: _8, qts: _9!)) } else { return nil @@ -2602,7 +4109,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChatParticipantAdd(chatId: _1!, userId: _2!, inviterId: _3!, date: _4!, version: _5!) + return Api.Update.updateChatParticipantAdd(Cons_updateChatParticipantAdd(chatId: _1!, userId: _2!, inviterId: _3!, date: _4!, version: _5!)) } else { return nil @@ -2624,7 +4131,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateChatParticipantAdmin(chatId: _1!, userId: _2!, isAdmin: _3!, version: _4!) + return Api.Update.updateChatParticipantAdmin(Cons_updateChatParticipantAdmin(chatId: _1!, userId: _2!, isAdmin: _3!, version: _4!)) } else { return nil @@ -2641,7 +4148,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChatParticipantDelete(chatId: _1!, userId: _2!, version: _3!) + return Api.Update.updateChatParticipantDelete(Cons_updateChatParticipantDelete(chatId: _1!, userId: _2!, version: _3!)) } else { return nil @@ -2654,7 +4161,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateChatParticipants(participants: _1!) + return Api.Update.updateChatParticipants(Cons_updateChatParticipants(participants: _1!)) } else { return nil @@ -2675,7 +4182,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateChatUserTyping(chatId: _1!, fromId: _2!, action: _3!) + return Api.Update.updateChatUserTyping(Cons_updateChatUserTyping(chatId: _1!, fromId: _2!, action: _3!)) } else { return nil @@ -2694,7 +4201,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateDcOptions(dcOptions: _1!) + return Api.Update.updateDcOptions(Cons_updateDcOptions(dcOptions: _1!)) } else { return nil @@ -2716,7 +4223,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateDeleteChannelMessages(channelId: _1!, messages: _2!, pts: _3!, ptsCount: _4!) + return Api.Update.updateDeleteChannelMessages(Cons_updateDeleteChannelMessages(channelId: _1!, messages: _2!, pts: _3!, ptsCount: _4!)) } else { return nil @@ -2734,7 +4241,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateDeleteGroupCallMessages(call: _1!, messages: _2!) + return Api.Update.updateDeleteGroupCallMessages(Cons_updateDeleteGroupCallMessages(call: _1!, messages: _2!)) } else { return nil @@ -2753,7 +4260,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateDeleteMessages(messages: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateDeleteMessages(Cons_updateDeleteMessages(messages: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -2764,7 +4271,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.Update.updateDeleteQuickReply(shortcutId: _1!) + return Api.Update.updateDeleteQuickReply(Cons_updateDeleteQuickReply(shortcutId: _1!)) } else { return nil @@ -2780,7 +4287,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateDeleteQuickReplyMessages(shortcutId: _1!, messages: _2!) + return Api.Update.updateDeleteQuickReplyMessages(Cons_updateDeleteQuickReplyMessages(shortcutId: _1!, messages: _2!)) } else { return nil @@ -2798,15 +4305,17 @@ public extension Api { _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } var _4: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateDeleteScheduledMessages(flags: _1!, peer: _2!, messages: _3!, sentMessages: _4) + return Api.Update.updateDeleteScheduledMessages(Cons_updateDeleteScheduledMessages(flags: _1!, peer: _2!, messages: _3!, sentMessages: _4)) } else { return nil @@ -2818,14 +4327,16 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: Api.DialogFilter? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.DialogFilter - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.DialogFilter + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateDialogFilter(flags: _1!, id: _2!, filter: _3) + return Api.Update.updateDialogFilter(Cons_updateDialogFilter(flags: _1!, id: _2!, filter: _3)) } else { return nil @@ -2838,7 +4349,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateDialogFilterOrder(order: _1!) + return Api.Update.updateDialogFilterOrder(Cons_updateDialogFilterOrder(order: _1!)) } else { return nil @@ -2851,7 +4362,9 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } var _3: Api.DialogPeer? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.DialogPeer @@ -2860,7 +4373,7 @@ public extension Api { let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateDialogPinned(flags: _1!, folderId: _2, peer: _3!) + return Api.Update.updateDialogPinned(Cons_updateDialogPinned(flags: _1!, folderId: _2, peer: _3!)) } else { return nil @@ -2874,14 +4387,16 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.DialogPeer } var _3: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateDialogUnreadMark(flags: _1!, peer: _2!, savedPeerId: _3) + return Api.Update.updateDialogUnreadMark(Cons_updateDialogUnreadMark(flags: _1!, peer: _2!, savedPeerId: _3)) } else { return nil @@ -2895,11 +4410,15 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _5: Api.DraftMessage? if let signature = reader.readInt32() { _5 = Api.parse(reader, signature: signature) as? Api.DraftMessage @@ -2910,7 +4429,7 @@ public extension Api { let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateDraftMessage(flags: _1!, peer: _2!, topMsgId: _3, savedPeerId: _4, draft: _5!) + return Api.Update.updateDraftMessage(Cons_updateDraftMessage(flags: _1!, peer: _2!, topMsgId: _3, savedPeerId: _4, draft: _5!)) } else { return nil @@ -2929,7 +4448,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateEditChannelMessage(message: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateEditChannelMessage(Cons_updateEditChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -2948,7 +4467,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateEditMessage(message: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateEditMessage(Cons_updateEditMessage(message: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -2961,7 +4480,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateEmojiGameInfo(info: _1!) + return Api.Update.updateEmojiGameInfo(Cons_updateEmojiGameInfo(info: _1!)) } else { return nil @@ -2972,7 +4491,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.Update.updateEncryptedChatTyping(chatId: _1!) + return Api.Update.updateEncryptedChatTyping(Cons_updateEncryptedChatTyping(chatId: _1!)) } else { return nil @@ -2989,7 +4508,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateEncryptedMessagesRead(chatId: _1!, maxDate: _2!, date: _3!) + return Api.Update.updateEncryptedMessagesRead(Cons_updateEncryptedMessagesRead(chatId: _1!, maxDate: _2!, date: _3!)) } else { return nil @@ -3005,7 +4524,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateEncryption(chat: _1!, date: _2!) + return Api.Update.updateEncryption(Cons_updateEncryption(chat: _1!, date: _2!)) } else { return nil @@ -3027,7 +4546,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateFolderPeers(folderPeers: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateFolderPeers(Cons_updateFolderPeers(folderPeers: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -3043,7 +4562,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateGeoLiveViewed(peer: _1!, msgId: _2!) + return Api.Update.updateGeoLiveViewed(Cons_updateGeoLiveViewed(peer: _1!, msgId: _2!)) } else { return nil @@ -3053,9 +4572,11 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Api.GroupCall? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.GroupCall @@ -3064,7 +4585,7 @@ public extension Api { let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCall(flags: _1!, peer: _2, call: _3!) + return Api.Update.updateGroupCall(Cons_updateGroupCall(flags: _1!, peer: _2, call: _3!)) } else { return nil @@ -3088,7 +4609,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateGroupCallChainBlocks(call: _1!, subChainId: _2!, blocks: _3!, nextOffset: _4!) + return Api.Update.updateGroupCallChainBlocks(Cons_updateGroupCallChainBlocks(call: _1!, subChainId: _2!, blocks: _3!, nextOffset: _4!)) } else { return nil @@ -3104,7 +4625,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateGroupCallConnection(flags: _1!, params: _2!) + return Api.Update.updateGroupCallConnection(Cons_updateGroupCallConnection(flags: _1!, params: _2!)) } else { return nil @@ -3125,7 +4646,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCallEncryptedMessage(call: _1!, fromId: _2!, encryptedMessage: _3!) + return Api.Update.updateGroupCallEncryptedMessage(Cons_updateGroupCallEncryptedMessage(call: _1!, fromId: _2!, encryptedMessage: _3!)) } else { return nil @@ -3143,7 +4664,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateGroupCallMessage(call: _1!, message: _2!) + return Api.Update.updateGroupCallMessage(Cons_updateGroupCallMessage(call: _1!, message: _2!)) } else { return nil @@ -3164,7 +4685,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCallParticipants(call: _1!, participants: _2!, version: _3!) + return Api.Update.updateGroupCallParticipants(Cons_updateGroupCallParticipants(call: _1!, participants: _2!, version: _3!)) } else { return nil @@ -3184,9 +4705,13 @@ public extension Api { var _5: Int64? _5 = reader.readInt64() var _6: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseBytes(reader) + } var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -3195,7 +4720,7 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateInlineBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, msgId: _4!, chatInstance: _5!, data: _6, gameShortName: _7) + return Api.Update.updateInlineBotCallbackQuery(Cons_updateInlineBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, msgId: _4!, chatInstance: _5!, data: _6, gameShortName: _7)) } else { return nil @@ -3208,7 +4733,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateLangPack(difference: _1!) + return Api.Update.updateLangPack(Cons_updateLangPack(difference: _1!)) } else { return nil @@ -3219,7 +4744,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Update.updateLangPackTooLong(langCode: _1!) + return Api.Update.updateLangPackTooLong(Cons_updateLangPackTooLong(langCode: _1!)) } else { return nil @@ -3243,7 +4768,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateMessageExtendedMedia(peer: _1!, msgId: _2!, extendedMedia: _3!) + return Api.Update.updateMessageExtendedMedia(Cons_updateMessageExtendedMedia(peer: _1!, msgId: _2!, extendedMedia: _3!)) } else { return nil @@ -3257,7 +4782,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateMessageID(id: _1!, randomId: _2!) + return Api.Update.updateMessageID(Cons_updateMessageID(id: _1!, randomId: _2!)) } else { return nil @@ -3269,9 +4794,11 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Api.Poll? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Poll - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Poll + } + } var _4: Api.PollResults? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.PollResults @@ -3281,7 +4808,7 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateMessagePoll(flags: _1!, pollId: _2!, poll: _3, results: _4!) + return Api.Update.updateMessagePoll(Cons_updateMessagePoll(flags: _1!, pollId: _2!, poll: _3, results: _4!)) } else { return nil @@ -3305,7 +4832,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateMessagePollVote(pollId: _1!, peer: _2!, options: _3!, qts: _4!) + return Api.Update.updateMessagePollVote(Cons_updateMessagePollVote(pollId: _1!, peer: _2!, options: _3!, qts: _4!)) } else { return nil @@ -3321,11 +4848,15 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } var _5: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _6: Api.MessageReactions? if let signature = reader.readInt32() { _6 = Api.parse(reader, signature: signature) as? Api.MessageReactions @@ -3337,7 +4868,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateMessageReactions(flags: _1!, peer: _2!, msgId: _3!, topMsgId: _4, savedPeerId: _5, reactions: _6!) + return Api.Update.updateMessageReactions(Cons_updateMessageReactions(flags: _1!, peer: _2!, msgId: _3!, topMsgId: _4, savedPeerId: _5, reactions: _6!)) } else { return nil @@ -3356,7 +4887,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateMonoForumNoPaidException(flags: _1!, channelId: _2!, savedPeerId: _3!) + return Api.Update.updateMonoForumNoPaidException(Cons_updateMonoForumNoPaidException(flags: _1!, channelId: _2!, savedPeerId: _3!)) } else { return nil @@ -3370,7 +4901,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateMoveStickerSetToTop(flags: _1!, stickerset: _2!) + return Api.Update.updateMoveStickerSetToTop(Cons_updateMoveStickerSetToTop(flags: _1!, stickerset: _2!)) } else { return nil @@ -3382,18 +4913,24 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateNewAuthorization(flags: _1!, hash: _2!, date: _3, device: _4, location: _5) + return Api.Update.updateNewAuthorization(Cons_updateNewAuthorization(flags: _1!, hash: _2!, date: _3, device: _4, location: _5)) } else { return nil @@ -3412,7 +4949,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateNewChannelMessage(message: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateNewChannelMessage(Cons_updateNewChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -3428,7 +4965,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateNewEncryptedMessage(message: _1!, qts: _2!) + return Api.Update.updateNewEncryptedMessage(Cons_updateNewEncryptedMessage(message: _1!, qts: _2!)) } else { return nil @@ -3447,7 +4984,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateNewMessage(message: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateNewMessage(Cons_updateNewMessage(message: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -3460,7 +4997,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateNewQuickReply(quickReply: _1!) + return Api.Update.updateNewQuickReply(Cons_updateNewQuickReply(quickReply: _1!)) } else { return nil @@ -3473,7 +5010,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateNewScheduledMessage(message: _1!) + return Api.Update.updateNewScheduledMessage(Cons_updateNewScheduledMessage(message: _1!)) } else { return nil @@ -3486,7 +5023,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateNewStickerSet(stickerset: _1!) + return Api.Update.updateNewStickerSet(Cons_updateNewStickerSet(stickerset: _1!)) } else { return nil @@ -3507,7 +5044,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateNewStoryReaction(storyId: _1!, peer: _2!, reaction: _3!) + return Api.Update.updateNewStoryReaction(Cons_updateNewStoryReaction(storyId: _1!, peer: _2!, reaction: _3!)) } else { return nil @@ -3525,7 +5062,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateNotifySettings(peer: _1!, notifySettings: _2!) + return Api.Update.updateNotifySettings(Cons_updateNotifySettings(peer: _1!, notifySettings: _2!)) } else { return nil @@ -3538,7 +5075,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updatePaidReactionPrivacy(private: _1!) + return Api.Update.updatePaidReactionPrivacy(Cons_updatePaidReactionPrivacy(private: _1!)) } else { return nil @@ -3554,7 +5091,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updatePeerBlocked(flags: _1!, peerId: _2!) + return Api.Update.updatePeerBlocked(Cons_updatePeerBlocked(flags: _1!, peerId: _2!)) } else { return nil @@ -3568,12 +5105,14 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePeerHistoryTTL(flags: _1!, peer: _2!, ttlPeriod: _3) + return Api.Update.updatePeerHistoryTTL(Cons_updatePeerHistoryTTL(flags: _1!, peer: _2!, ttlPeriod: _3)) } else { return nil @@ -3586,7 +5125,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updatePeerLocated(peers: _1!) + return Api.Update.updatePeerLocated(Cons_updatePeerLocated(peers: _1!)) } else { return nil @@ -3604,7 +5143,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updatePeerSettings(peer: _1!, settings: _2!) + return Api.Update.updatePeerSettings(Cons_updatePeerSettings(peer: _1!, settings: _2!)) } else { return nil @@ -3618,14 +5157,16 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: Api.WallPaper? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.WallPaper - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePeerWallpaper(flags: _1!, peer: _2!, wallpaper: _3) + return Api.Update.updatePeerWallpaper(Cons_updatePeerWallpaper(flags: _1!, peer: _2!, wallpaper: _3)) } else { return nil @@ -3646,7 +5187,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePendingJoinRequests(peer: _1!, requestsPending: _2!, recentRequesters: _3!) + return Api.Update.updatePendingJoinRequests(Cons_updatePendingJoinRequests(peer: _1!, requestsPending: _2!, recentRequesters: _3!)) } else { return nil @@ -3659,7 +5200,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updatePhoneCall(phoneCall: _1!) + return Api.Update.updatePhoneCall(Cons_updatePhoneCall(phoneCall: _1!)) } else { return nil @@ -3673,7 +5214,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updatePhoneCallSignalingData(phoneCallId: _1!, data: _2!) + return Api.Update.updatePhoneCallSignalingData(Cons_updatePhoneCallSignalingData(phoneCallId: _1!, data: _2!)) } else { return nil @@ -3698,7 +5239,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updatePinnedChannelMessages(flags: _1!, channelId: _2!, messages: _3!, pts: _4!, ptsCount: _5!) + return Api.Update.updatePinnedChannelMessages(Cons_updatePinnedChannelMessages(flags: _1!, channelId: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) } else { return nil @@ -3708,16 +5249,20 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } var _3: [Api.DialogPeer]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedDialogs(flags: _1!, folderId: _2, order: _3) + return Api.Update.updatePinnedDialogs(Cons_updatePinnedDialogs(flags: _1!, folderId: _2, order: _3)) } else { return nil @@ -3736,7 +5281,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedForumTopic(flags: _1!, peer: _2!, topicId: _3!) + return Api.Update.updatePinnedForumTopic(Cons_updatePinnedForumTopic(flags: _1!, peer: _2!, topicId: _3!)) } else { return nil @@ -3750,14 +5295,16 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedForumTopics(flags: _1!, peer: _2!, order: _3) + return Api.Update.updatePinnedForumTopics(Cons_updatePinnedForumTopics(flags: _1!, peer: _2!, order: _3)) } else { return nil @@ -3784,7 +5331,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updatePinnedMessages(flags: _1!, peer: _2!, messages: _3!, pts: _4!, ptsCount: _5!) + return Api.Update.updatePinnedMessages(Cons_updatePinnedMessages(flags: _1!, peer: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) } else { return nil @@ -3794,13 +5341,15 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: [Api.DialogPeer]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.Update.updatePinnedSavedDialogs(flags: _1!, order: _2) + return Api.Update.updatePinnedSavedDialogs(Cons_updatePinnedSavedDialogs(flags: _1!, order: _2)) } else { return nil @@ -3818,7 +5367,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updatePrivacy(key: _1!, rules: _2!) + return Api.Update.updatePrivacy(Cons_updatePrivacy(key: _1!, rules: _2!)) } else { return nil @@ -3834,7 +5383,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateQuickReplies(quickReplies: _1!) + return Api.Update.updateQuickReplies(Cons_updateQuickReplies(quickReplies: _1!)) } else { return nil @@ -3847,7 +5396,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateQuickReplyMessage(message: _1!) + return Api.Update.updateQuickReplyMessage(Cons_updateQuickReplyMessage(message: _1!)) } else { return nil @@ -3863,9 +5412,13 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -3873,7 +5426,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateReadChannelDiscussionInbox(flags: _1!, channelId: _2!, topMsgId: _3!, readMaxId: _4!, broadcastId: _5, broadcastPost: _6) + return Api.Update.updateReadChannelDiscussionInbox(Cons_updateReadChannelDiscussionInbox(flags: _1!, channelId: _2!, topMsgId: _3!, readMaxId: _4!, broadcastId: _5, broadcastPost: _6)) } else { return nil @@ -3890,7 +5443,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateReadChannelDiscussionOutbox(channelId: _1!, topMsgId: _2!, readMaxId: _3!) + return Api.Update.updateReadChannelDiscussionOutbox(Cons_updateReadChannelDiscussionOutbox(channelId: _1!, topMsgId: _2!, readMaxId: _3!)) } else { return nil @@ -3900,7 +5453,9 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int64? _3 = reader.readInt64() var _4: Int32? @@ -3916,7 +5471,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateReadChannelInbox(flags: _1!, folderId: _2, channelId: _3!, maxId: _4!, stillUnreadCount: _5!, pts: _6!) + return Api.Update.updateReadChannelInbox(Cons_updateReadChannelInbox(flags: _1!, folderId: _2, channelId: _3!, maxId: _4!, stillUnreadCount: _5!, pts: _6!)) } else { return nil @@ -3930,7 +5485,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateReadChannelOutbox(channelId: _1!, maxId: _2!) + return Api.Update.updateReadChannelOutbox(Cons_updateReadChannelOutbox(channelId: _1!, maxId: _2!)) } else { return nil @@ -3946,13 +5501,17 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Api.Peer? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.Peer } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? @@ -3970,7 +5529,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Update.updateReadHistoryInbox(flags: _1!, folderId: _2, peer: _3!, topMsgId: _4, maxId: _5!, stillUnreadCount: _6!, pts: _7!, ptsCount: _8!) + return Api.Update.updateReadHistoryInbox(Cons_updateReadHistoryInbox(flags: _1!, folderId: _2, peer: _3!, topMsgId: _4, maxId: _5!, stillUnreadCount: _6!, pts: _7!, ptsCount: _8!)) } else { return nil @@ -3992,7 +5551,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateReadHistoryOutbox(peer: _1!, maxId: _2!, pts: _3!, ptsCount: _4!) + return Api.Update.updateReadHistoryOutbox(Cons_updateReadHistoryOutbox(peer: _1!, maxId: _2!, pts: _3!, ptsCount: _4!)) } else { return nil @@ -4010,14 +5569,16 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateReadMessagesContents(flags: _1!, messages: _2!, pts: _3!, ptsCount: _4!, date: _5) + return Api.Update.updateReadMessagesContents(Cons_updateReadMessagesContents(flags: _1!, messages: _2!, pts: _3!, ptsCount: _4!, date: _5)) } else { return nil @@ -4036,7 +5597,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateReadMonoForumInbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!) + return Api.Update.updateReadMonoForumInbox(Cons_updateReadMonoForumInbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) } else { return nil @@ -4055,7 +5616,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateReadMonoForumOutbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!) + return Api.Update.updateReadMonoForumOutbox(Cons_updateReadMonoForumOutbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) } else { return nil @@ -4071,7 +5632,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateReadStories(peer: _1!, maxId: _2!) + return Api.Update.updateReadStories(Cons_updateReadStories(peer: _1!, maxId: _2!)) } else { return nil @@ -4096,7 +5657,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateSavedDialogPinned(flags: _1!, peer: _2!) + return Api.Update.updateSavedDialogPinned(Cons_updateSavedDialogPinned(flags: _1!, peer: _2!)) } else { return nil @@ -4118,7 +5679,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateSentPhoneCode(sentCode: _1!) + return Api.Update.updateSentPhoneCode(Cons_updateSentPhoneCode(sentCode: _1!)) } else { return nil @@ -4139,7 +5700,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateSentStoryReaction(peer: _1!, storyId: _2!, reaction: _3!) + return Api.Update.updateSentStoryReaction(Cons_updateSentStoryReaction(peer: _1!, storyId: _2!, reaction: _3!)) } else { return nil @@ -4149,7 +5710,9 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } var _3: String? _3 = parseString(reader) var _4: String? @@ -4169,7 +5732,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateServiceNotification(flags: _1!, inboxDate: _2, type: _3!, message: _4!, media: _5!, entities: _6!) + return Api.Update.updateServiceNotification(Cons_updateServiceNotification(flags: _1!, inboxDate: _2, type: _3!, message: _4!, media: _5!, entities: _6!)) } else { return nil @@ -4180,7 +5743,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Update.updateSmsJob(jobId: _1!) + return Api.Update.updateSmsJob(Cons_updateSmsJob(jobId: _1!)) } else { return nil @@ -4196,7 +5759,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStarGiftAuctionState(giftId: _1!, state: _2!) + return Api.Update.updateStarGiftAuctionState(Cons_updateStarGiftAuctionState(giftId: _1!, state: _2!)) } else { return nil @@ -4212,7 +5775,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStarGiftAuctionUserState(giftId: _1!, userState: _2!) + return Api.Update.updateStarGiftAuctionUserState(Cons_updateStarGiftAuctionUserState(giftId: _1!, userState: _2!)) } else { return nil @@ -4228,7 +5791,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateStarsBalance(balance: _1!) + return Api.Update.updateStarsBalance(Cons_updateStarsBalance(balance: _1!)) } else { return nil @@ -4246,7 +5809,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStarsRevenueStatus(peer: _1!, status: _2!) + return Api.Update.updateStarsRevenueStatus(Cons_updateStarsRevenueStatus(peer: _1!, status: _2!)) } else { return nil @@ -4257,7 +5820,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.Update.updateStickerSets(flags: _1!) + return Api.Update.updateStickerSets(Cons_updateStickerSets(flags: _1!)) } else { return nil @@ -4273,7 +5836,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStickerSetsOrder(flags: _1!, order: _2!) + return Api.Update.updateStickerSetsOrder(Cons_updateStickerSetsOrder(flags: _1!, order: _2!)) } else { return nil @@ -4286,7 +5849,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateStoriesStealthMode(stealthMode: _1!) + return Api.Update.updateStoriesStealthMode(Cons_updateStoriesStealthMode(stealthMode: _1!)) } else { return nil @@ -4304,7 +5867,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStory(peer: _1!, story: _2!) + return Api.Update.updateStory(Cons_updateStory(peer: _1!, story: _2!)) } else { return nil @@ -4318,7 +5881,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStoryID(id: _1!, randomId: _2!) + return Api.Update.updateStoryID(Cons_updateStoryID(id: _1!, randomId: _2!)) } else { return nil @@ -4331,7 +5894,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.Update.updateTheme(theme: _1!) + return Api.Update.updateTheme(Cons_updateTheme(theme: _1!)) } else { return nil @@ -4356,7 +5919,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateTranscribedAudio(flags: _1!, peer: _2!, msgId: _3!, transcriptionId: _4!, text: _5!) + return Api.Update.updateTranscribedAudio(Cons_updateTranscribedAudio(flags: _1!, peer: _2!, msgId: _3!, transcriptionId: _4!, text: _5!)) } else { return nil @@ -4367,7 +5930,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Update.updateUser(userId: _1!) + return Api.Update.updateUser(Cons_updateUser(userId: _1!)) } else { return nil @@ -4383,7 +5946,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateUserEmojiStatus(userId: _1!, emojiStatus: _2!) + return Api.Update.updateUserEmojiStatus(Cons_updateUserEmojiStatus(userId: _1!, emojiStatus: _2!)) } else { return nil @@ -4405,7 +5968,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateUserName(userId: _1!, firstName: _2!, lastName: _3!, usernames: _4!) + return Api.Update.updateUserName(Cons_updateUserName(userId: _1!, firstName: _2!, lastName: _3!, usernames: _4!)) } else { return nil @@ -4419,7 +5982,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateUserPhone(userId: _1!, phone: _2!) + return Api.Update.updateUserPhone(Cons_updateUserPhone(userId: _1!, phone: _2!)) } else { return nil @@ -4435,7 +5998,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateUserStatus(userId: _1!, status: _2!) + return Api.Update.updateUserStatus(Cons_updateUserStatus(userId: _1!, status: _2!)) } else { return nil @@ -4447,7 +6010,9 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Api.SendMessageAction? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.SendMessageAction @@ -4457,7 +6022,7 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateUserTyping(flags: _1!, userId: _2!, topMsgId: _3, action: _4!) + return Api.Update.updateUserTyping(Cons_updateUserTyping(flags: _1!, userId: _2!, topMsgId: _3, action: _4!)) } else { return nil @@ -4476,7 +6041,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateWebPage(webpage: _1!, pts: _2!, ptsCount: _3!) + return Api.Update.updateWebPage(Cons_updateWebPage(webpage: _1!, pts: _2!, ptsCount: _3!)) } else { return nil @@ -4487,12 +6052,11 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Update.updateWebViewResultSent(queryId: _1!) + return Api.Update.updateWebViewResultSent(Cons_updateWebViewResultSent(queryId: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api29.swift b/submodules/TelegramApi/Sources/Api29.swift index 69ae42de57..a7302bfe4d 100644 --- a/submodules/TelegramApi/Sources/Api29.swift +++ b/submodules/TelegramApi/Sources/Api29.swift @@ -1,155 +1,296 @@ public extension Api { indirect enum Updates: TypeConstructorDescription { - case updateShort(update: Api.Update, date: Int32) - case updateShortChatMessage(flags: Int32, id: Int32, fromId: Int64, chatId: Int64, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, replyTo: Api.MessageReplyHeader?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) - case updateShortMessage(flags: Int32, id: Int32, userId: Int64, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, replyTo: Api.MessageReplyHeader?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) - case updateShortSentMessage(flags: Int32, id: Int32, pts: Int32, ptsCount: Int32, date: Int32, media: Api.MessageMedia?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) - case updates(updates: [Api.Update], users: [Api.User], chats: [Api.Chat], date: Int32, seq: Int32) - case updatesCombined(updates: [Api.Update], users: [Api.User], chats: [Api.Chat], date: Int32, seqStart: Int32, seq: Int32) + public class Cons_updateShort { + public var update: Api.Update + public var date: Int32 + public init(update: Api.Update, date: Int32) { + self.update = update + self.date = date + } + } + public class Cons_updateShortChatMessage { + public var flags: Int32 + public var id: Int32 + public var fromId: Int64 + public var chatId: Int64 + public var message: String + public var pts: Int32 + public var ptsCount: Int32 + public var date: Int32 + public var fwdFrom: Api.MessageFwdHeader? + public var viaBotId: Int64? + public var replyTo: Api.MessageReplyHeader? + public var entities: [Api.MessageEntity]? + public var ttlPeriod: Int32? + public init(flags: Int32, id: Int32, fromId: Int64, chatId: Int64, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, replyTo: Api.MessageReplyHeader?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) { + self.flags = flags + self.id = id + self.fromId = fromId + self.chatId = chatId + self.message = message + self.pts = pts + self.ptsCount = ptsCount + self.date = date + self.fwdFrom = fwdFrom + self.viaBotId = viaBotId + self.replyTo = replyTo + self.entities = entities + self.ttlPeriod = ttlPeriod + } + } + public class Cons_updateShortMessage { + public var flags: Int32 + public var id: Int32 + public var userId: Int64 + public var message: String + public var pts: Int32 + public var ptsCount: Int32 + public var date: Int32 + public var fwdFrom: Api.MessageFwdHeader? + public var viaBotId: Int64? + public var replyTo: Api.MessageReplyHeader? + public var entities: [Api.MessageEntity]? + public var ttlPeriod: Int32? + public init(flags: Int32, id: Int32, userId: Int64, message: String, pts: Int32, ptsCount: Int32, date: Int32, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, replyTo: Api.MessageReplyHeader?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) { + self.flags = flags + self.id = id + self.userId = userId + self.message = message + self.pts = pts + self.ptsCount = ptsCount + self.date = date + self.fwdFrom = fwdFrom + self.viaBotId = viaBotId + self.replyTo = replyTo + self.entities = entities + self.ttlPeriod = ttlPeriod + } + } + public class Cons_updateShortSentMessage { + public var flags: Int32 + public var id: Int32 + public var pts: Int32 + public var ptsCount: Int32 + public var date: Int32 + public var media: Api.MessageMedia? + public var entities: [Api.MessageEntity]? + public var ttlPeriod: Int32? + public init(flags: Int32, id: Int32, pts: Int32, ptsCount: Int32, date: Int32, media: Api.MessageMedia?, entities: [Api.MessageEntity]?, ttlPeriod: Int32?) { + self.flags = flags + self.id = id + self.pts = pts + self.ptsCount = ptsCount + self.date = date + self.media = media + self.entities = entities + self.ttlPeriod = ttlPeriod + } + } + public class Cons_updates { + public var updates: [Api.Update] + public var users: [Api.User] + public var chats: [Api.Chat] + public var date: Int32 + public var seq: Int32 + public init(updates: [Api.Update], users: [Api.User], chats: [Api.Chat], date: Int32, seq: Int32) { + self.updates = updates + self.users = users + self.chats = chats + self.date = date + self.seq = seq + } + } + public class Cons_updatesCombined { + public var updates: [Api.Update] + public var users: [Api.User] + public var chats: [Api.Chat] + public var date: Int32 + public var seqStart: Int32 + public var seq: Int32 + public init(updates: [Api.Update], users: [Api.User], chats: [Api.Chat], date: Int32, seqStart: Int32, seq: Int32) { + self.updates = updates + self.users = users + self.chats = chats + self.date = date + self.seqStart = seqStart + self.seq = seq + } + } + case updateShort(Cons_updateShort) + case updateShortChatMessage(Cons_updateShortChatMessage) + case updateShortMessage(Cons_updateShortMessage) + case updateShortSentMessage(Cons_updateShortSentMessage) + case updates(Cons_updates) + case updatesCombined(Cons_updatesCombined) case updatesTooLong - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .updateShort(let update, let date): - if boxed { - buffer.appendInt32(2027216577) - } - update.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .updateShortChatMessage(let flags, let id, let fromId, let chatId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyTo, let entities, let ttlPeriod): - if boxed { - buffer.appendInt32(1299050149) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(fromId, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {fwdFrom!.serialize(buffer, true)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt64(viaBotId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {replyTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 25) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - case .updateShortMessage(let flags, let id, let userId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyTo, let entities, let ttlPeriod): - if boxed { - buffer.appendInt32(826001400) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {fwdFrom!.serialize(buffer, true)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt64(viaBotId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {replyTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 25) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - case .updateShortSentMessage(let flags, let id, let pts, let ptsCount, let date, let media, let entities, let ttlPeriod): - if boxed { - buffer.appendInt32(-1877614335) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 9) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 25) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - case .updates(let updates, let users, let chats, let date, let seq): - if boxed { - buffer.appendInt32(1957577280) - } + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .updateShort(let _data): + if boxed { + buffer.appendInt32(2027216577) + } + _data.update.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .updateShortChatMessage(let _data): + if boxed { + buffer.appendInt32(1299050149) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.fromId, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.fwdFrom!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.viaBotId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.replyTo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(updates.count)) - for item in updates { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) } + } + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + case .updateShortMessage(let _data): + if boxed { + buffer.appendInt32(826001400) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.fwdFrom!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.viaBotId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.replyTo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) } + } + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + case .updateShortSentMessage(let _data): + if boxed { + buffer.appendInt32(-1877614335) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.media!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 7) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) } - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(seq, buffer: buffer, boxed: false) - break - case .updatesCombined(let updates, let users, let chats, let date, let seqStart, let seq): - if boxed { - buffer.appendInt32(1918567619) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(updates.count)) - for item in updates { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(seqStart, buffer: buffer, boxed: false) - serializeInt32(seq, buffer: buffer, boxed: false) - break - case .updatesTooLong: - if boxed { - buffer.appendInt32(-484987010) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .updateShort(let update, let date): - return ("updateShort", [("update", update as Any), ("date", date as Any)]) - case .updateShortChatMessage(let flags, let id, let fromId, let chatId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyTo, let entities, let ttlPeriod): - return ("updateShortChatMessage", [("flags", flags as Any), ("id", id as Any), ("fromId", fromId as Any), ("chatId", chatId as Any), ("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any), ("date", date as Any), ("fwdFrom", fwdFrom as Any), ("viaBotId", viaBotId as Any), ("replyTo", replyTo as Any), ("entities", entities as Any), ("ttlPeriod", ttlPeriod as Any)]) - case .updateShortMessage(let flags, let id, let userId, let message, let pts, let ptsCount, let date, let fwdFrom, let viaBotId, let replyTo, let entities, let ttlPeriod): - return ("updateShortMessage", [("flags", flags as Any), ("id", id as Any), ("userId", userId as Any), ("message", message as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any), ("date", date as Any), ("fwdFrom", fwdFrom as Any), ("viaBotId", viaBotId as Any), ("replyTo", replyTo as Any), ("entities", entities as Any), ("ttlPeriod", ttlPeriod as Any)]) - case .updateShortSentMessage(let flags, let id, let pts, let ptsCount, let date, let media, let entities, let ttlPeriod): - return ("updateShortSentMessage", [("flags", flags as Any), ("id", id as Any), ("pts", pts as Any), ("ptsCount", ptsCount as Any), ("date", date as Any), ("media", media as Any), ("entities", entities as Any), ("ttlPeriod", ttlPeriod as Any)]) - case .updates(let updates, let users, let chats, let date, let seq): - return ("updates", [("updates", updates as Any), ("users", users as Any), ("chats", chats as Any), ("date", date as Any), ("seq", seq as Any)]) - case .updatesCombined(let updates, let users, let chats, let date, let seqStart, let seq): - return ("updatesCombined", [("updates", updates as Any), ("users", users as Any), ("chats", chats as Any), ("date", date as Any), ("seqStart", seqStart as Any), ("seq", seq as Any)]) - case .updatesTooLong: + } + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + case .updates(let _data): + if boxed { + buffer.appendInt32(1957577280) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.updates.count)) + for item in _data.updates { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.seq, buffer: buffer, boxed: false) + break + case .updatesCombined(let _data): + if boxed { + buffer.appendInt32(1918567619) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.updates.count)) + for item in _data.updates { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.seqStart, buffer: buffer, boxed: false) + serializeInt32(_data.seq, buffer: buffer, boxed: false) + break + case .updatesTooLong: + if boxed { + buffer.appendInt32(-484987010) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .updateShort(let _data): + return ("updateShort", [("update", _data.update as Any), ("date", _data.date as Any)]) + case .updateShortChatMessage(let _data): + return ("updateShortChatMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("chatId", _data.chatId as Any), ("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("replyTo", _data.replyTo as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + case .updateShortMessage(let _data): + return ("updateShortMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("userId", _data.userId as Any), ("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("replyTo", _data.replyTo as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + case .updateShortSentMessage(let _data): + return ("updateShortSentMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("media", _data.media as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + case .updates(let _data): + return ("updates", [("updates", _data.updates as Any), ("users", _data.users as Any), ("chats", _data.chats as Any), ("date", _data.date as Any), ("seq", _data.seq as Any)]) + case .updatesCombined(let _data): + return ("updatesCombined", [("updates", _data.updates as Any), ("users", _data.users as Any), ("chats", _data.chats as Any), ("date", _data.date as Any), ("seqStart", _data.seqStart as Any), ("seq", _data.seq as Any)]) + case .updatesTooLong: return ("updatesTooLong", []) - } - } - + } + } + public static func parse_updateShort(_ reader: BufferReader) -> Updates? { var _1: Api.Update? if let signature = reader.readInt32() { @@ -160,7 +301,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Updates.updateShort(update: _1!, date: _2!) + return Api.Updates.updateShort(Cons_updateShort(update: _1!, date: _2!)) } else { return nil @@ -184,21 +325,31 @@ public extension Api { var _8: Int32? _8 = reader.readInt32() var _9: Api.MessageFwdHeader? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + } + } var _10: Int64? - if Int(_1!) & Int(1 << 11) != 0 {_10 = reader.readInt64() } + if Int(_1!) & Int(1 << 11) != 0 { + _10 = reader.readInt64() + } var _11: Api.MessageReplyHeader? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader + } + } var _12: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 7) != 0 {if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _13: Int32? - if Int(_1!) & Int(1 << 25) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 25) != 0 { + _13 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -213,7 +364,7 @@ public extension Api { let _c12 = (Int(_1!) & Int(1 << 7) == 0) || _12 != nil let _c13 = (Int(_1!) & Int(1 << 25) == 0) || _13 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.Updates.updateShortChatMessage(flags: _1!, id: _2!, fromId: _3!, chatId: _4!, message: _5!, pts: _6!, ptsCount: _7!, date: _8!, fwdFrom: _9, viaBotId: _10, replyTo: _11, entities: _12, ttlPeriod: _13) + return Api.Updates.updateShortChatMessage(Cons_updateShortChatMessage(flags: _1!, id: _2!, fromId: _3!, chatId: _4!, message: _5!, pts: _6!, ptsCount: _7!, date: _8!, fwdFrom: _9, viaBotId: _10, replyTo: _11, entities: _12, ttlPeriod: _13)) } else { return nil @@ -235,21 +386,31 @@ public extension Api { var _7: Int32? _7 = reader.readInt32() var _8: Api.MessageFwdHeader? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + } + } var _9: Int64? - if Int(_1!) & Int(1 << 11) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 11) != 0 { + _9 = reader.readInt64() + } var _10: Api.MessageReplyHeader? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader + } + } var _11: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 7) != 0 {if let _ = reader.readInt32() { - _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _12: Int32? - if Int(_1!) & Int(1 << 25) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 25) != 0 { + _12 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -263,7 +424,7 @@ public extension Api { let _c11 = (Int(_1!) & Int(1 << 7) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 25) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.Updates.updateShortMessage(flags: _1!, id: _2!, userId: _3!, message: _4!, pts: _5!, ptsCount: _6!, date: _7!, fwdFrom: _8, viaBotId: _9, replyTo: _10, entities: _11, ttlPeriod: _12) + return Api.Updates.updateShortMessage(Cons_updateShortMessage(flags: _1!, id: _2!, userId: _3!, message: _4!, pts: _5!, ptsCount: _6!, date: _7!, fwdFrom: _8, viaBotId: _9, replyTo: _10, entities: _11, ttlPeriod: _12)) } else { return nil @@ -281,15 +442,21 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: Api.MessageMedia? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } var _7: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 7) != 0 {if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _8: Int32? - if Int(_1!) & Int(1 << 25) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 25) != 0 { + _8 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -299,7 +466,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 25) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Updates.updateShortSentMessage(flags: _1!, id: _2!, pts: _3!, ptsCount: _4!, date: _5!, media: _6, entities: _7, ttlPeriod: _8) + return Api.Updates.updateShortSentMessage(Cons_updateShortSentMessage(flags: _1!, id: _2!, pts: _3!, ptsCount: _4!, date: _5!, media: _6, entities: _7, ttlPeriod: _8)) } else { return nil @@ -328,7 +495,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Updates.updates(updates: _1!, users: _2!, chats: _3!, date: _4!, seq: _5!) + return Api.Updates.updates(Cons_updates(updates: _1!, users: _2!, chats: _3!, date: _4!, seq: _5!)) } else { return nil @@ -360,7 +527,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Updates.updatesCombined(updates: _1!, users: _2!, chats: _3!, date: _4!, seqStart: _5!, seq: _6!) + return Api.Updates.updatesCombined(Cons_updatesCombined(updates: _1!, users: _2!, chats: _3!, date: _4!, seqStart: _5!, seq: _6!)) } else { return nil @@ -369,57 +536,71 @@ public extension Api { public static func parse_updatesTooLong(_ reader: BufferReader) -> Updates? { return Api.Updates.updatesTooLong } - } } public extension Api { enum UrlAuthResult: TypeConstructorDescription { - case urlAuthResultAccepted(url: String) + public class Cons_urlAuthResultAccepted { + public var url: String + public init(url: String) { + self.url = url + } + } + public class Cons_urlAuthResultRequest { + public var flags: Int32 + public var bot: Api.User + public var domain: String + public init(flags: Int32, bot: Api.User, domain: String) { + self.flags = flags + self.bot = bot + self.domain = domain + } + } + case urlAuthResultAccepted(Cons_urlAuthResultAccepted) case urlAuthResultDefault - case urlAuthResultRequest(flags: Int32, bot: Api.User, domain: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .urlAuthResultAccepted(let url): - if boxed { - buffer.appendInt32(-1886646706) - } - serializeString(url, buffer: buffer, boxed: false) - break - case .urlAuthResultDefault: - if boxed { - buffer.appendInt32(-1445536993) - } - - break - case .urlAuthResultRequest(let flags, let bot, let domain): - if boxed { - buffer.appendInt32(-1831650802) - } - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - serializeString(domain, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .urlAuthResultAccepted(let url): - return ("urlAuthResultAccepted", [("url", url as Any)]) - case .urlAuthResultDefault: + case urlAuthResultRequest(Cons_urlAuthResultRequest) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .urlAuthResultAccepted(let _data): + if boxed { + buffer.appendInt32(-1886646706) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .urlAuthResultDefault: + if boxed { + buffer.appendInt32(-1445536993) + } + break + case .urlAuthResultRequest(let _data): + if boxed { + buffer.appendInt32(-1831650802) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.bot.serialize(buffer, true) + serializeString(_data.domain, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .urlAuthResultAccepted(let _data): + return ("urlAuthResultAccepted", [("url", _data.url as Any)]) + case .urlAuthResultDefault: return ("urlAuthResultDefault", []) - case .urlAuthResultRequest(let flags, let bot, let domain): - return ("urlAuthResultRequest", [("flags", flags as Any), ("bot", bot as Any), ("domain", domain as Any)]) - } - } - + case .urlAuthResultRequest(let _data): + return ("urlAuthResultRequest", [("flags", _data.flags as Any), ("bot", _data.bot as Any), ("domain", _data.domain as Any)]) + } + } + public static func parse_urlAuthResultAccepted(_ reader: BufferReader) -> UrlAuthResult? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.UrlAuthResult.urlAuthResultAccepted(url: _1!) + return Api.UrlAuthResult.urlAuthResultAccepted(Cons_urlAuthResultAccepted(url: _1!)) } else { return nil @@ -441,75 +622,166 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.UrlAuthResult.urlAuthResultRequest(flags: _1!, bot: _2!, domain: _3!) + return Api.UrlAuthResult.urlAuthResultRequest(Cons_urlAuthResultRequest(flags: _1!, bot: _2!, domain: _3!)) } else { return nil } } - } } public extension Api { enum User: TypeConstructorDescription { - case user(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: Api.UserProfilePhoto?, status: Api.UserStatus?, botInfoVersion: Int32?, restrictionReason: [Api.RestrictionReason]?, botInlinePlaceholder: String?, langCode: String?, emojiStatus: Api.EmojiStatus?, usernames: [Api.Username]?, storiesMaxId: Api.RecentStory?, color: Api.PeerColor?, profileColor: Api.PeerColor?, botActiveUsers: Int32?, botVerificationIcon: Int64?, sendPaidMessagesStars: Int64?) - case userEmpty(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers, let botVerificationIcon, let sendPaidMessagesStars): - if boxed { - buffer.appendInt32(829899656) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(flags2, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(accessHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(firstName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(lastName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(username!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(phone!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {status!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt32(botInfoVersion!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(restrictionReason!.count)) - for item in restrictionReason! { + public class Cons_user { + public var flags: Int32 + public var flags2: Int32 + public var id: Int64 + public var accessHash: Int64? + public var firstName: String? + public var lastName: String? + public var username: String? + public var phone: String? + public var photo: Api.UserProfilePhoto? + public var status: Api.UserStatus? + public var botInfoVersion: Int32? + public var restrictionReason: [Api.RestrictionReason]? + public var botInlinePlaceholder: String? + public var langCode: String? + public var emojiStatus: Api.EmojiStatus? + public var usernames: [Api.Username]? + public var storiesMaxId: Api.RecentStory? + public var color: Api.PeerColor? + public var profileColor: Api.PeerColor? + public var botActiveUsers: Int32? + public var botVerificationIcon: Int64? + public var sendPaidMessagesStars: Int64? + public init(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, firstName: String?, lastName: String?, username: String?, phone: String?, photo: Api.UserProfilePhoto?, status: Api.UserStatus?, botInfoVersion: Int32?, restrictionReason: [Api.RestrictionReason]?, botInlinePlaceholder: String?, langCode: String?, emojiStatus: Api.EmojiStatus?, usernames: [Api.Username]?, storiesMaxId: Api.RecentStory?, color: Api.PeerColor?, profileColor: Api.PeerColor?, botActiveUsers: Int32?, botVerificationIcon: Int64?, sendPaidMessagesStars: Int64?) { + self.flags = flags + self.flags2 = flags2 + self.id = id + self.accessHash = accessHash + self.firstName = firstName + self.lastName = lastName + self.username = username + self.phone = phone + self.photo = photo + self.status = status + self.botInfoVersion = botInfoVersion + self.restrictionReason = restrictionReason + self.botInlinePlaceholder = botInlinePlaceholder + self.langCode = langCode + self.emojiStatus = emojiStatus + self.usernames = usernames + self.storiesMaxId = storiesMaxId + self.color = color + self.profileColor = profileColor + self.botActiveUsers = botActiveUsers + self.botVerificationIcon = botVerificationIcon + self.sendPaidMessagesStars = sendPaidMessagesStars + } + } + public class Cons_userEmpty { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + case user(Cons_user) + case userEmpty(Cons_userEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .user(let _data): + if boxed { + buffer.appendInt32(829899656) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.flags2, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.accessHash!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.firstName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.lastName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.username!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.phone!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.status!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt32(_data.botInfoVersion!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.restrictionReason!.count)) + for item in _data.restrictionReason! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 19) != 0 {serializeString(botInlinePlaceholder!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 22) != 0 {serializeString(langCode!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 30) != 0 {emojiStatus!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(usernames!.count)) - for item in usernames! { - item.serialize(buffer, true) - }} - if Int(flags2) & Int(1 << 5) != 0 {storiesMaxId!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 8) != 0 {color!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 9) != 0 {profileColor!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 12) != 0 {serializeInt32(botActiveUsers!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 14) != 0 {serializeInt64(botVerificationIcon!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 15) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - break - case .userEmpty(let id): - if boxed { - buffer.appendInt32(-742634630) } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .user(let flags, let flags2, let id, let accessHash, let firstName, let lastName, let username, let phone, let photo, let status, let botInfoVersion, let restrictionReason, let botInlinePlaceholder, let langCode, let emojiStatus, let usernames, let storiesMaxId, let color, let profileColor, let botActiveUsers, let botVerificationIcon, let sendPaidMessagesStars): - return ("user", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("username", username as Any), ("phone", phone as Any), ("photo", photo as Any), ("status", status as Any), ("botInfoVersion", botInfoVersion as Any), ("restrictionReason", restrictionReason as Any), ("botInlinePlaceholder", botInlinePlaceholder as Any), ("langCode", langCode as Any), ("emojiStatus", emojiStatus as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("botActiveUsers", botActiveUsers as Any), ("botVerificationIcon", botVerificationIcon as Any), ("sendPaidMessagesStars", sendPaidMessagesStars as Any)]) - case .userEmpty(let id): - return ("userEmpty", [("id", id as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 19) != 0 { + serializeString(_data.botInlinePlaceholder!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 22) != 0 { + serializeString(_data.langCode!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 30) != 0 { + _data.emojiStatus!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.usernames!.count)) + for item in _data.usernames! { + item.serialize(buffer, true) + } + } + if Int(_data.flags2) & Int(1 << 5) != 0 { + _data.storiesMaxId!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 8) != 0 { + _data.color!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 9) != 0 { + _data.profileColor!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 12) != 0 { + serializeInt32(_data.botActiveUsers!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 14) != 0 { + serializeInt64(_data.botVerificationIcon!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 15) != 0 { + serializeInt64(_data.sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + break + case .userEmpty(let _data): + if boxed { + buffer.appendInt32(-742634630) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .user(let _data): + return ("user", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("username", _data.username as Any), ("phone", _data.phone as Any), ("photo", _data.photo as Any), ("status", _data.status as Any), ("botInfoVersion", _data.botInfoVersion as Any), ("restrictionReason", _data.restrictionReason as Any), ("botInlinePlaceholder", _data.botInlinePlaceholder as Any), ("langCode", _data.langCode as Any), ("emojiStatus", _data.emojiStatus as Any), ("usernames", _data.usernames as Any), ("storiesMaxId", _data.storiesMaxId as Any), ("color", _data.color as Any), ("profileColor", _data.profileColor as Any), ("botActiveUsers", _data.botActiveUsers as Any), ("botVerificationIcon", _data.botVerificationIcon as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any)]) + case .userEmpty(let _data): + return ("userEmpty", [("id", _data.id as Any)]) + } + } + public static func parse_user(_ reader: BufferReader) -> User? { var _1: Int32? _1 = reader.readInt32() @@ -518,59 +790,97 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: String? - if Int(_1!) & Int(1 << 2) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } var _8: String? - if Int(_1!) & Int(1 << 4) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _8 = parseString(reader) + } var _9: Api.UserProfilePhoto? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.UserProfilePhoto - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.UserProfilePhoto + } + } var _10: Api.UserStatus? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.UserStatus - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.UserStatus + } + } var _11: Int32? - if Int(_1!) & Int(1 << 14) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 14) != 0 { + _11 = reader.readInt32() + } var _12: [Api.RestrictionReason]? - if Int(_1!) & Int(1 << 18) != 0 {if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) + } + } var _13: String? - if Int(_1!) & Int(1 << 19) != 0 {_13 = parseString(reader) } + if Int(_1!) & Int(1 << 19) != 0 { + _13 = parseString(reader) + } var _14: String? - if Int(_1!) & Int(1 << 22) != 0 {_14 = parseString(reader) } + if Int(_1!) & Int(1 << 22) != 0 { + _14 = parseString(reader) + } var _15: Api.EmojiStatus? - if Int(_1!) & Int(1 << 30) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.EmojiStatus - } } + if Int(_1!) & Int(1 << 30) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.EmojiStatus + } + } var _16: [Api.Username]? - if Int(_2!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) - } } + if Int(_2!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) + } + } var _17: Api.RecentStory? - if Int(_2!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.RecentStory - } } + if Int(_2!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.RecentStory + } + } var _18: Api.PeerColor? - if Int(_2!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_2!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _18 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _19: Api.PeerColor? - if Int(_2!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_2!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _20: Int32? - if Int(_2!) & Int(1 << 12) != 0 {_20 = reader.readInt32() } + if Int(_2!) & Int(1 << 12) != 0 { + _20 = reader.readInt32() + } var _21: Int64? - if Int(_2!) & Int(1 << 14) != 0 {_21 = reader.readInt64() } + if Int(_2!) & Int(1 << 14) != 0 { + _21 = reader.readInt64() + } var _22: Int64? - if Int(_2!) & Int(1 << 15) != 0 {_22 = reader.readInt64() } + if Int(_2!) & Int(1 << 15) != 0 { + _22 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -594,7 +904,7 @@ public extension Api { let _c21 = (Int(_2!) & Int(1 << 14) == 0) || _21 != nil let _c22 = (Int(_2!) & Int(1 << 15) == 0) || _22 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 { - return Api.User.user(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, firstName: _5, lastName: _6, username: _7, phone: _8, photo: _9, status: _10, botInfoVersion: _11, restrictionReason: _12, botInlinePlaceholder: _13, langCode: _14, emojiStatus: _15, usernames: _16, storiesMaxId: _17, color: _18, profileColor: _19, botActiveUsers: _20, botVerificationIcon: _21, sendPaidMessagesStars: _22) + return Api.User.user(Cons_user(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, firstName: _5, lastName: _6, username: _7, phone: _8, photo: _9, status: _10, botInfoVersion: _11, restrictionReason: _12, botInlinePlaceholder: _13, langCode: _14, emojiStatus: _15, usernames: _16, storiesMaxId: _17, color: _18, profileColor: _19, botActiveUsers: _20, botVerificationIcon: _21, sendPaidMessagesStars: _22)) } else { return nil @@ -605,75 +915,222 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.User.userEmpty(id: _1!) + return Api.User.userEmpty(Cons_userEmpty(id: _1!)) } else { return nil } } - } } public extension Api { enum UserFull: TypeConstructorDescription { - case userFull(flags: Int32, flags2: Int32, id: Int64, about: String?, settings: Api.PeerSettings, personalPhoto: Api.Photo?, profilePhoto: Api.Photo?, fallbackPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, botInfo: Api.BotInfo?, pinnedMsgId: Int32?, commonChatsCount: Int32, folderId: Int32?, ttlPeriod: Int32?, theme: Api.ChatTheme?, privateForwardName: String?, botGroupAdminRights: Api.ChatAdminRights?, botBroadcastAdminRights: Api.ChatAdminRights?, wallpaper: Api.WallPaper?, stories: Api.PeerStories?, businessWorkHours: Api.BusinessWorkHours?, businessLocation: Api.BusinessLocation?, businessGreetingMessage: Api.BusinessGreetingMessage?, businessAwayMessage: Api.BusinessAwayMessage?, businessIntro: Api.BusinessIntro?, birthday: Api.Birthday?, personalChannelId: Int64?, personalChannelMessage: Int32?, stargiftsCount: Int32?, starrefProgram: Api.StarRefProgram?, botVerification: Api.BotVerification?, sendPaidMessagesStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?, starsRating: Api.StarsRating?, starsMyPendingRating: Api.StarsRating?, starsMyPendingRatingDate: Int32?, mainTab: Api.ProfileTab?, savedMusic: Api.Document?, note: Api.TextWithEntities?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userFull(let flags, let flags2, let id, let about, let settings, let personalPhoto, let profilePhoto, let fallbackPhoto, let notifySettings, let botInfo, let pinnedMsgId, let commonChatsCount, let folderId, let ttlPeriod, let theme, let privateForwardName, let botGroupAdminRights, let botBroadcastAdminRights, let wallpaper, let stories, let businessWorkHours, let businessLocation, let businessGreetingMessage, let businessAwayMessage, let businessIntro, let birthday, let personalChannelId, let personalChannelMessage, let stargiftsCount, let starrefProgram, let botVerification, let sendPaidMessagesStars, let disallowedGifts, let starsRating, let starsMyPendingRating, let starsMyPendingRatingDate, let mainTab, let savedMusic, let note): - if boxed { - buffer.appendInt32(-1607745218) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(flags2, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - settings.serialize(buffer, true) - if Int(flags) & Int(1 << 21) != 0 {personalPhoto!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {profilePhoto!.serialize(buffer, true)} - if Int(flags) & Int(1 << 22) != 0 {fallbackPhoto!.serialize(buffer, true)} - notifySettings.serialize(buffer, true) - if Int(flags) & Int(1 << 3) != 0 {botInfo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(pinnedMsgId!, buffer: buffer, boxed: false)} - serializeInt32(commonChatsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {theme!.serialize(buffer, true)} - if Int(flags) & Int(1 << 16) != 0 {serializeString(privateForwardName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {botGroupAdminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {botBroadcastAdminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 24) != 0 {wallpaper!.serialize(buffer, true)} - if Int(flags) & Int(1 << 25) != 0 {stories!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 0) != 0 {businessWorkHours!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 1) != 0 {businessLocation!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 2) != 0 {businessGreetingMessage!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 3) != 0 {businessAwayMessage!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 4) != 0 {businessIntro!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 5) != 0 {birthday!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 6) != 0 {serializeInt64(personalChannelId!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 6) != 0 {serializeInt32(personalChannelMessage!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 8) != 0 {serializeInt32(stargiftsCount!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 11) != 0 {starrefProgram!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 12) != 0 {botVerification!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 14) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 15) != 0 {disallowedGifts!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 17) != 0 {starsRating!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 18) != 0 {starsMyPendingRating!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 18) != 0 {serializeInt32(starsMyPendingRatingDate!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 20) != 0 {mainTab!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 21) != 0 {savedMusic!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 22) != 0 {note!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .userFull(let flags, let flags2, let id, let about, let settings, let personalPhoto, let profilePhoto, let fallbackPhoto, let notifySettings, let botInfo, let pinnedMsgId, let commonChatsCount, let folderId, let ttlPeriod, let theme, let privateForwardName, let botGroupAdminRights, let botBroadcastAdminRights, let wallpaper, let stories, let businessWorkHours, let businessLocation, let businessGreetingMessage, let businessAwayMessage, let businessIntro, let birthday, let personalChannelId, let personalChannelMessage, let stargiftsCount, let starrefProgram, let botVerification, let sendPaidMessagesStars, let disallowedGifts, let starsRating, let starsMyPendingRating, let starsMyPendingRatingDate, let mainTab, let savedMusic, let note): - return ("userFull", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("about", about as Any), ("settings", settings as Any), ("personalPhoto", personalPhoto as Any), ("profilePhoto", profilePhoto as Any), ("fallbackPhoto", fallbackPhoto as Any), ("notifySettings", notifySettings as Any), ("botInfo", botInfo as Any), ("pinnedMsgId", pinnedMsgId as Any), ("commonChatsCount", commonChatsCount as Any), ("folderId", folderId as Any), ("ttlPeriod", ttlPeriod as Any), ("theme", theme as Any), ("privateForwardName", privateForwardName as Any), ("botGroupAdminRights", botGroupAdminRights as Any), ("botBroadcastAdminRights", botBroadcastAdminRights as Any), ("wallpaper", wallpaper as Any), ("stories", stories as Any), ("businessWorkHours", businessWorkHours as Any), ("businessLocation", businessLocation as Any), ("businessGreetingMessage", businessGreetingMessage as Any), ("businessAwayMessage", businessAwayMessage as Any), ("businessIntro", businessIntro as Any), ("birthday", birthday as Any), ("personalChannelId", personalChannelId as Any), ("personalChannelMessage", personalChannelMessage as Any), ("stargiftsCount", stargiftsCount as Any), ("starrefProgram", starrefProgram as Any), ("botVerification", botVerification as Any), ("sendPaidMessagesStars", sendPaidMessagesStars as Any), ("disallowedGifts", disallowedGifts as Any), ("starsRating", starsRating as Any), ("starsMyPendingRating", starsMyPendingRating as Any), ("starsMyPendingRatingDate", starsMyPendingRatingDate as Any), ("mainTab", mainTab as Any), ("savedMusic", savedMusic as Any), ("note", note as Any)]) - } - } - + public class Cons_userFull { + public var flags: Int32 + public var flags2: Int32 + public var id: Int64 + public var about: String? + public var settings: Api.PeerSettings + public var personalPhoto: Api.Photo? + public var profilePhoto: Api.Photo? + public var fallbackPhoto: Api.Photo? + public var notifySettings: Api.PeerNotifySettings + public var botInfo: Api.BotInfo? + public var pinnedMsgId: Int32? + public var commonChatsCount: Int32 + public var folderId: Int32? + public var ttlPeriod: Int32? + public var theme: Api.ChatTheme? + public var privateForwardName: String? + public var botGroupAdminRights: Api.ChatAdminRights? + public var botBroadcastAdminRights: Api.ChatAdminRights? + public var wallpaper: Api.WallPaper? + public var stories: Api.PeerStories? + public var businessWorkHours: Api.BusinessWorkHours? + public var businessLocation: Api.BusinessLocation? + public var businessGreetingMessage: Api.BusinessGreetingMessage? + public var businessAwayMessage: Api.BusinessAwayMessage? + public var businessIntro: Api.BusinessIntro? + public var birthday: Api.Birthday? + public var personalChannelId: Int64? + public var personalChannelMessage: Int32? + public var stargiftsCount: Int32? + public var starrefProgram: Api.StarRefProgram? + public var botVerification: Api.BotVerification? + public var sendPaidMessagesStars: Int64? + public var disallowedGifts: Api.DisallowedGiftsSettings? + public var starsRating: Api.StarsRating? + public var starsMyPendingRating: Api.StarsRating? + public var starsMyPendingRatingDate: Int32? + public var mainTab: Api.ProfileTab? + public var savedMusic: Api.Document? + public var note: Api.TextWithEntities? + public init(flags: Int32, flags2: Int32, id: Int64, about: String?, settings: Api.PeerSettings, personalPhoto: Api.Photo?, profilePhoto: Api.Photo?, fallbackPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, botInfo: Api.BotInfo?, pinnedMsgId: Int32?, commonChatsCount: Int32, folderId: Int32?, ttlPeriod: Int32?, theme: Api.ChatTheme?, privateForwardName: String?, botGroupAdminRights: Api.ChatAdminRights?, botBroadcastAdminRights: Api.ChatAdminRights?, wallpaper: Api.WallPaper?, stories: Api.PeerStories?, businessWorkHours: Api.BusinessWorkHours?, businessLocation: Api.BusinessLocation?, businessGreetingMessage: Api.BusinessGreetingMessage?, businessAwayMessage: Api.BusinessAwayMessage?, businessIntro: Api.BusinessIntro?, birthday: Api.Birthday?, personalChannelId: Int64?, personalChannelMessage: Int32?, stargiftsCount: Int32?, starrefProgram: Api.StarRefProgram?, botVerification: Api.BotVerification?, sendPaidMessagesStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?, starsRating: Api.StarsRating?, starsMyPendingRating: Api.StarsRating?, starsMyPendingRatingDate: Int32?, mainTab: Api.ProfileTab?, savedMusic: Api.Document?, note: Api.TextWithEntities?) { + self.flags = flags + self.flags2 = flags2 + self.id = id + self.about = about + self.settings = settings + self.personalPhoto = personalPhoto + self.profilePhoto = profilePhoto + self.fallbackPhoto = fallbackPhoto + self.notifySettings = notifySettings + self.botInfo = botInfo + self.pinnedMsgId = pinnedMsgId + self.commonChatsCount = commonChatsCount + self.folderId = folderId + self.ttlPeriod = ttlPeriod + self.theme = theme + self.privateForwardName = privateForwardName + self.botGroupAdminRights = botGroupAdminRights + self.botBroadcastAdminRights = botBroadcastAdminRights + self.wallpaper = wallpaper + self.stories = stories + self.businessWorkHours = businessWorkHours + self.businessLocation = businessLocation + self.businessGreetingMessage = businessGreetingMessage + self.businessAwayMessage = businessAwayMessage + self.businessIntro = businessIntro + self.birthday = birthday + self.personalChannelId = personalChannelId + self.personalChannelMessage = personalChannelMessage + self.stargiftsCount = stargiftsCount + self.starrefProgram = starrefProgram + self.botVerification = botVerification + self.sendPaidMessagesStars = sendPaidMessagesStars + self.disallowedGifts = disallowedGifts + self.starsRating = starsRating + self.starsMyPendingRating = starsMyPendingRating + self.starsMyPendingRatingDate = starsMyPendingRatingDate + self.mainTab = mainTab + self.savedMusic = savedMusic + self.note = note + } + } + case userFull(Cons_userFull) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userFull(let _data): + if boxed { + buffer.appendInt32(-1607745218) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.flags2, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.about!, buffer: buffer, boxed: false) + } + _data.settings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 21) != 0 { + _data.personalPhoto!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.profilePhoto!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 22) != 0 { + _data.fallbackPhoto!.serialize(buffer, true) + } + _data.notifySettings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.botInfo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.pinnedMsgId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.commonChatsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.theme!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.privateForwardName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + _data.botGroupAdminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.botBroadcastAdminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 24) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 25) != 0 { + _data.stories!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 0) != 0 { + _data.businessWorkHours!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 1) != 0 { + _data.businessLocation!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 2) != 0 { + _data.businessGreetingMessage!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 3) != 0 { + _data.businessAwayMessage!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 4) != 0 { + _data.businessIntro!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 5) != 0 { + _data.birthday!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 6) != 0 { + serializeInt64(_data.personalChannelId!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 6) != 0 { + serializeInt32(_data.personalChannelMessage!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 8) != 0 { + serializeInt32(_data.stargiftsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 11) != 0 { + _data.starrefProgram!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 12) != 0 { + _data.botVerification!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 14) != 0 { + serializeInt64(_data.sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 15) != 0 { + _data.disallowedGifts!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 17) != 0 { + _data.starsRating!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 18) != 0 { + _data.starsMyPendingRating!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 18) != 0 { + serializeInt32(_data.starsMyPendingRatingDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 20) != 0 { + _data.mainTab!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 21) != 0 { + _data.savedMusic!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 22) != 0 { + _data.note!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .userFull(let _data): + return ("userFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("settings", _data.settings as Any), ("personalPhoto", _data.personalPhoto as Any), ("profilePhoto", _data.profilePhoto as Any), ("fallbackPhoto", _data.fallbackPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("commonChatsCount", _data.commonChatsCount as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("theme", _data.theme as Any), ("privateForwardName", _data.privateForwardName as Any), ("botGroupAdminRights", _data.botGroupAdminRights as Any), ("botBroadcastAdminRights", _data.botBroadcastAdminRights as Any), ("wallpaper", _data.wallpaper as Any), ("stories", _data.stories as Any), ("businessWorkHours", _data.businessWorkHours as Any), ("businessLocation", _data.businessLocation as Any), ("businessGreetingMessage", _data.businessGreetingMessage as Any), ("businessAwayMessage", _data.businessAwayMessage as Any), ("businessIntro", _data.businessIntro as Any), ("birthday", _data.birthday as Any), ("personalChannelId", _data.personalChannelId as Any), ("personalChannelMessage", _data.personalChannelMessage as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("starrefProgram", _data.starrefProgram as Any), ("botVerification", _data.botVerification as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("disallowedGifts", _data.disallowedGifts as Any), ("starsRating", _data.starsRating as Any), ("starsMyPendingRating", _data.starsMyPendingRating as Any), ("starsMyPendingRatingDate", _data.starsMyPendingRatingDate as Any), ("mainTab", _data.mainTab as Any), ("savedMusic", _data.savedMusic as Any), ("note", _data.note as Any)]) + } + } + public static func parse_userFull(_ reader: BufferReader) -> UserFull? { var _1: Int32? _1 = reader.readInt32() @@ -682,127 +1139,193 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: Api.PeerSettings? if let signature = reader.readInt32() { _5 = Api.parse(reader, signature: signature) as? Api.PeerSettings } var _6: Api.Photo? - if Int(_1!) & Int(1 << 21) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 21) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _7: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _8: Api.Photo? - if Int(_1!) & Int(1 << 22) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 22) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _9: Api.PeerNotifySettings? if let signature = reader.readInt32() { _9 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } var _10: Api.BotInfo? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.BotInfo - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.BotInfo + } + } var _11: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _11 = reader.readInt32() + } var _12: Int32? _12 = reader.readInt32() var _13: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _13 = reader.readInt32() + } var _14: Int32? - if Int(_1!) & Int(1 << 14) != 0 {_14 = reader.readInt32() } + if Int(_1!) & Int(1 << 14) != 0 { + _14 = reader.readInt32() + } var _15: Api.ChatTheme? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.ChatTheme - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.ChatTheme + } + } var _16: String? - if Int(_1!) & Int(1 << 16) != 0 {_16 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _16 = parseString(reader) + } var _17: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _18: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _18 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _19: Api.WallPaper? - if Int(_1!) & Int(1 << 24) != 0 {if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.WallPaper - } } + if Int(_1!) & Int(1 << 24) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + } var _20: Api.PeerStories? - if Int(_1!) & Int(1 << 25) != 0 {if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.PeerStories - } } + if Int(_1!) & Int(1 << 25) != 0 { + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.PeerStories + } + } var _21: Api.BusinessWorkHours? - if Int(_2!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _21 = Api.parse(reader, signature: signature) as? Api.BusinessWorkHours - } } + if Int(_2!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _21 = Api.parse(reader, signature: signature) as? Api.BusinessWorkHours + } + } var _22: Api.BusinessLocation? - if Int(_2!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _22 = Api.parse(reader, signature: signature) as? Api.BusinessLocation - } } + if Int(_2!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _22 = Api.parse(reader, signature: signature) as? Api.BusinessLocation + } + } var _23: Api.BusinessGreetingMessage? - if Int(_2!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _23 = Api.parse(reader, signature: signature) as? Api.BusinessGreetingMessage - } } + if Int(_2!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _23 = Api.parse(reader, signature: signature) as? Api.BusinessGreetingMessage + } + } var _24: Api.BusinessAwayMessage? - if Int(_2!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _24 = Api.parse(reader, signature: signature) as? Api.BusinessAwayMessage - } } + if Int(_2!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _24 = Api.parse(reader, signature: signature) as? Api.BusinessAwayMessage + } + } var _25: Api.BusinessIntro? - if Int(_2!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _25 = Api.parse(reader, signature: signature) as? Api.BusinessIntro - } } + if Int(_2!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _25 = Api.parse(reader, signature: signature) as? Api.BusinessIntro + } + } var _26: Api.Birthday? - if Int(_2!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _26 = Api.parse(reader, signature: signature) as? Api.Birthday - } } + if Int(_2!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _26 = Api.parse(reader, signature: signature) as? Api.Birthday + } + } var _27: Int64? - if Int(_2!) & Int(1 << 6) != 0 {_27 = reader.readInt64() } + if Int(_2!) & Int(1 << 6) != 0 { + _27 = reader.readInt64() + } var _28: Int32? - if Int(_2!) & Int(1 << 6) != 0 {_28 = reader.readInt32() } + if Int(_2!) & Int(1 << 6) != 0 { + _28 = reader.readInt32() + } var _29: Int32? - if Int(_2!) & Int(1 << 8) != 0 {_29 = reader.readInt32() } + if Int(_2!) & Int(1 << 8) != 0 { + _29 = reader.readInt32() + } var _30: Api.StarRefProgram? - if Int(_2!) & Int(1 << 11) != 0 {if let signature = reader.readInt32() { - _30 = Api.parse(reader, signature: signature) as? Api.StarRefProgram - } } + if Int(_2!) & Int(1 << 11) != 0 { + if let signature = reader.readInt32() { + _30 = Api.parse(reader, signature: signature) as? Api.StarRefProgram + } + } var _31: Api.BotVerification? - if Int(_2!) & Int(1 << 12) != 0 {if let signature = reader.readInt32() { - _31 = Api.parse(reader, signature: signature) as? Api.BotVerification - } } + if Int(_2!) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _31 = Api.parse(reader, signature: signature) as? Api.BotVerification + } + } var _32: Int64? - if Int(_2!) & Int(1 << 14) != 0 {_32 = reader.readInt64() } + if Int(_2!) & Int(1 << 14) != 0 { + _32 = reader.readInt64() + } var _33: Api.DisallowedGiftsSettings? - if Int(_2!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _33 = Api.parse(reader, signature: signature) as? Api.DisallowedGiftsSettings - } } + if Int(_2!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _33 = Api.parse(reader, signature: signature) as? Api.DisallowedGiftsSettings + } + } var _34: Api.StarsRating? - if Int(_2!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _34 = Api.parse(reader, signature: signature) as? Api.StarsRating - } } + if Int(_2!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _34 = Api.parse(reader, signature: signature) as? Api.StarsRating + } + } var _35: Api.StarsRating? - if Int(_2!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _35 = Api.parse(reader, signature: signature) as? Api.StarsRating - } } + if Int(_2!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _35 = Api.parse(reader, signature: signature) as? Api.StarsRating + } + } var _36: Int32? - if Int(_2!) & Int(1 << 18) != 0 {_36 = reader.readInt32() } + if Int(_2!) & Int(1 << 18) != 0 { + _36 = reader.readInt32() + } var _37: Api.ProfileTab? - if Int(_2!) & Int(1 << 20) != 0 {if let signature = reader.readInt32() { - _37 = Api.parse(reader, signature: signature) as? Api.ProfileTab - } } + if Int(_2!) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _37 = Api.parse(reader, signature: signature) as? Api.ProfileTab + } + } var _38: Api.Document? - if Int(_2!) & Int(1 << 21) != 0 {if let signature = reader.readInt32() { - _38 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_2!) & Int(1 << 21) != 0 { + if let signature = reader.readInt32() { + _38 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _39: Api.TextWithEntities? - if Int(_2!) & Int(1 << 22) != 0 {if let signature = reader.readInt32() { - _39 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_2!) & Int(1 << 22) != 0 { + if let signature = reader.readInt32() { + _39 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -843,56 +1366,70 @@ public extension Api { let _c38 = (Int(_2!) & Int(1 << 21) == 0) || _38 != nil let _c39 = (Int(_2!) & Int(1 << 22) == 0) || _39 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 && _c34 && _c35 && _c36 && _c37 && _c38 && _c39 { - return Api.UserFull.userFull(flags: _1!, flags2: _2!, id: _3!, about: _4, settings: _5!, personalPhoto: _6, profilePhoto: _7, fallbackPhoto: _8, notifySettings: _9!, botInfo: _10, pinnedMsgId: _11, commonChatsCount: _12!, folderId: _13, ttlPeriod: _14, theme: _15, privateForwardName: _16, botGroupAdminRights: _17, botBroadcastAdminRights: _18, wallpaper: _19, stories: _20, businessWorkHours: _21, businessLocation: _22, businessGreetingMessage: _23, businessAwayMessage: _24, businessIntro: _25, birthday: _26, personalChannelId: _27, personalChannelMessage: _28, stargiftsCount: _29, starrefProgram: _30, botVerification: _31, sendPaidMessagesStars: _32, disallowedGifts: _33, starsRating: _34, starsMyPendingRating: _35, starsMyPendingRatingDate: _36, mainTab: _37, savedMusic: _38, note: _39) + return Api.UserFull.userFull(Cons_userFull(flags: _1!, flags2: _2!, id: _3!, about: _4, settings: _5!, personalPhoto: _6, profilePhoto: _7, fallbackPhoto: _8, notifySettings: _9!, botInfo: _10, pinnedMsgId: _11, commonChatsCount: _12!, folderId: _13, ttlPeriod: _14, theme: _15, privateForwardName: _16, botGroupAdminRights: _17, botBroadcastAdminRights: _18, wallpaper: _19, stories: _20, businessWorkHours: _21, businessLocation: _22, businessGreetingMessage: _23, businessAwayMessage: _24, businessIntro: _25, birthday: _26, personalChannelId: _27, personalChannelMessage: _28, stargiftsCount: _29, starrefProgram: _30, botVerification: _31, sendPaidMessagesStars: _32, disallowedGifts: _33, starsRating: _34, starsMyPendingRating: _35, starsMyPendingRatingDate: _36, mainTab: _37, savedMusic: _38, note: _39)) } else { return nil } } - } } public extension Api { enum UserProfilePhoto: TypeConstructorDescription { - case userProfilePhoto(flags: Int32, photoId: Int64, strippedThumb: Buffer?, dcId: Int32) + public class Cons_userProfilePhoto { + public var flags: Int32 + public var photoId: Int64 + public var strippedThumb: Buffer? + public var dcId: Int32 + public init(flags: Int32, photoId: Int64, strippedThumb: Buffer?, dcId: Int32) { + self.flags = flags + self.photoId = photoId + self.strippedThumb = strippedThumb + self.dcId = dcId + } + } + case userProfilePhoto(Cons_userProfilePhoto) case userProfilePhotoEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userProfilePhoto(let flags, let photoId, let strippedThumb, let dcId): - if boxed { - buffer.appendInt32(-2100168954) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(photoId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeBytes(strippedThumb!, buffer: buffer, boxed: false)} - serializeInt32(dcId, buffer: buffer, boxed: false) - break - case .userProfilePhotoEmpty: - if boxed { - buffer.appendInt32(1326562017) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .userProfilePhoto(let flags, let photoId, let strippedThumb, let dcId): - return ("userProfilePhoto", [("flags", flags as Any), ("photoId", photoId as Any), ("strippedThumb", strippedThumb as Any), ("dcId", dcId as Any)]) - case .userProfilePhotoEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userProfilePhoto(let _data): + if boxed { + buffer.appendInt32(-2100168954) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.photoId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeBytes(_data.strippedThumb!, buffer: buffer, boxed: false) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + break + case .userProfilePhotoEmpty: + if boxed { + buffer.appendInt32(1326562017) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .userProfilePhoto(let _data): + return ("userProfilePhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("strippedThumb", _data.strippedThumb as Any), ("dcId", _data.dcId as Any)]) + case .userProfilePhotoEmpty: return ("userProfilePhotoEmpty", []) - } - } - + } + } + public static func parse_userProfilePhoto(_ reader: BufferReader) -> UserProfilePhoto? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: Buffer? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseBytes(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseBytes(reader) + } var _4: Int32? _4 = reader.readInt32() let _c1 = _1 != nil @@ -900,7 +1437,7 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.UserProfilePhoto.userProfilePhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!) + return Api.UserProfilePhoto.userProfilePhoto(Cons_userProfilePhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!)) } else { return nil @@ -909,76 +1446,104 @@ public extension Api { public static func parse_userProfilePhotoEmpty(_ reader: BufferReader) -> UserProfilePhoto? { return Api.UserProfilePhoto.userProfilePhotoEmpty } - } } public extension Api { enum UserStatus: TypeConstructorDescription { + public class Cons_userStatusLastMonth { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_userStatusLastWeek { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_userStatusOffline { + public var wasOnline: Int32 + public init(wasOnline: Int32) { + self.wasOnline = wasOnline + } + } + public class Cons_userStatusOnline { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + } + public class Cons_userStatusRecently { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } case userStatusEmpty - case userStatusLastMonth(flags: Int32) - case userStatusLastWeek(flags: Int32) - case userStatusOffline(wasOnline: Int32) - case userStatusOnline(expires: Int32) - case userStatusRecently(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userStatusEmpty: - if boxed { - buffer.appendInt32(164646985) - } - - break - case .userStatusLastMonth(let flags): - if boxed { - buffer.appendInt32(1703516023) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .userStatusLastWeek(let flags): - if boxed { - buffer.appendInt32(1410997530) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .userStatusOffline(let wasOnline): - if boxed { - buffer.appendInt32(9203775) - } - serializeInt32(wasOnline, buffer: buffer, boxed: false) - break - case .userStatusOnline(let expires): - if boxed { - buffer.appendInt32(-306628279) - } - serializeInt32(expires, buffer: buffer, boxed: false) - break - case .userStatusRecently(let flags): - if boxed { - buffer.appendInt32(2065268168) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .userStatusEmpty: + case userStatusLastMonth(Cons_userStatusLastMonth) + case userStatusLastWeek(Cons_userStatusLastWeek) + case userStatusOffline(Cons_userStatusOffline) + case userStatusOnline(Cons_userStatusOnline) + case userStatusRecently(Cons_userStatusRecently) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userStatusEmpty: + if boxed { + buffer.appendInt32(164646985) + } + break + case .userStatusLastMonth(let _data): + if boxed { + buffer.appendInt32(1703516023) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .userStatusLastWeek(let _data): + if boxed { + buffer.appendInt32(1410997530) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .userStatusOffline(let _data): + if boxed { + buffer.appendInt32(9203775) + } + serializeInt32(_data.wasOnline, buffer: buffer, boxed: false) + break + case .userStatusOnline(let _data): + if boxed { + buffer.appendInt32(-306628279) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + case .userStatusRecently(let _data): + if boxed { + buffer.appendInt32(2065268168) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .userStatusEmpty: return ("userStatusEmpty", []) - case .userStatusLastMonth(let flags): - return ("userStatusLastMonth", [("flags", flags as Any)]) - case .userStatusLastWeek(let flags): - return ("userStatusLastWeek", [("flags", flags as Any)]) - case .userStatusOffline(let wasOnline): - return ("userStatusOffline", [("wasOnline", wasOnline as Any)]) - case .userStatusOnline(let expires): - return ("userStatusOnline", [("expires", expires as Any)]) - case .userStatusRecently(let flags): - return ("userStatusRecently", [("flags", flags as Any)]) - } - } - + case .userStatusLastMonth(let _data): + return ("userStatusLastMonth", [("flags", _data.flags as Any)]) + case .userStatusLastWeek(let _data): + return ("userStatusLastWeek", [("flags", _data.flags as Any)]) + case .userStatusOffline(let _data): + return ("userStatusOffline", [("wasOnline", _data.wasOnline as Any)]) + case .userStatusOnline(let _data): + return ("userStatusOnline", [("expires", _data.expires as Any)]) + case .userStatusRecently(let _data): + return ("userStatusRecently", [("flags", _data.flags as Any)]) + } + } + public static func parse_userStatusEmpty(_ reader: BufferReader) -> UserStatus? { return Api.UserStatus.userStatusEmpty } @@ -987,7 +1552,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.UserStatus.userStatusLastMonth(flags: _1!) + return Api.UserStatus.userStatusLastMonth(Cons_userStatusLastMonth(flags: _1!)) } else { return nil @@ -998,7 +1563,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.UserStatus.userStatusLastWeek(flags: _1!) + return Api.UserStatus.userStatusLastWeek(Cons_userStatusLastWeek(flags: _1!)) } else { return nil @@ -1009,7 +1574,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.UserStatus.userStatusOffline(wasOnline: _1!) + return Api.UserStatus.userStatusOffline(Cons_userStatusOffline(wasOnline: _1!)) } else { return nil @@ -1020,7 +1585,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.UserStatus.userStatusOnline(expires: _1!) + return Api.UserStatus.userStatusOnline(Cons_userStatusOnline(expires: _1!)) } else { return nil @@ -1031,38 +1596,45 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.UserStatus.userStatusRecently(flags: _1!) + return Api.UserStatus.userStatusRecently(Cons_userStatusRecently(flags: _1!)) } else { return nil } } - } } public extension Api { enum Username: TypeConstructorDescription { - case username(flags: Int32, username: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .username(let flags, let username): - if boxed { - buffer.appendInt32(-1274595769) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(username, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .username(let flags, let username): - return ("username", [("flags", flags as Any), ("username", username as Any)]) - } - } - + public class Cons_username { + public var flags: Int32 + public var username: String + public init(flags: Int32, username: String) { + self.flags = flags + self.username = username + } + } + case username(Cons_username) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .username(let _data): + if boxed { + buffer.appendInt32(-1274595769) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.username, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .username(let _data): + return ("username", [("flags", _data.flags as Any), ("username", _data.username as Any)]) + } + } + public static func parse_username(_ reader: BufferReader) -> Username? { var _1: Int32? _1 = reader.readInt32() @@ -1071,71 +1643,106 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Username.username(flags: _1!, username: _2!) + return Api.Username.username(Cons_username(flags: _1!, username: _2!)) } else { return nil } } - } } public extension Api { enum VideoSize: TypeConstructorDescription { - case videoSize(flags: Int32, type: String, w: Int32, h: Int32, size: Int32, videoStartTs: Double?) - case videoSizeEmojiMarkup(emojiId: Int64, backgroundColors: [Int32]) - case videoSizeStickerMarkup(stickerset: Api.InputStickerSet, stickerId: Int64, backgroundColors: [Int32]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .videoSize(let flags, let type, let w, let h, let size, let videoStartTs): - if boxed { - buffer.appendInt32(-567037804) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)} - break - case .videoSizeEmojiMarkup(let emojiId, let backgroundColors): - if boxed { - buffer.appendInt32(-128171716) - } - serializeInt64(emojiId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(backgroundColors.count)) - for item in backgroundColors { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .videoSizeStickerMarkup(let stickerset, let stickerId, let backgroundColors): - if boxed { - buffer.appendInt32(228623102) - } - stickerset.serialize(buffer, true) - serializeInt64(stickerId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(backgroundColors.count)) - for item in backgroundColors { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .videoSize(let flags, let type, let w, let h, let size, let videoStartTs): - return ("videoSize", [("flags", flags as Any), ("type", type as Any), ("w", w as Any), ("h", h as Any), ("size", size as Any), ("videoStartTs", videoStartTs as Any)]) - case .videoSizeEmojiMarkup(let emojiId, let backgroundColors): - return ("videoSizeEmojiMarkup", [("emojiId", emojiId as Any), ("backgroundColors", backgroundColors as Any)]) - case .videoSizeStickerMarkup(let stickerset, let stickerId, let backgroundColors): - return ("videoSizeStickerMarkup", [("stickerset", stickerset as Any), ("stickerId", stickerId as Any), ("backgroundColors", backgroundColors as Any)]) - } - } - + public class Cons_videoSize { + public var flags: Int32 + public var type: String + public var w: Int32 + public var h: Int32 + public var size: Int32 + public var videoStartTs: Double? + public init(flags: Int32, type: String, w: Int32, h: Int32, size: Int32, videoStartTs: Double?) { + self.flags = flags + self.type = type + self.w = w + self.h = h + self.size = size + self.videoStartTs = videoStartTs + } + } + public class Cons_videoSizeEmojiMarkup { + public var emojiId: Int64 + public var backgroundColors: [Int32] + public init(emojiId: Int64, backgroundColors: [Int32]) { + self.emojiId = emojiId + self.backgroundColors = backgroundColors + } + } + public class Cons_videoSizeStickerMarkup { + public var stickerset: Api.InputStickerSet + public var stickerId: Int64 + public var backgroundColors: [Int32] + public init(stickerset: Api.InputStickerSet, stickerId: Int64, backgroundColors: [Int32]) { + self.stickerset = stickerset + self.stickerId = stickerId + self.backgroundColors = backgroundColors + } + } + case videoSize(Cons_videoSize) + case videoSizeEmojiMarkup(Cons_videoSizeEmojiMarkup) + case videoSizeStickerMarkup(Cons_videoSizeStickerMarkup) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .videoSize(let _data): + if boxed { + buffer.appendInt32(-567037804) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + serializeInt32(_data.size, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeDouble(_data.videoStartTs!, buffer: buffer, boxed: false) + } + break + case .videoSizeEmojiMarkup(let _data): + if boxed { + buffer.appendInt32(-128171716) + } + serializeInt64(_data.emojiId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.backgroundColors.count)) + for item in _data.backgroundColors { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .videoSizeStickerMarkup(let _data): + if boxed { + buffer.appendInt32(228623102) + } + _data.stickerset.serialize(buffer, true) + serializeInt64(_data.stickerId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.backgroundColors.count)) + for item in _data.backgroundColors { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .videoSize(let _data): + return ("videoSize", [("flags", _data.flags as Any), ("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("size", _data.size as Any), ("videoStartTs", _data.videoStartTs as Any)]) + case .videoSizeEmojiMarkup(let _data): + return ("videoSizeEmojiMarkup", [("emojiId", _data.emojiId as Any), ("backgroundColors", _data.backgroundColors as Any)]) + case .videoSizeStickerMarkup(let _data): + return ("videoSizeStickerMarkup", [("stickerset", _data.stickerset as Any), ("stickerId", _data.stickerId as Any), ("backgroundColors", _data.backgroundColors as Any)]) + } + } + public static func parse_videoSize(_ reader: BufferReader) -> VideoSize? { var _1: Int32? _1 = reader.readInt32() @@ -1148,7 +1755,9 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: Double? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readDouble() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readDouble() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1156,7 +1765,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.VideoSize.videoSize(flags: _1!, type: _2!, w: _3!, h: _4!, size: _5!, videoStartTs: _6) + return Api.VideoSize.videoSize(Cons_videoSize(flags: _1!, type: _2!, w: _3!, h: _4!, size: _5!, videoStartTs: _6)) } else { return nil @@ -1172,7 +1781,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.VideoSize.videoSizeEmojiMarkup(emojiId: _1!, backgroundColors: _2!) + return Api.VideoSize.videoSizeEmojiMarkup(Cons_videoSizeEmojiMarkup(emojiId: _1!, backgroundColors: _2!)) } else { return nil @@ -1193,53 +1802,82 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.VideoSize.videoSizeStickerMarkup(stickerset: _1!, stickerId: _2!, backgroundColors: _3!) + return Api.VideoSize.videoSizeStickerMarkup(Cons_videoSizeStickerMarkup(stickerset: _1!, stickerId: _2!, backgroundColors: _3!)) } else { return nil } } - } } public extension Api { enum WallPaper: TypeConstructorDescription { - case wallPaper(id: Int64, flags: Int32, accessHash: Int64, slug: String, document: Api.Document, settings: Api.WallPaperSettings?) - case wallPaperNoFile(id: Int64, flags: Int32, settings: Api.WallPaperSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .wallPaper(let id, let flags, let accessHash, let slug, let document, let settings): - if boxed { - buffer.appendInt32(-1539849235) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - document.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {settings!.serialize(buffer, true)} - break - case .wallPaperNoFile(let id, let flags, let settings): - if boxed { - buffer.appendInt32(-528465642) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {settings!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .wallPaper(let id, let flags, let accessHash, let slug, let document, let settings): - return ("wallPaper", [("id", id as Any), ("flags", flags as Any), ("accessHash", accessHash as Any), ("slug", slug as Any), ("document", document as Any), ("settings", settings as Any)]) - case .wallPaperNoFile(let id, let flags, let settings): - return ("wallPaperNoFile", [("id", id as Any), ("flags", flags as Any), ("settings", settings as Any)]) - } - } - + public class Cons_wallPaper { + public var id: Int64 + public var flags: Int32 + public var accessHash: Int64 + public var slug: String + public var document: Api.Document + public var settings: Api.WallPaperSettings? + public init(id: Int64, flags: Int32, accessHash: Int64, slug: String, document: Api.Document, settings: Api.WallPaperSettings?) { + self.id = id + self.flags = flags + self.accessHash = accessHash + self.slug = slug + self.document = document + self.settings = settings + } + } + public class Cons_wallPaperNoFile { + public var id: Int64 + public var flags: Int32 + public var settings: Api.WallPaperSettings? + public init(id: Int64, flags: Int32, settings: Api.WallPaperSettings?) { + self.id = id + self.flags = flags + self.settings = settings + } + } + case wallPaper(Cons_wallPaper) + case wallPaperNoFile(Cons_wallPaperNoFile) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .wallPaper(let _data): + if boxed { + buffer.appendInt32(-1539849235) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + _data.document.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.settings!.serialize(buffer, true) + } + break + case .wallPaperNoFile(let _data): + if boxed { + buffer.appendInt32(-528465642) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.settings!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .wallPaper(let _data): + return ("wallPaper", [("id", _data.id as Any), ("flags", _data.flags as Any), ("accessHash", _data.accessHash as Any), ("slug", _data.slug as Any), ("document", _data.document as Any), ("settings", _data.settings as Any)]) + case .wallPaperNoFile(let _data): + return ("wallPaperNoFile", [("id", _data.id as Any), ("flags", _data.flags as Any), ("settings", _data.settings as Any)]) + } + } + public static func parse_wallPaper(_ reader: BufferReader) -> WallPaper? { var _1: Int64? _1 = reader.readInt64() @@ -1254,9 +1892,11 @@ public extension Api { _5 = Api.parse(reader, signature: signature) as? Api.Document } var _6: Api.WallPaperSettings? - if Int(_2!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings - } } + if Int(_2!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1264,7 +1904,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_2!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.WallPaper.wallPaper(id: _1!, flags: _2!, accessHash: _3!, slug: _4!, document: _5!, settings: _6) + return Api.WallPaper.wallPaper(Cons_wallPaper(id: _1!, flags: _2!, accessHash: _3!, slug: _4!, document: _5!, settings: _6)) } else { return nil @@ -1276,68 +1916,117 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: Api.WallPaperSettings? - if Int(_2!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings - } } + if Int(_2!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_2!) & Int(1 << 2) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.WallPaper.wallPaperNoFile(id: _1!, flags: _2!, settings: _3) + return Api.WallPaper.wallPaperNoFile(Cons_wallPaperNoFile(id: _1!, flags: _2!, settings: _3)) } else { return nil } } - } } public extension Api { enum WallPaperSettings: TypeConstructorDescription { - case wallPaperSettings(flags: Int32, backgroundColor: Int32?, secondBackgroundColor: Int32?, thirdBackgroundColor: Int32?, fourthBackgroundColor: Int32?, intensity: Int32?, rotation: Int32?, emoticon: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .wallPaperSettings(let flags, let backgroundColor, let secondBackgroundColor, let thirdBackgroundColor, let fourthBackgroundColor, let intensity, let rotation, let emoticon): - if boxed { - buffer.appendInt32(925826256) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(backgroundColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(secondBackgroundColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(thirdBackgroundColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(fourthBackgroundColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(intensity!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(rotation!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeString(emoticon!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .wallPaperSettings(let flags, let backgroundColor, let secondBackgroundColor, let thirdBackgroundColor, let fourthBackgroundColor, let intensity, let rotation, let emoticon): - return ("wallPaperSettings", [("flags", flags as Any), ("backgroundColor", backgroundColor as Any), ("secondBackgroundColor", secondBackgroundColor as Any), ("thirdBackgroundColor", thirdBackgroundColor as Any), ("fourthBackgroundColor", fourthBackgroundColor as Any), ("intensity", intensity as Any), ("rotation", rotation as Any), ("emoticon", emoticon as Any)]) - } - } - + public class Cons_wallPaperSettings { + public var flags: Int32 + public var backgroundColor: Int32? + public var secondBackgroundColor: Int32? + public var thirdBackgroundColor: Int32? + public var fourthBackgroundColor: Int32? + public var intensity: Int32? + public var rotation: Int32? + public var emoticon: String? + public init(flags: Int32, backgroundColor: Int32?, secondBackgroundColor: Int32?, thirdBackgroundColor: Int32?, fourthBackgroundColor: Int32?, intensity: Int32?, rotation: Int32?, emoticon: String?) { + self.flags = flags + self.backgroundColor = backgroundColor + self.secondBackgroundColor = secondBackgroundColor + self.thirdBackgroundColor = thirdBackgroundColor + self.fourthBackgroundColor = fourthBackgroundColor + self.intensity = intensity + self.rotation = rotation + self.emoticon = emoticon + } + } + case wallPaperSettings(Cons_wallPaperSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .wallPaperSettings(let _data): + if boxed { + buffer.appendInt32(925826256) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.backgroundColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.secondBackgroundColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.thirdBackgroundColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.fourthBackgroundColor!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.intensity!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.rotation!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .wallPaperSettings(let _data): + return ("wallPaperSettings", [("flags", _data.flags as Any), ("backgroundColor", _data.backgroundColor as Any), ("secondBackgroundColor", _data.secondBackgroundColor as Any), ("thirdBackgroundColor", _data.thirdBackgroundColor as Any), ("fourthBackgroundColor", _data.fourthBackgroundColor as Any), ("intensity", _data.intensity as Any), ("rotation", _data.rotation as Any), ("emoticon", _data.emoticon as Any)]) + } + } + public static func parse_wallPaperSettings(_ reader: BufferReader) -> WallPaperSettings? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } var _7: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _7 = reader.readInt32() + } var _8: String? - if Int(_1!) & Int(1 << 7) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 7) != 0 { + _8 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 4) == 0) || _3 != nil @@ -1347,45 +2036,66 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 7) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.WallPaperSettings.wallPaperSettings(flags: _1!, backgroundColor: _2, secondBackgroundColor: _3, thirdBackgroundColor: _4, fourthBackgroundColor: _5, intensity: _6, rotation: _7, emoticon: _8) + return Api.WallPaperSettings.wallPaperSettings(Cons_wallPaperSettings(flags: _1!, backgroundColor: _2, secondBackgroundColor: _3, thirdBackgroundColor: _4, fourthBackgroundColor: _5, intensity: _6, rotation: _7, emoticon: _8)) } else { return nil } } - } } public extension Api { enum WebAuthorization: TypeConstructorDescription { - case webAuthorization(hash: Int64, botId: Int64, domain: String, browser: String, platform: String, dateCreated: Int32, dateActive: Int32, ip: String, region: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webAuthorization(let hash, let botId, let domain, let browser, let platform, let dateCreated, let dateActive, let ip, let region): - if boxed { - buffer.appendInt32(-1493633966) - } - serializeInt64(hash, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(domain, buffer: buffer, boxed: false) - serializeString(browser, buffer: buffer, boxed: false) - serializeString(platform, buffer: buffer, boxed: false) - serializeInt32(dateCreated, buffer: buffer, boxed: false) - serializeInt32(dateActive, buffer: buffer, boxed: false) - serializeString(ip, buffer: buffer, boxed: false) - serializeString(region, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webAuthorization(let hash, let botId, let domain, let browser, let platform, let dateCreated, let dateActive, let ip, let region): - return ("webAuthorization", [("hash", hash as Any), ("botId", botId as Any), ("domain", domain as Any), ("browser", browser as Any), ("platform", platform as Any), ("dateCreated", dateCreated as Any), ("dateActive", dateActive as Any), ("ip", ip as Any), ("region", region as Any)]) - } - } - + public class Cons_webAuthorization { + public var hash: Int64 + public var botId: Int64 + public var domain: String + public var browser: String + public var platform: String + public var dateCreated: Int32 + public var dateActive: Int32 + public var ip: String + public var region: String + public init(hash: Int64, botId: Int64, domain: String, browser: String, platform: String, dateCreated: Int32, dateActive: Int32, ip: String, region: String) { + self.hash = hash + self.botId = botId + self.domain = domain + self.browser = browser + self.platform = platform + self.dateCreated = dateCreated + self.dateActive = dateActive + self.ip = ip + self.region = region + } + } + case webAuthorization(Cons_webAuthorization) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webAuthorization(let _data): + if boxed { + buffer.appendInt32(-1493633966) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.domain, buffer: buffer, boxed: false) + serializeString(_data.browser, buffer: buffer, boxed: false) + serializeString(_data.platform, buffer: buffer, boxed: false) + serializeInt32(_data.dateCreated, buffer: buffer, boxed: false) + serializeInt32(_data.dateActive, buffer: buffer, boxed: false) + serializeString(_data.ip, buffer: buffer, boxed: false) + serializeString(_data.region, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webAuthorization(let _data): + return ("webAuthorization", [("hash", _data.hash as Any), ("botId", _data.botId as Any), ("domain", _data.domain as Any), ("browser", _data.browser as Any), ("platform", _data.platform as Any), ("dateCreated", _data.dateCreated as Any), ("dateActive", _data.dateActive as Any), ("ip", _data.ip as Any), ("region", _data.region as Any)]) + } + } + public static func parse_webAuthorization(_ reader: BufferReader) -> WebAuthorization? { var _1: Int64? _1 = reader.readInt64() @@ -1415,61 +2125,86 @@ public extension Api { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.WebAuthorization.webAuthorization(hash: _1!, botId: _2!, domain: _3!, browser: _4!, platform: _5!, dateCreated: _6!, dateActive: _7!, ip: _8!, region: _9!) + return Api.WebAuthorization.webAuthorization(Cons_webAuthorization(hash: _1!, botId: _2!, domain: _3!, browser: _4!, platform: _5!, dateCreated: _6!, dateActive: _7!, ip: _8!, region: _9!)) } else { return nil } } - } } public extension Api { enum WebDocument: TypeConstructorDescription { - case webDocument(url: String, accessHash: Int64, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) - case webDocumentNoProxy(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webDocument(let url, let accessHash, let size, let mimeType, let attributes): - if boxed { - buffer.appendInt32(475467473) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { - item.serialize(buffer, true) - } - break - case .webDocumentNoProxy(let url, let size, let mimeType, let attributes): - if boxed { - buffer.appendInt32(-104284986) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(size, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webDocument(let url, let accessHash, let size, let mimeType, let attributes): - return ("webDocument", [("url", url as Any), ("accessHash", accessHash as Any), ("size", size as Any), ("mimeType", mimeType as Any), ("attributes", attributes as Any)]) - case .webDocumentNoProxy(let url, let size, let mimeType, let attributes): - return ("webDocumentNoProxy", [("url", url as Any), ("size", size as Any), ("mimeType", mimeType as Any), ("attributes", attributes as Any)]) - } - } - + public class Cons_webDocument { + public var url: String + public var accessHash: Int64 + public var size: Int32 + public var mimeType: String + public var attributes: [Api.DocumentAttribute] + public init(url: String, accessHash: Int64, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) { + self.url = url + self.accessHash = accessHash + self.size = size + self.mimeType = mimeType + self.attributes = attributes + } + } + public class Cons_webDocumentNoProxy { + public var url: String + public var size: Int32 + public var mimeType: String + public var attributes: [Api.DocumentAttribute] + public init(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute]) { + self.url = url + self.size = size + self.mimeType = mimeType + self.attributes = attributes + } + } + case webDocument(Cons_webDocument) + case webDocumentNoProxy(Cons_webDocumentNoProxy) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webDocument(let _data): + if boxed { + buffer.appendInt32(475467473) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.size, buffer: buffer, boxed: false) + serializeString(_data.mimeType, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + break + case .webDocumentNoProxy(let _data): + if boxed { + buffer.appendInt32(-104284986) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.size, buffer: buffer, boxed: false) + serializeString(_data.mimeType, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webDocument(let _data): + return ("webDocument", [("url", _data.url as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + case .webDocumentNoProxy(let _data): + return ("webDocumentNoProxy", [("url", _data.url as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + } + } + public static func parse_webDocument(_ reader: BufferReader) -> WebDocument? { var _1: String? _1 = parseString(reader) @@ -1489,7 +2224,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.WebDocument.webDocument(url: _1!, accessHash: _2!, size: _3!, mimeType: _4!, attributes: _5!) + return Api.WebDocument.webDocument(Cons_webDocument(url: _1!, accessHash: _2!, size: _3!, mimeType: _4!, attributes: _5!)) } else { return nil @@ -1511,92 +2246,197 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.WebDocument.webDocumentNoProxy(url: _1!, size: _2!, mimeType: _3!, attributes: _4!) + return Api.WebDocument.webDocumentNoProxy(Cons_webDocumentNoProxy(url: _1!, size: _2!, mimeType: _3!, attributes: _4!)) } else { return nil } } - } } public extension Api { enum WebPage: TypeConstructorDescription { - case webPage(flags: Int32, id: Int64, url: String, displayUrl: String, hash: Int32, type: String?, siteName: String?, title: String?, description: String?, photo: Api.Photo?, embedUrl: String?, embedType: String?, embedWidth: Int32?, embedHeight: Int32?, duration: Int32?, author: String?, document: Api.Document?, cachedPage: Api.Page?, attributes: [Api.WebPageAttribute]?) - case webPageEmpty(flags: Int32, id: Int64, url: String?) - case webPageNotModified(flags: Int32, cachedPageViews: Int32?) - case webPagePending(flags: Int32, id: Int64, url: String?, date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webPage(let flags, let id, let url, let displayUrl, let hash, let type, let siteName, let title, let description, let photo, let embedUrl, let embedType, let embedWidth, let embedHeight, let duration, let author, let document, let cachedPage, let attributes): - if boxed { - buffer.appendInt32(-392411726) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - serializeString(displayUrl, buffer: buffer, boxed: false) - serializeInt32(hash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(type!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(siteName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {photo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(embedUrl!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(embedType!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(embedWidth!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(embedHeight!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(duration!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeString(author!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 10) != 0 {cachedPage!.serialize(buffer, true)} - if Int(flags) & Int(1 << 12) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes!.count)) - for item in attributes! { + public class Cons_webPage { + public var flags: Int32 + public var id: Int64 + public var url: String + public var displayUrl: String + public var hash: Int32 + public var type: String? + public var siteName: String? + public var title: String? + public var description: String? + public var photo: Api.Photo? + public var embedUrl: String? + public var embedType: String? + public var embedWidth: Int32? + public var embedHeight: Int32? + public var duration: Int32? + public var author: String? + public var document: Api.Document? + public var cachedPage: Api.Page? + public var attributes: [Api.WebPageAttribute]? + public init(flags: Int32, id: Int64, url: String, displayUrl: String, hash: Int32, type: String?, siteName: String?, title: String?, description: String?, photo: Api.Photo?, embedUrl: String?, embedType: String?, embedWidth: Int32?, embedHeight: Int32?, duration: Int32?, author: String?, document: Api.Document?, cachedPage: Api.Page?, attributes: [Api.WebPageAttribute]?) { + self.flags = flags + self.id = id + self.url = url + self.displayUrl = displayUrl + self.hash = hash + self.type = type + self.siteName = siteName + self.title = title + self.description = description + self.photo = photo + self.embedUrl = embedUrl + self.embedType = embedType + self.embedWidth = embedWidth + self.embedHeight = embedHeight + self.duration = duration + self.author = author + self.document = document + self.cachedPage = cachedPage + self.attributes = attributes + } + } + public class Cons_webPageEmpty { + public var flags: Int32 + public var id: Int64 + public var url: String? + public init(flags: Int32, id: Int64, url: String?) { + self.flags = flags + self.id = id + self.url = url + } + } + public class Cons_webPageNotModified { + public var flags: Int32 + public var cachedPageViews: Int32? + public init(flags: Int32, cachedPageViews: Int32?) { + self.flags = flags + self.cachedPageViews = cachedPageViews + } + } + public class Cons_webPagePending { + public var flags: Int32 + public var id: Int64 + public var url: String? + public var date: Int32 + public init(flags: Int32, id: Int64, url: String?, date: Int32) { + self.flags = flags + self.id = id + self.url = url + self.date = date + } + } + case webPage(Cons_webPage) + case webPageEmpty(Cons_webPageEmpty) + case webPageNotModified(Cons_webPageNotModified) + case webPagePending(Cons_webPagePending) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webPage(let _data): + if boxed { + buffer.appendInt32(-392411726) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.displayUrl, buffer: buffer, boxed: false) + serializeInt32(_data.hash, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.type!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.siteName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.photo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.embedUrl!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.embedType!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.embedWidth!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.embedHeight!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.duration!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeString(_data.author!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.cachedPage!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes!.count)) + for item in _data.attributes! { item.serialize(buffer, true) - }} - break - case .webPageEmpty(let flags, let id, let url): - if boxed { - buffer.appendInt32(555358088) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - break - case .webPageNotModified(let flags, let cachedPageViews): - if boxed { - buffer.appendInt32(1930545681) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(cachedPageViews!, buffer: buffer, boxed: false)} - break - case .webPagePending(let flags, let id, let url, let date): - if boxed { - buffer.appendInt32(-1328464313) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webPage(let flags, let id, let url, let displayUrl, let hash, let type, let siteName, let title, let description, let photo, let embedUrl, let embedType, let embedWidth, let embedHeight, let duration, let author, let document, let cachedPage, let attributes): - return ("webPage", [("flags", flags as Any), ("id", id as Any), ("url", url as Any), ("displayUrl", displayUrl as Any), ("hash", hash as Any), ("type", type as Any), ("siteName", siteName as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("embedUrl", embedUrl as Any), ("embedType", embedType as Any), ("embedWidth", embedWidth as Any), ("embedHeight", embedHeight as Any), ("duration", duration as Any), ("author", author as Any), ("document", document as Any), ("cachedPage", cachedPage as Any), ("attributes", attributes as Any)]) - case .webPageEmpty(let flags, let id, let url): - return ("webPageEmpty", [("flags", flags as Any), ("id", id as Any), ("url", url as Any)]) - case .webPageNotModified(let flags, let cachedPageViews): - return ("webPageNotModified", [("flags", flags as Any), ("cachedPageViews", cachedPageViews as Any)]) - case .webPagePending(let flags, let id, let url, let date): - return ("webPagePending", [("flags", flags as Any), ("id", id as Any), ("url", url as Any), ("date", date as Any)]) - } - } - + } + break + case .webPageEmpty(let _data): + if boxed { + buffer.appendInt32(555358088) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + break + case .webPageNotModified(let _data): + if boxed { + buffer.appendInt32(1930545681) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.cachedPageViews!, buffer: buffer, boxed: false) + } + break + case .webPagePending(let _data): + if boxed { + buffer.appendInt32(-1328464313) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webPage(let _data): + return ("webPage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any), ("displayUrl", _data.displayUrl as Any), ("hash", _data.hash as Any), ("type", _data.type as Any), ("siteName", _data.siteName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("embedUrl", _data.embedUrl as Any), ("embedType", _data.embedType as Any), ("embedWidth", _data.embedWidth as Any), ("embedHeight", _data.embedHeight as Any), ("duration", _data.duration as Any), ("author", _data.author as Any), ("document", _data.document as Any), ("cachedPage", _data.cachedPage as Any), ("attributes", _data.attributes as Any)]) + case .webPageEmpty(let _data): + return ("webPageEmpty", [("flags", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any)]) + case .webPageNotModified(let _data): + return ("webPageNotModified", [("flags", _data.flags as Any), ("cachedPageViews", _data.cachedPageViews as Any)]) + case .webPagePending(let _data): + return ("webPagePending", [("flags", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any), ("date", _data.date as Any)]) + } + } + public static func parse_webPage(_ reader: BufferReader) -> WebPage? { var _1: Int32? _1 = reader.readInt32() @@ -1609,41 +2449,69 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } var _8: String? - if Int(_1!) & Int(1 << 2) != 0 {_8 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _8 = parseString(reader) + } var _9: String? - if Int(_1!) & Int(1 << 3) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _9 = parseString(reader) + } var _10: Api.Photo? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _11: String? - if Int(_1!) & Int(1 << 5) != 0 {_11 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _11 = parseString(reader) + } var _12: String? - if Int(_1!) & Int(1 << 5) != 0 {_12 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _12 = parseString(reader) + } var _13: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _13 = reader.readInt32() + } var _14: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_14 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _14 = reader.readInt32() + } var _15: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_15 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _15 = reader.readInt32() + } var _16: String? - if Int(_1!) & Int(1 << 8) != 0 {_16 = parseString(reader) } + if Int(_1!) & Int(1 << 8) != 0 { + _16 = parseString(reader) + } var _17: Api.Document? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _18: Api.Page? - if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.Page - } } + if Int(_1!) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _18 = Api.parse(reader, signature: signature) as? Api.Page + } + } var _19: [Api.WebPageAttribute]? - if Int(_1!) & Int(1 << 12) != 0 {if let _ = reader.readInt32() { - _19 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebPageAttribute.self) - } } + if Int(_1!) & Int(1 << 12) != 0 { + if let _ = reader.readInt32() { + _19 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebPageAttribute.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1664,7 +2532,7 @@ public extension Api { let _c18 = (Int(_1!) & Int(1 << 10) == 0) || _18 != nil let _c19 = (Int(_1!) & Int(1 << 12) == 0) || _19 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 { - return Api.WebPage.webPage(flags: _1!, id: _2!, url: _3!, displayUrl: _4!, hash: _5!, type: _6, siteName: _7, title: _8, description: _9, photo: _10, embedUrl: _11, embedType: _12, embedWidth: _13, embedHeight: _14, duration: _15, author: _16, document: _17, cachedPage: _18, attributes: _19) + return Api.WebPage.webPage(Cons_webPage(flags: _1!, id: _2!, url: _3!, displayUrl: _4!, hash: _5!, type: _6, siteName: _7, title: _8, description: _9, photo: _10, embedUrl: _11, embedType: _12, embedWidth: _13, embedHeight: _14, duration: _15, author: _16, document: _17, cachedPage: _18, attributes: _19)) } else { return nil @@ -1676,12 +2544,14 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.WebPage.webPageEmpty(flags: _1!, id: _2!, url: _3) + return Api.WebPage.webPageEmpty(Cons_webPageEmpty(flags: _1!, id: _2!, url: _3)) } else { return nil @@ -1691,11 +2561,13 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.WebPage.webPageNotModified(flags: _1!, cachedPageViews: _2) + return Api.WebPage.webPageNotModified(Cons_webPageNotModified(flags: _1!, cachedPageViews: _2)) } else { return nil @@ -1707,7 +2579,9 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: Int32? _4 = reader.readInt32() let _c1 = _1 != nil @@ -1715,12 +2589,11 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.WebPage.webPagePending(flags: _1!, id: _2!, url: _3, date: _4!) + return Api.WebPage.webPagePending(Cons_webPagePending(flags: _1!, id: _2!, url: _3, date: _4!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api3.swift b/submodules/TelegramApi/Sources/Api3.swift index 49988fc94e..00a1f59b66 100644 --- a/submodules/TelegramApi/Sources/Api3.swift +++ b/submodules/TelegramApi/Sources/Api3.swift @@ -1,27 +1,37 @@ public extension Api { enum BusinessGreetingMessage: TypeConstructorDescription { - case businessGreetingMessage(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessGreetingMessage(let shortcutId, let recipients, let noActivityDays): - if boxed { - buffer.appendInt32(-451302485) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - recipients.serialize(buffer, true) - serializeInt32(noActivityDays, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessGreetingMessage(let shortcutId, let recipients, let noActivityDays): - return ("businessGreetingMessage", [("shortcutId", shortcutId as Any), ("recipients", recipients as Any), ("noActivityDays", noActivityDays as Any)]) - } - } - + public class Cons_businessGreetingMessage { + public var shortcutId: Int32 + public var recipients: Api.BusinessRecipients + public var noActivityDays: Int32 + public init(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32) { + self.shortcutId = shortcutId + self.recipients = recipients + self.noActivityDays = noActivityDays + } + } + case businessGreetingMessage(Cons_businessGreetingMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessGreetingMessage(let _data): + if boxed { + buffer.appendInt32(-451302485) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + _data.recipients.serialize(buffer, true) + serializeInt32(_data.noActivityDays, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessGreetingMessage(let _data): + return ("businessGreetingMessage", [("shortcutId", _data.shortcutId as Any), ("recipients", _data.recipients as Any), ("noActivityDays", _data.noActivityDays as Any)]) + } + } + public static func parse_businessGreetingMessage(_ reader: BufferReader) -> BusinessGreetingMessage? { var _1: Int32? _1 = reader.readInt32() @@ -35,40 +45,53 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.BusinessGreetingMessage.businessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!) + return Api.BusinessGreetingMessage.businessGreetingMessage(Cons_businessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!)) } else { return nil } } - } } public extension Api { enum BusinessIntro: TypeConstructorDescription { - case businessIntro(flags: Int32, title: String, description: String, sticker: Api.Document?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessIntro(let flags, let title, let description, let sticker): - if boxed { - buffer.appendInt32(1510606445) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {sticker!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessIntro(let flags, let title, let description, let sticker): - return ("businessIntro", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("sticker", sticker as Any)]) - } - } - + public class Cons_businessIntro { + public var flags: Int32 + public var title: String + public var description: String + public var sticker: Api.Document? + public init(flags: Int32, title: String, description: String, sticker: Api.Document?) { + self.flags = flags + self.title = title + self.description = description + self.sticker = sticker + } + } + case businessIntro(Cons_businessIntro) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessIntro(let _data): + if boxed { + buffer.appendInt32(1510606445) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.sticker!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessIntro(let _data): + return ("businessIntro", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sticker", _data.sticker as Any)]) + } + } + public static func parse_businessIntro(_ reader: BufferReader) -> BusinessIntro? { var _1: Int32? _1 = reader.readInt32() @@ -77,138 +100,171 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.BusinessIntro.businessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4) + return Api.BusinessIntro.businessIntro(Cons_businessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4)) } else { return nil } } - } } public extension Api { enum BusinessLocation: TypeConstructorDescription { - case businessLocation(flags: Int32, geoPoint: Api.GeoPoint?, address: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessLocation(let flags, let geoPoint, let address): - if boxed { - buffer.appendInt32(-1403249929) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {geoPoint!.serialize(buffer, true)} - serializeString(address, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessLocation(let flags, let geoPoint, let address): - return ("businessLocation", [("flags", flags as Any), ("geoPoint", geoPoint as Any), ("address", address as Any)]) - } - } - + public class Cons_businessLocation { + public var flags: Int32 + public var geoPoint: Api.GeoPoint? + public var address: String + public init(flags: Int32, geoPoint: Api.GeoPoint?, address: String) { + self.flags = flags + self.geoPoint = geoPoint + self.address = address + } + } + case businessLocation(Cons_businessLocation) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessLocation(let _data): + if boxed { + buffer.appendInt32(-1403249929) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.geoPoint!.serialize(buffer, true) + } + serializeString(_data.address, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessLocation(let _data): + return ("businessLocation", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("address", _data.address as Any)]) + } + } + public static func parse_businessLocation(_ reader: BufferReader) -> BusinessLocation? { var _1: Int32? _1 = reader.readInt32() var _2: Api.GeoPoint? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + } var _3: String? _3 = parseString(reader) let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.BusinessLocation.businessLocation(flags: _1!, geoPoint: _2, address: _3!) + return Api.BusinessLocation.businessLocation(Cons_businessLocation(flags: _1!, geoPoint: _2, address: _3!)) } else { return nil } } - } } public extension Api { enum BusinessRecipients: TypeConstructorDescription { - case businessRecipients(flags: Int32, users: [Int64]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessRecipients(let flags, let users): - if boxed { - buffer.appendInt32(554733559) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users!.count)) - for item in users! { + public class Cons_businessRecipients { + public var flags: Int32 + public var users: [Int64]? + public init(flags: Int32, users: [Int64]?) { + self.flags = flags + self.users = users + } + } + case businessRecipients(Cons_businessRecipients) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessRecipients(let _data): + if boxed { + buffer.appendInt32(554733559) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users!.count)) + for item in _data.users! { serializeInt64(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessRecipients(let flags, let users): - return ("businessRecipients", [("flags", flags as Any), ("users", users as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessRecipients(let _data): + return ("businessRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any)]) + } + } + public static func parse_businessRecipients(_ reader: BufferReader) -> BusinessRecipients? { var _1: Int32? _1 = reader.readInt32() var _2: [Int64]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil if _c1 && _c2 { - return Api.BusinessRecipients.businessRecipients(flags: _1!, users: _2) + return Api.BusinessRecipients.businessRecipients(Cons_businessRecipients(flags: _1!, users: _2)) } else { return nil } } - } } public extension Api { enum BusinessWeeklyOpen: TypeConstructorDescription { - case businessWeeklyOpen(startMinute: Int32, endMinute: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessWeeklyOpen(let startMinute, let endMinute): - if boxed { - buffer.appendInt32(302717625) - } - serializeInt32(startMinute, buffer: buffer, boxed: false) - serializeInt32(endMinute, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessWeeklyOpen(let startMinute, let endMinute): - return ("businessWeeklyOpen", [("startMinute", startMinute as Any), ("endMinute", endMinute as Any)]) - } - } - + public class Cons_businessWeeklyOpen { + public var startMinute: Int32 + public var endMinute: Int32 + public init(startMinute: Int32, endMinute: Int32) { + self.startMinute = startMinute + self.endMinute = endMinute + } + } + case businessWeeklyOpen(Cons_businessWeeklyOpen) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessWeeklyOpen(let _data): + if boxed { + buffer.appendInt32(302717625) + } + serializeInt32(_data.startMinute, buffer: buffer, boxed: false) + serializeInt32(_data.endMinute, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessWeeklyOpen(let _data): + return ("businessWeeklyOpen", [("startMinute", _data.startMinute as Any), ("endMinute", _data.endMinute as Any)]) + } + } + public static func parse_businessWeeklyOpen(_ reader: BufferReader) -> BusinessWeeklyOpen? { var _1: Int32? _1 = reader.readInt32() @@ -217,43 +273,52 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.BusinessWeeklyOpen.businessWeeklyOpen(startMinute: _1!, endMinute: _2!) + return Api.BusinessWeeklyOpen.businessWeeklyOpen(Cons_businessWeeklyOpen(startMinute: _1!, endMinute: _2!)) } else { return nil } } - } } public extension Api { enum BusinessWorkHours: TypeConstructorDescription { - case businessWorkHours(flags: Int32, timezoneId: String, weeklyOpen: [Api.BusinessWeeklyOpen]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessWorkHours(let flags, let timezoneId, let weeklyOpen): - if boxed { - buffer.appendInt32(-1936543592) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(timezoneId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(weeklyOpen.count)) - for item in weeklyOpen { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessWorkHours(let flags, let timezoneId, let weeklyOpen): - return ("businessWorkHours", [("flags", flags as Any), ("timezoneId", timezoneId as Any), ("weeklyOpen", weeklyOpen as Any)]) - } - } - + public class Cons_businessWorkHours { + public var flags: Int32 + public var timezoneId: String + public var weeklyOpen: [Api.BusinessWeeklyOpen] + public init(flags: Int32, timezoneId: String, weeklyOpen: [Api.BusinessWeeklyOpen]) { + self.flags = flags + self.timezoneId = timezoneId + self.weeklyOpen = weeklyOpen + } + } + case businessWorkHours(Cons_businessWorkHours) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessWorkHours(let _data): + if boxed { + buffer.appendInt32(-1936543592) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.timezoneId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.weeklyOpen.count)) + for item in _data.weeklyOpen { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessWorkHours(let _data): + return ("businessWorkHours", [("flags", _data.flags as Any), ("timezoneId", _data.timezoneId as Any), ("weeklyOpen", _data.weeklyOpen as Any)]) + } + } + public static func parse_businessWorkHours(_ reader: BufferReader) -> BusinessWorkHours? { var _1: Int32? _1 = reader.readInt32() @@ -267,41 +332,46 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.BusinessWorkHours.businessWorkHours(flags: _1!, timezoneId: _2!, weeklyOpen: _3!) + return Api.BusinessWorkHours.businessWorkHours(Cons_businessWorkHours(flags: _1!, timezoneId: _2!, weeklyOpen: _3!)) } else { return nil } } - } } public extension Api { enum CdnConfig: TypeConstructorDescription { - case cdnConfig(publicKeys: [Api.CdnPublicKey]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .cdnConfig(let publicKeys): - if boxed { - buffer.appendInt32(1462101002) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(publicKeys.count)) - for item in publicKeys { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .cdnConfig(let publicKeys): - return ("cdnConfig", [("publicKeys", publicKeys as Any)]) - } - } - + public class Cons_cdnConfig { + public var publicKeys: [Api.CdnPublicKey] + public init(publicKeys: [Api.CdnPublicKey]) { + self.publicKeys = publicKeys + } + } + case cdnConfig(Cons_cdnConfig) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .cdnConfig(let _data): + if boxed { + buffer.appendInt32(1462101002) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.publicKeys.count)) + for item in _data.publicKeys { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .cdnConfig(let _data): + return ("cdnConfig", [("publicKeys", _data.publicKeys as Any)]) + } + } + public static func parse_cdnConfig(_ reader: BufferReader) -> CdnConfig? { var _1: [Api.CdnPublicKey]? if let _ = reader.readInt32() { @@ -309,38 +379,45 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.CdnConfig.cdnConfig(publicKeys: _1!) + return Api.CdnConfig.cdnConfig(Cons_cdnConfig(publicKeys: _1!)) } else { return nil } } - } } public extension Api { enum CdnPublicKey: TypeConstructorDescription { - case cdnPublicKey(dcId: Int32, publicKey: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .cdnPublicKey(let dcId, let publicKey): - if boxed { - buffer.appendInt32(-914167110) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeString(publicKey, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .cdnPublicKey(let dcId, let publicKey): - return ("cdnPublicKey", [("dcId", dcId as Any), ("publicKey", publicKey as Any)]) - } - } - + public class Cons_cdnPublicKey { + public var dcId: Int32 + public var publicKey: String + public init(dcId: Int32, publicKey: String) { + self.dcId = dcId + self.publicKey = publicKey + } + } + case cdnPublicKey(Cons_cdnPublicKey) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .cdnPublicKey(let _data): + if boxed { + buffer.appendInt32(-914167110) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeString(_data.publicKey, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .cdnPublicKey(let _data): + return ("cdnPublicKey", [("dcId", _data.dcId as Any), ("publicKey", _data.publicKey as Any)]) + } + } + public static func parse_cdnPublicKey(_ reader: BufferReader) -> CdnPublicKey? { var _1: Int32? _1 = reader.readInt32() @@ -349,40 +426,51 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.CdnPublicKey.cdnPublicKey(dcId: _1!, publicKey: _2!) + return Api.CdnPublicKey.cdnPublicKey(Cons_cdnPublicKey(dcId: _1!, publicKey: _2!)) } else { return nil } } - } } public extension Api { indirect enum ChannelAdminLogEvent: TypeConstructorDescription { - case channelAdminLogEvent(id: Int64, date: Int32, userId: Int64, action: Api.ChannelAdminLogEventAction) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelAdminLogEvent(let id, let date, let userId, let action): - if boxed { - buffer.appendInt32(531458253) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - action.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelAdminLogEvent(let id, let date, let userId, let action): - return ("channelAdminLogEvent", [("id", id as Any), ("date", date as Any), ("userId", userId as Any), ("action", action as Any)]) - } - } - + public class Cons_channelAdminLogEvent { + public var id: Int64 + public var date: Int32 + public var userId: Int64 + public var action: Api.ChannelAdminLogEventAction + public init(id: Int64, date: Int32, userId: Int64, action: Api.ChannelAdminLogEventAction) { + self.id = id + self.date = date + self.userId = userId + self.action = action + } + } + case channelAdminLogEvent(Cons_channelAdminLogEvent) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelAdminLogEvent(let _data): + if boxed { + buffer.appendInt32(531458253) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.action.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelAdminLogEvent(let _data): + return ("channelAdminLogEvent", [("id", _data.id as Any), ("date", _data.date as Any), ("userId", _data.userId as Any), ("action", _data.action as Any)]) + } + } + public static func parse_channelAdminLogEvent(_ reader: BufferReader) -> ChannelAdminLogEvent? { var _1: Int64? _1 = reader.readInt64() @@ -399,522 +487,871 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ChannelAdminLogEvent.channelAdminLogEvent(id: _1!, date: _2!, userId: _3!, action: _4!) + return Api.ChannelAdminLogEvent.channelAdminLogEvent(Cons_channelAdminLogEvent(id: _1!, date: _2!, userId: _3!, action: _4!)) } else { return nil } } - } } public extension Api { indirect enum ChannelAdminLogEventAction: TypeConstructorDescription { - case channelAdminLogEventActionChangeAbout(prevValue: String, newValue: String) - case channelAdminLogEventActionChangeAvailableReactions(prevValue: Api.ChatReactions, newValue: Api.ChatReactions) - case channelAdminLogEventActionChangeEmojiStatus(prevValue: Api.EmojiStatus, newValue: Api.EmojiStatus) - case channelAdminLogEventActionChangeEmojiStickerSet(prevStickerset: Api.InputStickerSet, newStickerset: Api.InputStickerSet) - case channelAdminLogEventActionChangeHistoryTTL(prevValue: Int32, newValue: Int32) - case channelAdminLogEventActionChangeLinkedChat(prevValue: Int64, newValue: Int64) - case channelAdminLogEventActionChangeLocation(prevValue: Api.ChannelLocation, newValue: Api.ChannelLocation) - case channelAdminLogEventActionChangePeerColor(prevValue: Api.PeerColor, newValue: Api.PeerColor) - case channelAdminLogEventActionChangePhoto(prevPhoto: Api.Photo, newPhoto: Api.Photo) - case channelAdminLogEventActionChangeProfilePeerColor(prevValue: Api.PeerColor, newValue: Api.PeerColor) - case channelAdminLogEventActionChangeStickerSet(prevStickerset: Api.InputStickerSet, newStickerset: Api.InputStickerSet) - case channelAdminLogEventActionChangeTitle(prevValue: String, newValue: String) - case channelAdminLogEventActionChangeUsername(prevValue: String, newValue: String) - case channelAdminLogEventActionChangeUsernames(prevValue: [String], newValue: [String]) - case channelAdminLogEventActionChangeWallpaper(prevValue: Api.WallPaper, newValue: Api.WallPaper) - case channelAdminLogEventActionCreateTopic(topic: Api.ForumTopic) - case channelAdminLogEventActionDefaultBannedRights(prevBannedRights: Api.ChatBannedRights, newBannedRights: Api.ChatBannedRights) - case channelAdminLogEventActionDeleteMessage(message: Api.Message) - case channelAdminLogEventActionDeleteTopic(topic: Api.ForumTopic) - case channelAdminLogEventActionDiscardGroupCall(call: Api.InputGroupCall) - case channelAdminLogEventActionEditMessage(prevMessage: Api.Message, newMessage: Api.Message) - case channelAdminLogEventActionEditTopic(prevTopic: Api.ForumTopic, newTopic: Api.ForumTopic) - case channelAdminLogEventActionExportedInviteDelete(invite: Api.ExportedChatInvite) - case channelAdminLogEventActionExportedInviteEdit(prevInvite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite) - case channelAdminLogEventActionExportedInviteRevoke(invite: Api.ExportedChatInvite) - case channelAdminLogEventActionParticipantInvite(participant: Api.ChannelParticipant) + public class Cons_channelAdminLogEventActionChangeAbout { + public var prevValue: String + public var newValue: String + public init(prevValue: String, newValue: String) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeAvailableReactions { + public var prevValue: Api.ChatReactions + public var newValue: Api.ChatReactions + public init(prevValue: Api.ChatReactions, newValue: Api.ChatReactions) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeEmojiStatus { + public var prevValue: Api.EmojiStatus + public var newValue: Api.EmojiStatus + public init(prevValue: Api.EmojiStatus, newValue: Api.EmojiStatus) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeEmojiStickerSet { + public var prevStickerset: Api.InputStickerSet + public var newStickerset: Api.InputStickerSet + public init(prevStickerset: Api.InputStickerSet, newStickerset: Api.InputStickerSet) { + self.prevStickerset = prevStickerset + self.newStickerset = newStickerset + } + } + public class Cons_channelAdminLogEventActionChangeHistoryTTL { + public var prevValue: Int32 + public var newValue: Int32 + public init(prevValue: Int32, newValue: Int32) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeLinkedChat { + public var prevValue: Int64 + public var newValue: Int64 + public init(prevValue: Int64, newValue: Int64) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeLocation { + public var prevValue: Api.ChannelLocation + public var newValue: Api.ChannelLocation + public init(prevValue: Api.ChannelLocation, newValue: Api.ChannelLocation) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangePeerColor { + public var prevValue: Api.PeerColor + public var newValue: Api.PeerColor + public init(prevValue: Api.PeerColor, newValue: Api.PeerColor) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangePhoto { + public var prevPhoto: Api.Photo + public var newPhoto: Api.Photo + public init(prevPhoto: Api.Photo, newPhoto: Api.Photo) { + self.prevPhoto = prevPhoto + self.newPhoto = newPhoto + } + } + public class Cons_channelAdminLogEventActionChangeProfilePeerColor { + public var prevValue: Api.PeerColor + public var newValue: Api.PeerColor + public init(prevValue: Api.PeerColor, newValue: Api.PeerColor) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeStickerSet { + public var prevStickerset: Api.InputStickerSet + public var newStickerset: Api.InputStickerSet + public init(prevStickerset: Api.InputStickerSet, newStickerset: Api.InputStickerSet) { + self.prevStickerset = prevStickerset + self.newStickerset = newStickerset + } + } + public class Cons_channelAdminLogEventActionChangeTitle { + public var prevValue: String + public var newValue: String + public init(prevValue: String, newValue: String) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeUsername { + public var prevValue: String + public var newValue: String + public init(prevValue: String, newValue: String) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeUsernames { + public var prevValue: [String] + public var newValue: [String] + public init(prevValue: [String], newValue: [String]) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionChangeWallpaper { + public var prevValue: Api.WallPaper + public var newValue: Api.WallPaper + public init(prevValue: Api.WallPaper, newValue: Api.WallPaper) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionCreateTopic { + public var topic: Api.ForumTopic + public init(topic: Api.ForumTopic) { + self.topic = topic + } + } + public class Cons_channelAdminLogEventActionDefaultBannedRights { + public var prevBannedRights: Api.ChatBannedRights + public var newBannedRights: Api.ChatBannedRights + public init(prevBannedRights: Api.ChatBannedRights, newBannedRights: Api.ChatBannedRights) { + self.prevBannedRights = prevBannedRights + self.newBannedRights = newBannedRights + } + } + public class Cons_channelAdminLogEventActionDeleteMessage { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_channelAdminLogEventActionDeleteTopic { + public var topic: Api.ForumTopic + public init(topic: Api.ForumTopic) { + self.topic = topic + } + } + public class Cons_channelAdminLogEventActionDiscardGroupCall { + public var call: Api.InputGroupCall + public init(call: Api.InputGroupCall) { + self.call = call + } + } + public class Cons_channelAdminLogEventActionEditMessage { + public var prevMessage: Api.Message + public var newMessage: Api.Message + public init(prevMessage: Api.Message, newMessage: Api.Message) { + self.prevMessage = prevMessage + self.newMessage = newMessage + } + } + public class Cons_channelAdminLogEventActionEditTopic { + public var prevTopic: Api.ForumTopic + public var newTopic: Api.ForumTopic + public init(prevTopic: Api.ForumTopic, newTopic: Api.ForumTopic) { + self.prevTopic = prevTopic + self.newTopic = newTopic + } + } + public class Cons_channelAdminLogEventActionExportedInviteDelete { + public var invite: Api.ExportedChatInvite + public init(invite: Api.ExportedChatInvite) { + self.invite = invite + } + } + public class Cons_channelAdminLogEventActionExportedInviteEdit { + public var prevInvite: Api.ExportedChatInvite + public var newInvite: Api.ExportedChatInvite + public init(prevInvite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite) { + self.prevInvite = prevInvite + self.newInvite = newInvite + } + } + public class Cons_channelAdminLogEventActionExportedInviteRevoke { + public var invite: Api.ExportedChatInvite + public init(invite: Api.ExportedChatInvite) { + self.invite = invite + } + } + public class Cons_channelAdminLogEventActionParticipantInvite { + public var participant: Api.ChannelParticipant + public init(participant: Api.ChannelParticipant) { + self.participant = participant + } + } + public class Cons_channelAdminLogEventActionParticipantJoinByInvite { + public var flags: Int32 + public var invite: Api.ExportedChatInvite + public init(flags: Int32, invite: Api.ExportedChatInvite) { + self.flags = flags + self.invite = invite + } + } + public class Cons_channelAdminLogEventActionParticipantJoinByRequest { + public var invite: Api.ExportedChatInvite + public var approvedBy: Int64 + public init(invite: Api.ExportedChatInvite, approvedBy: Int64) { + self.invite = invite + self.approvedBy = approvedBy + } + } + public class Cons_channelAdminLogEventActionParticipantMute { + public var participant: Api.GroupCallParticipant + public init(participant: Api.GroupCallParticipant) { + self.participant = participant + } + } + public class Cons_channelAdminLogEventActionParticipantSubExtend { + public var prevParticipant: Api.ChannelParticipant + public var newParticipant: Api.ChannelParticipant + public init(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) { + self.prevParticipant = prevParticipant + self.newParticipant = newParticipant + } + } + public class Cons_channelAdminLogEventActionParticipantToggleAdmin { + public var prevParticipant: Api.ChannelParticipant + public var newParticipant: Api.ChannelParticipant + public init(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) { + self.prevParticipant = prevParticipant + self.newParticipant = newParticipant + } + } + public class Cons_channelAdminLogEventActionParticipantToggleBan { + public var prevParticipant: Api.ChannelParticipant + public var newParticipant: Api.ChannelParticipant + public init(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) { + self.prevParticipant = prevParticipant + self.newParticipant = newParticipant + } + } + public class Cons_channelAdminLogEventActionParticipantUnmute { + public var participant: Api.GroupCallParticipant + public init(participant: Api.GroupCallParticipant) { + self.participant = participant + } + } + public class Cons_channelAdminLogEventActionParticipantVolume { + public var participant: Api.GroupCallParticipant + public init(participant: Api.GroupCallParticipant) { + self.participant = participant + } + } + public class Cons_channelAdminLogEventActionPinTopic { + public var flags: Int32 + public var prevTopic: Api.ForumTopic? + public var newTopic: Api.ForumTopic? + public init(flags: Int32, prevTopic: Api.ForumTopic?, newTopic: Api.ForumTopic?) { + self.flags = flags + self.prevTopic = prevTopic + self.newTopic = newTopic + } + } + public class Cons_channelAdminLogEventActionSendMessage { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_channelAdminLogEventActionStartGroupCall { + public var call: Api.InputGroupCall + public init(call: Api.InputGroupCall) { + self.call = call + } + } + public class Cons_channelAdminLogEventActionStopPoll { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + public class Cons_channelAdminLogEventActionToggleAntiSpam { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleAutotranslation { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleForum { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleGroupCallSetting { + public var joinMuted: Api.Bool + public init(joinMuted: Api.Bool) { + self.joinMuted = joinMuted + } + } + public class Cons_channelAdminLogEventActionToggleInvites { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleNoForwards { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionTogglePreHistoryHidden { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleSignatureProfiles { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleSignatures { + public var newValue: Api.Bool + public init(newValue: Api.Bool) { + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionToggleSlowMode { + public var prevValue: Int32 + public var newValue: Int32 + public init(prevValue: Int32, newValue: Int32) { + self.prevValue = prevValue + self.newValue = newValue + } + } + public class Cons_channelAdminLogEventActionUpdatePinned { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + } + case channelAdminLogEventActionChangeAbout(Cons_channelAdminLogEventActionChangeAbout) + case channelAdminLogEventActionChangeAvailableReactions(Cons_channelAdminLogEventActionChangeAvailableReactions) + case channelAdminLogEventActionChangeEmojiStatus(Cons_channelAdminLogEventActionChangeEmojiStatus) + case channelAdminLogEventActionChangeEmojiStickerSet(Cons_channelAdminLogEventActionChangeEmojiStickerSet) + case channelAdminLogEventActionChangeHistoryTTL(Cons_channelAdminLogEventActionChangeHistoryTTL) + case channelAdminLogEventActionChangeLinkedChat(Cons_channelAdminLogEventActionChangeLinkedChat) + case channelAdminLogEventActionChangeLocation(Cons_channelAdminLogEventActionChangeLocation) + case channelAdminLogEventActionChangePeerColor(Cons_channelAdminLogEventActionChangePeerColor) + case channelAdminLogEventActionChangePhoto(Cons_channelAdminLogEventActionChangePhoto) + case channelAdminLogEventActionChangeProfilePeerColor(Cons_channelAdminLogEventActionChangeProfilePeerColor) + case channelAdminLogEventActionChangeStickerSet(Cons_channelAdminLogEventActionChangeStickerSet) + case channelAdminLogEventActionChangeTitle(Cons_channelAdminLogEventActionChangeTitle) + case channelAdminLogEventActionChangeUsername(Cons_channelAdminLogEventActionChangeUsername) + case channelAdminLogEventActionChangeUsernames(Cons_channelAdminLogEventActionChangeUsernames) + case channelAdminLogEventActionChangeWallpaper(Cons_channelAdminLogEventActionChangeWallpaper) + case channelAdminLogEventActionCreateTopic(Cons_channelAdminLogEventActionCreateTopic) + case channelAdminLogEventActionDefaultBannedRights(Cons_channelAdminLogEventActionDefaultBannedRights) + case channelAdminLogEventActionDeleteMessage(Cons_channelAdminLogEventActionDeleteMessage) + case channelAdminLogEventActionDeleteTopic(Cons_channelAdminLogEventActionDeleteTopic) + case channelAdminLogEventActionDiscardGroupCall(Cons_channelAdminLogEventActionDiscardGroupCall) + case channelAdminLogEventActionEditMessage(Cons_channelAdminLogEventActionEditMessage) + case channelAdminLogEventActionEditTopic(Cons_channelAdminLogEventActionEditTopic) + case channelAdminLogEventActionExportedInviteDelete(Cons_channelAdminLogEventActionExportedInviteDelete) + case channelAdminLogEventActionExportedInviteEdit(Cons_channelAdminLogEventActionExportedInviteEdit) + case channelAdminLogEventActionExportedInviteRevoke(Cons_channelAdminLogEventActionExportedInviteRevoke) + case channelAdminLogEventActionParticipantInvite(Cons_channelAdminLogEventActionParticipantInvite) case channelAdminLogEventActionParticipantJoin - case channelAdminLogEventActionParticipantJoinByInvite(flags: Int32, invite: Api.ExportedChatInvite) - case channelAdminLogEventActionParticipantJoinByRequest(invite: Api.ExportedChatInvite, approvedBy: Int64) + case channelAdminLogEventActionParticipantJoinByInvite(Cons_channelAdminLogEventActionParticipantJoinByInvite) + case channelAdminLogEventActionParticipantJoinByRequest(Cons_channelAdminLogEventActionParticipantJoinByRequest) case channelAdminLogEventActionParticipantLeave - case channelAdminLogEventActionParticipantMute(participant: Api.GroupCallParticipant) - case channelAdminLogEventActionParticipantSubExtend(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) - case channelAdminLogEventActionParticipantToggleAdmin(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) - case channelAdminLogEventActionParticipantToggleBan(prevParticipant: Api.ChannelParticipant, newParticipant: Api.ChannelParticipant) - case channelAdminLogEventActionParticipantUnmute(participant: Api.GroupCallParticipant) - case channelAdminLogEventActionParticipantVolume(participant: Api.GroupCallParticipant) - case channelAdminLogEventActionPinTopic(flags: Int32, prevTopic: Api.ForumTopic?, newTopic: Api.ForumTopic?) - case channelAdminLogEventActionSendMessage(message: Api.Message) - case channelAdminLogEventActionStartGroupCall(call: Api.InputGroupCall) - case channelAdminLogEventActionStopPoll(message: Api.Message) - case channelAdminLogEventActionToggleAntiSpam(newValue: Api.Bool) - case channelAdminLogEventActionToggleAutotranslation(newValue: Api.Bool) - case channelAdminLogEventActionToggleForum(newValue: Api.Bool) - case channelAdminLogEventActionToggleGroupCallSetting(joinMuted: Api.Bool) - case channelAdminLogEventActionToggleInvites(newValue: Api.Bool) - case channelAdminLogEventActionToggleNoForwards(newValue: Api.Bool) - case channelAdminLogEventActionTogglePreHistoryHidden(newValue: Api.Bool) - case channelAdminLogEventActionToggleSignatureProfiles(newValue: Api.Bool) - case channelAdminLogEventActionToggleSignatures(newValue: Api.Bool) - case channelAdminLogEventActionToggleSlowMode(prevValue: Int32, newValue: Int32) - case channelAdminLogEventActionUpdatePinned(message: Api.Message) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelAdminLogEventActionChangeAbout(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1427671598) - } - serializeString(prevValue, buffer: buffer, boxed: false) - serializeString(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionChangeAvailableReactions(let prevValue, let newValue): - if boxed { - buffer.appendInt32(-1102180616) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeEmojiStatus(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1051328177) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeEmojiStickerSet(let prevStickerset, let newStickerset): - if boxed { - buffer.appendInt32(1188577451) - } - prevStickerset.serialize(buffer, true) - newStickerset.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeHistoryTTL(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1855199800) - } - serializeInt32(prevValue, buffer: buffer, boxed: false) - serializeInt32(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionChangeLinkedChat(let prevValue, let newValue): - if boxed { - buffer.appendInt32(84703944) - } - serializeInt64(prevValue, buffer: buffer, boxed: false) - serializeInt64(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionChangeLocation(let prevValue, let newValue): - if boxed { - buffer.appendInt32(241923758) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionChangePeerColor(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1469507456) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionChangePhoto(let prevPhoto, let newPhoto): - if boxed { - buffer.appendInt32(1129042607) - } - prevPhoto.serialize(buffer, true) - newPhoto.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeProfilePeerColor(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1581742885) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeStickerSet(let prevStickerset, let newStickerset): - if boxed { - buffer.appendInt32(-1312568665) - } - prevStickerset.serialize(buffer, true) - newStickerset.serialize(buffer, true) - break - case .channelAdminLogEventActionChangeTitle(let prevValue, let newValue): - if boxed { - buffer.appendInt32(-421545947) - } - serializeString(prevValue, buffer: buffer, boxed: false) - serializeString(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionChangeUsername(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1783299128) - } - serializeString(prevValue, buffer: buffer, boxed: false) - serializeString(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionChangeUsernames(let prevValue, let newValue): - if boxed { - buffer.appendInt32(-263212119) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prevValue.count)) - for item in prevValue { - serializeString(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newValue.count)) - for item in newValue { - serializeString(item, buffer: buffer, boxed: false) - } - break - case .channelAdminLogEventActionChangeWallpaper(let prevValue, let newValue): - if boxed { - buffer.appendInt32(834362706) - } - prevValue.serialize(buffer, true) - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionCreateTopic(let topic): - if boxed { - buffer.appendInt32(1483767080) - } - topic.serialize(buffer, true) - break - case .channelAdminLogEventActionDefaultBannedRights(let prevBannedRights, let newBannedRights): - if boxed { - buffer.appendInt32(771095562) - } - prevBannedRights.serialize(buffer, true) - newBannedRights.serialize(buffer, true) - break - case .channelAdminLogEventActionDeleteMessage(let message): - if boxed { - buffer.appendInt32(1121994683) - } - message.serialize(buffer, true) - break - case .channelAdminLogEventActionDeleteTopic(let topic): - if boxed { - buffer.appendInt32(-1374254839) - } - topic.serialize(buffer, true) - break - case .channelAdminLogEventActionDiscardGroupCall(let call): - if boxed { - buffer.appendInt32(-610299584) - } - call.serialize(buffer, true) - break - case .channelAdminLogEventActionEditMessage(let prevMessage, let newMessage): - if boxed { - buffer.appendInt32(1889215493) - } - prevMessage.serialize(buffer, true) - newMessage.serialize(buffer, true) - break - case .channelAdminLogEventActionEditTopic(let prevTopic, let newTopic): - if boxed { - buffer.appendInt32(-261103096) - } - prevTopic.serialize(buffer, true) - newTopic.serialize(buffer, true) - break - case .channelAdminLogEventActionExportedInviteDelete(let invite): - if boxed { - buffer.appendInt32(1515256996) - } - invite.serialize(buffer, true) - break - case .channelAdminLogEventActionExportedInviteEdit(let prevInvite, let newInvite): - if boxed { - buffer.appendInt32(-384910503) - } - prevInvite.serialize(buffer, true) - newInvite.serialize(buffer, true) - break - case .channelAdminLogEventActionExportedInviteRevoke(let invite): - if boxed { - buffer.appendInt32(1091179342) - } - invite.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantInvite(let participant): - if boxed { - buffer.appendInt32(-484690728) - } - participant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantJoin: - if boxed { - buffer.appendInt32(405815507) - } - - break - case .channelAdminLogEventActionParticipantJoinByInvite(let flags, let invite): - if boxed { - buffer.appendInt32(-23084712) - } - serializeInt32(flags, buffer: buffer, boxed: false) - invite.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantJoinByRequest(let invite, let approvedBy): - if boxed { - buffer.appendInt32(-1347021750) - } - invite.serialize(buffer, true) - serializeInt64(approvedBy, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionParticipantLeave: - if boxed { - buffer.appendInt32(-124291086) - } - - break - case .channelAdminLogEventActionParticipantMute(let participant): - if boxed { - buffer.appendInt32(-115071790) - } - participant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantSubExtend(let prevParticipant, let newParticipant): - if boxed { - buffer.appendInt32(1684286899) - } - prevParticipant.serialize(buffer, true) - newParticipant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantToggleAdmin(let prevParticipant, let newParticipant): - if boxed { - buffer.appendInt32(-714643696) - } - prevParticipant.serialize(buffer, true) - newParticipant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantToggleBan(let prevParticipant, let newParticipant): - if boxed { - buffer.appendInt32(-422036098) - } - prevParticipant.serialize(buffer, true) - newParticipant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantUnmute(let participant): - if boxed { - buffer.appendInt32(-431740480) - } - participant.serialize(buffer, true) - break - case .channelAdminLogEventActionParticipantVolume(let participant): - if boxed { - buffer.appendInt32(1048537159) - } - participant.serialize(buffer, true) - break - case .channelAdminLogEventActionPinTopic(let flags, let prevTopic, let newTopic): - if boxed { - buffer.appendInt32(1569535291) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {prevTopic!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {newTopic!.serialize(buffer, true)} - break - case .channelAdminLogEventActionSendMessage(let message): - if boxed { - buffer.appendInt32(663693416) - } - message.serialize(buffer, true) - break - case .channelAdminLogEventActionStartGroupCall(let call): - if boxed { - buffer.appendInt32(589338437) - } - call.serialize(buffer, true) - break - case .channelAdminLogEventActionStopPoll(let message): - if boxed { - buffer.appendInt32(-1895328189) - } - message.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleAntiSpam(let newValue): - if boxed { - buffer.appendInt32(1693675004) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleAutotranslation(let newValue): - if boxed { - buffer.appendInt32(-988285058) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleForum(let newValue): - if boxed { - buffer.appendInt32(46949251) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleGroupCallSetting(let joinMuted): - if boxed { - buffer.appendInt32(1456906823) - } - joinMuted.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleInvites(let newValue): - if boxed { - buffer.appendInt32(460916654) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleNoForwards(let newValue): - if boxed { - buffer.appendInt32(-886388890) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionTogglePreHistoryHidden(let newValue): - if boxed { - buffer.appendInt32(1599903217) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleSignatureProfiles(let newValue): - if boxed { - buffer.appendInt32(1621597305) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleSignatures(let newValue): - if boxed { - buffer.appendInt32(648939889) - } - newValue.serialize(buffer, true) - break - case .channelAdminLogEventActionToggleSlowMode(let prevValue, let newValue): - if boxed { - buffer.appendInt32(1401984889) - } - serializeInt32(prevValue, buffer: buffer, boxed: false) - serializeInt32(newValue, buffer: buffer, boxed: false) - break - case .channelAdminLogEventActionUpdatePinned(let message): - if boxed { - buffer.appendInt32(-370660328) - } - message.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelAdminLogEventActionChangeAbout(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeAbout", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeAvailableReactions(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeEmojiStatus(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeEmojiStickerSet(let prevStickerset, let newStickerset): - return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", prevStickerset as Any), ("newStickerset", newStickerset as Any)]) - case .channelAdminLogEventActionChangeHistoryTTL(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeLinkedChat(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeLocation(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeLocation", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangePeerColor(let prevValue, let newValue): - return ("channelAdminLogEventActionChangePeerColor", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangePhoto(let prevPhoto, let newPhoto): - return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", prevPhoto as Any), ("newPhoto", newPhoto as Any)]) - case .channelAdminLogEventActionChangeProfilePeerColor(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeStickerSet(let prevStickerset, let newStickerset): - return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", prevStickerset as Any), ("newStickerset", newStickerset as Any)]) - case .channelAdminLogEventActionChangeTitle(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeTitle", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeUsername(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeUsername", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeUsernames(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeUsernames", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionChangeWallpaper(let prevValue, let newValue): - return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionCreateTopic(let topic): - return ("channelAdminLogEventActionCreateTopic", [("topic", topic as Any)]) - case .channelAdminLogEventActionDefaultBannedRights(let prevBannedRights, let newBannedRights): - return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", prevBannedRights as Any), ("newBannedRights", newBannedRights as Any)]) - case .channelAdminLogEventActionDeleteMessage(let message): - return ("channelAdminLogEventActionDeleteMessage", [("message", message as Any)]) - case .channelAdminLogEventActionDeleteTopic(let topic): - return ("channelAdminLogEventActionDeleteTopic", [("topic", topic as Any)]) - case .channelAdminLogEventActionDiscardGroupCall(let call): - return ("channelAdminLogEventActionDiscardGroupCall", [("call", call as Any)]) - case .channelAdminLogEventActionEditMessage(let prevMessage, let newMessage): - return ("channelAdminLogEventActionEditMessage", [("prevMessage", prevMessage as Any), ("newMessage", newMessage as Any)]) - case .channelAdminLogEventActionEditTopic(let prevTopic, let newTopic): - return ("channelAdminLogEventActionEditTopic", [("prevTopic", prevTopic as Any), ("newTopic", newTopic as Any)]) - case .channelAdminLogEventActionExportedInviteDelete(let invite): - return ("channelAdminLogEventActionExportedInviteDelete", [("invite", invite as Any)]) - case .channelAdminLogEventActionExportedInviteEdit(let prevInvite, let newInvite): - return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", prevInvite as Any), ("newInvite", newInvite as Any)]) - case .channelAdminLogEventActionExportedInviteRevoke(let invite): - return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", invite as Any)]) - case .channelAdminLogEventActionParticipantInvite(let participant): - return ("channelAdminLogEventActionParticipantInvite", [("participant", participant as Any)]) - case .channelAdminLogEventActionParticipantJoin: + case channelAdminLogEventActionParticipantMute(Cons_channelAdminLogEventActionParticipantMute) + case channelAdminLogEventActionParticipantSubExtend(Cons_channelAdminLogEventActionParticipantSubExtend) + case channelAdminLogEventActionParticipantToggleAdmin(Cons_channelAdminLogEventActionParticipantToggleAdmin) + case channelAdminLogEventActionParticipantToggleBan(Cons_channelAdminLogEventActionParticipantToggleBan) + case channelAdminLogEventActionParticipantUnmute(Cons_channelAdminLogEventActionParticipantUnmute) + case channelAdminLogEventActionParticipantVolume(Cons_channelAdminLogEventActionParticipantVolume) + case channelAdminLogEventActionPinTopic(Cons_channelAdminLogEventActionPinTopic) + case channelAdminLogEventActionSendMessage(Cons_channelAdminLogEventActionSendMessage) + case channelAdminLogEventActionStartGroupCall(Cons_channelAdminLogEventActionStartGroupCall) + case channelAdminLogEventActionStopPoll(Cons_channelAdminLogEventActionStopPoll) + case channelAdminLogEventActionToggleAntiSpam(Cons_channelAdminLogEventActionToggleAntiSpam) + case channelAdminLogEventActionToggleAutotranslation(Cons_channelAdminLogEventActionToggleAutotranslation) + case channelAdminLogEventActionToggleForum(Cons_channelAdminLogEventActionToggleForum) + case channelAdminLogEventActionToggleGroupCallSetting(Cons_channelAdminLogEventActionToggleGroupCallSetting) + case channelAdminLogEventActionToggleInvites(Cons_channelAdminLogEventActionToggleInvites) + case channelAdminLogEventActionToggleNoForwards(Cons_channelAdminLogEventActionToggleNoForwards) + case channelAdminLogEventActionTogglePreHistoryHidden(Cons_channelAdminLogEventActionTogglePreHistoryHidden) + case channelAdminLogEventActionToggleSignatureProfiles(Cons_channelAdminLogEventActionToggleSignatureProfiles) + case channelAdminLogEventActionToggleSignatures(Cons_channelAdminLogEventActionToggleSignatures) + case channelAdminLogEventActionToggleSlowMode(Cons_channelAdminLogEventActionToggleSlowMode) + case channelAdminLogEventActionUpdatePinned(Cons_channelAdminLogEventActionUpdatePinned) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelAdminLogEventActionChangeAbout(let _data): + if boxed { + buffer.appendInt32(1427671598) + } + serializeString(_data.prevValue, buffer: buffer, boxed: false) + serializeString(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionChangeAvailableReactions(let _data): + if boxed { + buffer.appendInt32(-1102180616) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeEmojiStatus(let _data): + if boxed { + buffer.appendInt32(1051328177) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeEmojiStickerSet(let _data): + if boxed { + buffer.appendInt32(1188577451) + } + _data.prevStickerset.serialize(buffer, true) + _data.newStickerset.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeHistoryTTL(let _data): + if boxed { + buffer.appendInt32(1855199800) + } + serializeInt32(_data.prevValue, buffer: buffer, boxed: false) + serializeInt32(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionChangeLinkedChat(let _data): + if boxed { + buffer.appendInt32(84703944) + } + serializeInt64(_data.prevValue, buffer: buffer, boxed: false) + serializeInt64(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionChangeLocation(let _data): + if boxed { + buffer.appendInt32(241923758) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionChangePeerColor(let _data): + if boxed { + buffer.appendInt32(1469507456) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionChangePhoto(let _data): + if boxed { + buffer.appendInt32(1129042607) + } + _data.prevPhoto.serialize(buffer, true) + _data.newPhoto.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeProfilePeerColor(let _data): + if boxed { + buffer.appendInt32(1581742885) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeStickerSet(let _data): + if boxed { + buffer.appendInt32(-1312568665) + } + _data.prevStickerset.serialize(buffer, true) + _data.newStickerset.serialize(buffer, true) + break + case .channelAdminLogEventActionChangeTitle(let _data): + if boxed { + buffer.appendInt32(-421545947) + } + serializeString(_data.prevValue, buffer: buffer, boxed: false) + serializeString(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionChangeUsername(let _data): + if boxed { + buffer.appendInt32(1783299128) + } + serializeString(_data.prevValue, buffer: buffer, boxed: false) + serializeString(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionChangeUsernames(let _data): + if boxed { + buffer.appendInt32(-263212119) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prevValue.count)) + for item in _data.prevValue { + serializeString(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newValue.count)) + for item in _data.newValue { + serializeString(item, buffer: buffer, boxed: false) + } + break + case .channelAdminLogEventActionChangeWallpaper(let _data): + if boxed { + buffer.appendInt32(834362706) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionCreateTopic(let _data): + if boxed { + buffer.appendInt32(1483767080) + } + _data.topic.serialize(buffer, true) + break + case .channelAdminLogEventActionDefaultBannedRights(let _data): + if boxed { + buffer.appendInt32(771095562) + } + _data.prevBannedRights.serialize(buffer, true) + _data.newBannedRights.serialize(buffer, true) + break + case .channelAdminLogEventActionDeleteMessage(let _data): + if boxed { + buffer.appendInt32(1121994683) + } + _data.message.serialize(buffer, true) + break + case .channelAdminLogEventActionDeleteTopic(let _data): + if boxed { + buffer.appendInt32(-1374254839) + } + _data.topic.serialize(buffer, true) + break + case .channelAdminLogEventActionDiscardGroupCall(let _data): + if boxed { + buffer.appendInt32(-610299584) + } + _data.call.serialize(buffer, true) + break + case .channelAdminLogEventActionEditMessage(let _data): + if boxed { + buffer.appendInt32(1889215493) + } + _data.prevMessage.serialize(buffer, true) + _data.newMessage.serialize(buffer, true) + break + case .channelAdminLogEventActionEditTopic(let _data): + if boxed { + buffer.appendInt32(-261103096) + } + _data.prevTopic.serialize(buffer, true) + _data.newTopic.serialize(buffer, true) + break + case .channelAdminLogEventActionExportedInviteDelete(let _data): + if boxed { + buffer.appendInt32(1515256996) + } + _data.invite.serialize(buffer, true) + break + case .channelAdminLogEventActionExportedInviteEdit(let _data): + if boxed { + buffer.appendInt32(-384910503) + } + _data.prevInvite.serialize(buffer, true) + _data.newInvite.serialize(buffer, true) + break + case .channelAdminLogEventActionExportedInviteRevoke(let _data): + if boxed { + buffer.appendInt32(1091179342) + } + _data.invite.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantInvite(let _data): + if boxed { + buffer.appendInt32(-484690728) + } + _data.participant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantJoin: + if boxed { + buffer.appendInt32(405815507) + } + break + case .channelAdminLogEventActionParticipantJoinByInvite(let _data): + if boxed { + buffer.appendInt32(-23084712) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.invite.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantJoinByRequest(let _data): + if boxed { + buffer.appendInt32(-1347021750) + } + _data.invite.serialize(buffer, true) + serializeInt64(_data.approvedBy, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionParticipantLeave: + if boxed { + buffer.appendInt32(-124291086) + } + break + case .channelAdminLogEventActionParticipantMute(let _data): + if boxed { + buffer.appendInt32(-115071790) + } + _data.participant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantSubExtend(let _data): + if boxed { + buffer.appendInt32(1684286899) + } + _data.prevParticipant.serialize(buffer, true) + _data.newParticipant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantToggleAdmin(let _data): + if boxed { + buffer.appendInt32(-714643696) + } + _data.prevParticipant.serialize(buffer, true) + _data.newParticipant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantToggleBan(let _data): + if boxed { + buffer.appendInt32(-422036098) + } + _data.prevParticipant.serialize(buffer, true) + _data.newParticipant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantUnmute(let _data): + if boxed { + buffer.appendInt32(-431740480) + } + _data.participant.serialize(buffer, true) + break + case .channelAdminLogEventActionParticipantVolume(let _data): + if boxed { + buffer.appendInt32(1048537159) + } + _data.participant.serialize(buffer, true) + break + case .channelAdminLogEventActionPinTopic(let _data): + if boxed { + buffer.appendInt32(1569535291) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.prevTopic!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.newTopic!.serialize(buffer, true) + } + break + case .channelAdminLogEventActionSendMessage(let _data): + if boxed { + buffer.appendInt32(663693416) + } + _data.message.serialize(buffer, true) + break + case .channelAdminLogEventActionStartGroupCall(let _data): + if boxed { + buffer.appendInt32(589338437) + } + _data.call.serialize(buffer, true) + break + case .channelAdminLogEventActionStopPoll(let _data): + if boxed { + buffer.appendInt32(-1895328189) + } + _data.message.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleAntiSpam(let _data): + if boxed { + buffer.appendInt32(1693675004) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleAutotranslation(let _data): + if boxed { + buffer.appendInt32(-988285058) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleForum(let _data): + if boxed { + buffer.appendInt32(46949251) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleGroupCallSetting(let _data): + if boxed { + buffer.appendInt32(1456906823) + } + _data.joinMuted.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleInvites(let _data): + if boxed { + buffer.appendInt32(460916654) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleNoForwards(let _data): + if boxed { + buffer.appendInt32(-886388890) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionTogglePreHistoryHidden(let _data): + if boxed { + buffer.appendInt32(1599903217) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleSignatureProfiles(let _data): + if boxed { + buffer.appendInt32(1621597305) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleSignatures(let _data): + if boxed { + buffer.appendInt32(648939889) + } + _data.newValue.serialize(buffer, true) + break + case .channelAdminLogEventActionToggleSlowMode(let _data): + if boxed { + buffer.appendInt32(1401984889) + } + serializeInt32(_data.prevValue, buffer: buffer, boxed: false) + serializeInt32(_data.newValue, buffer: buffer, boxed: false) + break + case .channelAdminLogEventActionUpdatePinned(let _data): + if boxed { + buffer.appendInt32(-370660328) + } + _data.message.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelAdminLogEventActionChangeAbout(let _data): + return ("channelAdminLogEventActionChangeAbout", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeAvailableReactions(let _data): + return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeEmojiStatus(let _data): + return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeEmojiStickerSet(let _data): + return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", _data.prevStickerset as Any), ("newStickerset", _data.newStickerset as Any)]) + case .channelAdminLogEventActionChangeHistoryTTL(let _data): + return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeLinkedChat(let _data): + return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeLocation(let _data): + return ("channelAdminLogEventActionChangeLocation", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangePeerColor(let _data): + return ("channelAdminLogEventActionChangePeerColor", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangePhoto(let _data): + return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", _data.prevPhoto as Any), ("newPhoto", _data.newPhoto as Any)]) + case .channelAdminLogEventActionChangeProfilePeerColor(let _data): + return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeStickerSet(let _data): + return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", _data.prevStickerset as Any), ("newStickerset", _data.newStickerset as Any)]) + case .channelAdminLogEventActionChangeTitle(let _data): + return ("channelAdminLogEventActionChangeTitle", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeUsername(let _data): + return ("channelAdminLogEventActionChangeUsername", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeUsernames(let _data): + return ("channelAdminLogEventActionChangeUsernames", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionChangeWallpaper(let _data): + return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionCreateTopic(let _data): + return ("channelAdminLogEventActionCreateTopic", [("topic", _data.topic as Any)]) + case .channelAdminLogEventActionDefaultBannedRights(let _data): + return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", _data.prevBannedRights as Any), ("newBannedRights", _data.newBannedRights as Any)]) + case .channelAdminLogEventActionDeleteMessage(let _data): + return ("channelAdminLogEventActionDeleteMessage", [("message", _data.message as Any)]) + case .channelAdminLogEventActionDeleteTopic(let _data): + return ("channelAdminLogEventActionDeleteTopic", [("topic", _data.topic as Any)]) + case .channelAdminLogEventActionDiscardGroupCall(let _data): + return ("channelAdminLogEventActionDiscardGroupCall", [("call", _data.call as Any)]) + case .channelAdminLogEventActionEditMessage(let _data): + return ("channelAdminLogEventActionEditMessage", [("prevMessage", _data.prevMessage as Any), ("newMessage", _data.newMessage as Any)]) + case .channelAdminLogEventActionEditTopic(let _data): + return ("channelAdminLogEventActionEditTopic", [("prevTopic", _data.prevTopic as Any), ("newTopic", _data.newTopic as Any)]) + case .channelAdminLogEventActionExportedInviteDelete(let _data): + return ("channelAdminLogEventActionExportedInviteDelete", [("invite", _data.invite as Any)]) + case .channelAdminLogEventActionExportedInviteEdit(let _data): + return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", _data.prevInvite as Any), ("newInvite", _data.newInvite as Any)]) + case .channelAdminLogEventActionExportedInviteRevoke(let _data): + return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", _data.invite as Any)]) + case .channelAdminLogEventActionParticipantInvite(let _data): + return ("channelAdminLogEventActionParticipantInvite", [("participant", _data.participant as Any)]) + case .channelAdminLogEventActionParticipantJoin: return ("channelAdminLogEventActionParticipantJoin", []) - case .channelAdminLogEventActionParticipantJoinByInvite(let flags, let invite): - return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", flags as Any), ("invite", invite as Any)]) - case .channelAdminLogEventActionParticipantJoinByRequest(let invite, let approvedBy): - return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", invite as Any), ("approvedBy", approvedBy as Any)]) - case .channelAdminLogEventActionParticipantLeave: + case .channelAdminLogEventActionParticipantJoinByInvite(let _data): + return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", _data.flags as Any), ("invite", _data.invite as Any)]) + case .channelAdminLogEventActionParticipantJoinByRequest(let _data): + return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", _data.invite as Any), ("approvedBy", _data.approvedBy as Any)]) + case .channelAdminLogEventActionParticipantLeave: return ("channelAdminLogEventActionParticipantLeave", []) - case .channelAdminLogEventActionParticipantMute(let participant): - return ("channelAdminLogEventActionParticipantMute", [("participant", participant as Any)]) - case .channelAdminLogEventActionParticipantSubExtend(let prevParticipant, let newParticipant): - return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", prevParticipant as Any), ("newParticipant", newParticipant as Any)]) - case .channelAdminLogEventActionParticipantToggleAdmin(let prevParticipant, let newParticipant): - return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", prevParticipant as Any), ("newParticipant", newParticipant as Any)]) - case .channelAdminLogEventActionParticipantToggleBan(let prevParticipant, let newParticipant): - return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", prevParticipant as Any), ("newParticipant", newParticipant as Any)]) - case .channelAdminLogEventActionParticipantUnmute(let participant): - return ("channelAdminLogEventActionParticipantUnmute", [("participant", participant as Any)]) - case .channelAdminLogEventActionParticipantVolume(let participant): - return ("channelAdminLogEventActionParticipantVolume", [("participant", participant as Any)]) - case .channelAdminLogEventActionPinTopic(let flags, let prevTopic, let newTopic): - return ("channelAdminLogEventActionPinTopic", [("flags", flags as Any), ("prevTopic", prevTopic as Any), ("newTopic", newTopic as Any)]) - case .channelAdminLogEventActionSendMessage(let message): - return ("channelAdminLogEventActionSendMessage", [("message", message as Any)]) - case .channelAdminLogEventActionStartGroupCall(let call): - return ("channelAdminLogEventActionStartGroupCall", [("call", call as Any)]) - case .channelAdminLogEventActionStopPoll(let message): - return ("channelAdminLogEventActionStopPoll", [("message", message as Any)]) - case .channelAdminLogEventActionToggleAntiSpam(let newValue): - return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleAutotranslation(let newValue): - return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleForum(let newValue): - return ("channelAdminLogEventActionToggleForum", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleGroupCallSetting(let joinMuted): - return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", joinMuted as Any)]) - case .channelAdminLogEventActionToggleInvites(let newValue): - return ("channelAdminLogEventActionToggleInvites", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleNoForwards(let newValue): - return ("channelAdminLogEventActionToggleNoForwards", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionTogglePreHistoryHidden(let newValue): - return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleSignatureProfiles(let newValue): - return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleSignatures(let newValue): - return ("channelAdminLogEventActionToggleSignatures", [("newValue", newValue as Any)]) - case .channelAdminLogEventActionToggleSlowMode(let prevValue, let newValue): - return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", prevValue as Any), ("newValue", newValue as Any)]) - case .channelAdminLogEventActionUpdatePinned(let message): - return ("channelAdminLogEventActionUpdatePinned", [("message", message as Any)]) - } - } - + case .channelAdminLogEventActionParticipantMute(let _data): + return ("channelAdminLogEventActionParticipantMute", [("participant", _data.participant as Any)]) + case .channelAdminLogEventActionParticipantSubExtend(let _data): + return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + case .channelAdminLogEventActionParticipantToggleAdmin(let _data): + return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + case .channelAdminLogEventActionParticipantToggleBan(let _data): + return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + case .channelAdminLogEventActionParticipantUnmute(let _data): + return ("channelAdminLogEventActionParticipantUnmute", [("participant", _data.participant as Any)]) + case .channelAdminLogEventActionParticipantVolume(let _data): + return ("channelAdminLogEventActionParticipantVolume", [("participant", _data.participant as Any)]) + case .channelAdminLogEventActionPinTopic(let _data): + return ("channelAdminLogEventActionPinTopic", [("flags", _data.flags as Any), ("prevTopic", _data.prevTopic as Any), ("newTopic", _data.newTopic as Any)]) + case .channelAdminLogEventActionSendMessage(let _data): + return ("channelAdminLogEventActionSendMessage", [("message", _data.message as Any)]) + case .channelAdminLogEventActionStartGroupCall(let _data): + return ("channelAdminLogEventActionStartGroupCall", [("call", _data.call as Any)]) + case .channelAdminLogEventActionStopPoll(let _data): + return ("channelAdminLogEventActionStopPoll", [("message", _data.message as Any)]) + case .channelAdminLogEventActionToggleAntiSpam(let _data): + return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleAutotranslation(let _data): + return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleForum(let _data): + return ("channelAdminLogEventActionToggleForum", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleGroupCallSetting(let _data): + return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", _data.joinMuted as Any)]) + case .channelAdminLogEventActionToggleInvites(let _data): + return ("channelAdminLogEventActionToggleInvites", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleNoForwards(let _data): + return ("channelAdminLogEventActionToggleNoForwards", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionTogglePreHistoryHidden(let _data): + return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleSignatureProfiles(let _data): + return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleSignatures(let _data): + return ("channelAdminLogEventActionToggleSignatures", [("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionToggleSlowMode(let _data): + return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + case .channelAdminLogEventActionUpdatePinned(let _data): + return ("channelAdminLogEventActionUpdatePinned", [("message", _data.message as Any)]) + } + } + public static func parse_channelAdminLogEventActionChangeAbout(_ reader: BufferReader) -> ChannelAdminLogEventAction? { var _1: String? _1 = parseString(reader) @@ -923,7 +1360,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeAbout(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeAbout(Cons_channelAdminLogEventActionChangeAbout(prevValue: _1!, newValue: _2!)) } else { return nil @@ -941,7 +1378,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeAvailableReactions(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeAvailableReactions(Cons_channelAdminLogEventActionChangeAvailableReactions(prevValue: _1!, newValue: _2!)) } else { return nil @@ -959,7 +1396,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeEmojiStatus(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeEmojiStatus(Cons_channelAdminLogEventActionChangeEmojiStatus(prevValue: _1!, newValue: _2!)) } else { return nil @@ -977,7 +1414,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeEmojiStickerSet(prevStickerset: _1!, newStickerset: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeEmojiStickerSet(Cons_channelAdminLogEventActionChangeEmojiStickerSet(prevStickerset: _1!, newStickerset: _2!)) } else { return nil @@ -991,7 +1428,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeHistoryTTL(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeHistoryTTL(Cons_channelAdminLogEventActionChangeHistoryTTL(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1005,7 +1442,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeLinkedChat(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeLinkedChat(Cons_channelAdminLogEventActionChangeLinkedChat(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1023,7 +1460,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeLocation(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeLocation(Cons_channelAdminLogEventActionChangeLocation(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1041,7 +1478,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangePeerColor(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangePeerColor(Cons_channelAdminLogEventActionChangePeerColor(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1059,7 +1496,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangePhoto(prevPhoto: _1!, newPhoto: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangePhoto(Cons_channelAdminLogEventActionChangePhoto(prevPhoto: _1!, newPhoto: _2!)) } else { return nil @@ -1077,7 +1514,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeProfilePeerColor(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeProfilePeerColor(Cons_channelAdminLogEventActionChangeProfilePeerColor(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1095,7 +1532,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeStickerSet(prevStickerset: _1!, newStickerset: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeStickerSet(Cons_channelAdminLogEventActionChangeStickerSet(prevStickerset: _1!, newStickerset: _2!)) } else { return nil @@ -1109,7 +1546,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeTitle(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeTitle(Cons_channelAdminLogEventActionChangeTitle(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1123,7 +1560,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeUsername(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeUsername(Cons_channelAdminLogEventActionChangeUsername(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1141,7 +1578,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeUsernames(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeUsernames(Cons_channelAdminLogEventActionChangeUsernames(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1159,7 +1596,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeWallpaper(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionChangeWallpaper(Cons_channelAdminLogEventActionChangeWallpaper(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1172,7 +1609,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionCreateTopic(topic: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionCreateTopic(Cons_channelAdminLogEventActionCreateTopic(topic: _1!)) } else { return nil @@ -1190,7 +1627,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDefaultBannedRights(prevBannedRights: _1!, newBannedRights: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDefaultBannedRights(Cons_channelAdminLogEventActionDefaultBannedRights(prevBannedRights: _1!, newBannedRights: _2!)) } else { return nil @@ -1203,7 +1640,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDeleteMessage(message: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDeleteMessage(Cons_channelAdminLogEventActionDeleteMessage(message: _1!)) } else { return nil @@ -1216,7 +1653,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDeleteTopic(topic: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDeleteTopic(Cons_channelAdminLogEventActionDeleteTopic(topic: _1!)) } else { return nil @@ -1229,7 +1666,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDiscardGroupCall(call: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionDiscardGroupCall(Cons_channelAdminLogEventActionDiscardGroupCall(call: _1!)) } else { return nil @@ -1247,7 +1684,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionEditMessage(prevMessage: _1!, newMessage: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionEditMessage(Cons_channelAdminLogEventActionEditMessage(prevMessage: _1!, newMessage: _2!)) } else { return nil @@ -1265,7 +1702,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionEditTopic(prevTopic: _1!, newTopic: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionEditTopic(Cons_channelAdminLogEventActionEditTopic(prevTopic: _1!, newTopic: _2!)) } else { return nil @@ -1278,7 +1715,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteDelete(invite: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteDelete(Cons_channelAdminLogEventActionExportedInviteDelete(invite: _1!)) } else { return nil @@ -1296,7 +1733,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteEdit(prevInvite: _1!, newInvite: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteEdit(Cons_channelAdminLogEventActionExportedInviteEdit(prevInvite: _1!, newInvite: _2!)) } else { return nil @@ -1309,7 +1746,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteRevoke(invite: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionExportedInviteRevoke(Cons_channelAdminLogEventActionExportedInviteRevoke(invite: _1!)) } else { return nil @@ -1322,7 +1759,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantInvite(participant: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantInvite(Cons_channelAdminLogEventActionParticipantInvite(participant: _1!)) } else { return nil @@ -1341,7 +1778,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantJoinByInvite(flags: _1!, invite: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantJoinByInvite(Cons_channelAdminLogEventActionParticipantJoinByInvite(flags: _1!, invite: _2!)) } else { return nil @@ -1357,7 +1794,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantJoinByRequest(invite: _1!, approvedBy: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantJoinByRequest(Cons_channelAdminLogEventActionParticipantJoinByRequest(invite: _1!, approvedBy: _2!)) } else { return nil @@ -1373,7 +1810,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantMute(participant: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantMute(Cons_channelAdminLogEventActionParticipantMute(participant: _1!)) } else { return nil @@ -1391,7 +1828,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantSubExtend(prevParticipant: _1!, newParticipant: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantSubExtend(Cons_channelAdminLogEventActionParticipantSubExtend(prevParticipant: _1!, newParticipant: _2!)) } else { return nil @@ -1409,7 +1846,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantToggleAdmin(prevParticipant: _1!, newParticipant: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantToggleAdmin(Cons_channelAdminLogEventActionParticipantToggleAdmin(prevParticipant: _1!, newParticipant: _2!)) } else { return nil @@ -1427,7 +1864,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantToggleBan(prevParticipant: _1!, newParticipant: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantToggleBan(Cons_channelAdminLogEventActionParticipantToggleBan(prevParticipant: _1!, newParticipant: _2!)) } else { return nil @@ -1440,7 +1877,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantUnmute(participant: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantUnmute(Cons_channelAdminLogEventActionParticipantUnmute(participant: _1!)) } else { return nil @@ -1453,7 +1890,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantVolume(participant: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionParticipantVolume(Cons_channelAdminLogEventActionParticipantVolume(participant: _1!)) } else { return nil @@ -1463,18 +1900,22 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.ForumTopic? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ForumTopic - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ForumTopic + } + } var _3: Api.ForumTopic? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ForumTopic - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ForumTopic + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionPinTopic(flags: _1!, prevTopic: _2, newTopic: _3) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionPinTopic(Cons_channelAdminLogEventActionPinTopic(flags: _1!, prevTopic: _2, newTopic: _3)) } else { return nil @@ -1487,7 +1928,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionSendMessage(message: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionSendMessage(Cons_channelAdminLogEventActionSendMessage(message: _1!)) } else { return nil @@ -1500,7 +1941,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionStartGroupCall(call: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionStartGroupCall(Cons_channelAdminLogEventActionStartGroupCall(call: _1!)) } else { return nil @@ -1513,7 +1954,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionStopPoll(message: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionStopPoll(Cons_channelAdminLogEventActionStopPoll(message: _1!)) } else { return nil @@ -1526,7 +1967,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleAntiSpam(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleAntiSpam(Cons_channelAdminLogEventActionToggleAntiSpam(newValue: _1!)) } else { return nil @@ -1539,7 +1980,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleAutotranslation(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleAutotranslation(Cons_channelAdminLogEventActionToggleAutotranslation(newValue: _1!)) } else { return nil @@ -1552,7 +1993,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleForum(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleForum(Cons_channelAdminLogEventActionToggleForum(newValue: _1!)) } else { return nil @@ -1565,7 +2006,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleGroupCallSetting(joinMuted: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleGroupCallSetting(Cons_channelAdminLogEventActionToggleGroupCallSetting(joinMuted: _1!)) } else { return nil @@ -1578,7 +2019,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleInvites(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleInvites(Cons_channelAdminLogEventActionToggleInvites(newValue: _1!)) } else { return nil @@ -1591,7 +2032,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleNoForwards(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleNoForwards(Cons_channelAdminLogEventActionToggleNoForwards(newValue: _1!)) } else { return nil @@ -1604,7 +2045,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionTogglePreHistoryHidden(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionTogglePreHistoryHidden(Cons_channelAdminLogEventActionTogglePreHistoryHidden(newValue: _1!)) } else { return nil @@ -1617,7 +2058,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSignatureProfiles(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSignatureProfiles(Cons_channelAdminLogEventActionToggleSignatureProfiles(newValue: _1!)) } else { return nil @@ -1630,7 +2071,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSignatures(newValue: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSignatures(Cons_channelAdminLogEventActionToggleSignatures(newValue: _1!)) } else { return nil @@ -1644,7 +2085,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSlowMode(prevValue: _1!, newValue: _2!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleSlowMode(Cons_channelAdminLogEventActionToggleSlowMode(prevValue: _1!, newValue: _2!)) } else { return nil @@ -1657,12 +2098,11 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventAction.channelAdminLogEventActionUpdatePinned(message: _1!) + return Api.ChannelAdminLogEventAction.channelAdminLogEventActionUpdatePinned(Cons_channelAdminLogEventActionUpdatePinned(message: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api30.swift b/submodules/TelegramApi/Sources/Api30.swift index 17bc8c5a9a..3e25dcd6f5 100644 --- a/submodules/TelegramApi/Sources/Api30.swift +++ b/submodules/TelegramApi/Sources/Api30.swift @@ -1,89 +1,145 @@ public extension Api { indirect enum WebPageAttribute: TypeConstructorDescription { - case webPageAttributeStarGiftAuction(gift: Api.StarGift, endDate: Int32) - case webPageAttributeStarGiftCollection(icons: [Api.Document]) - case webPageAttributeStickerSet(flags: Int32, stickers: [Api.Document]) - case webPageAttributeStory(flags: Int32, peer: Api.Peer, id: Int32, story: Api.StoryItem?) - case webPageAttributeTheme(flags: Int32, documents: [Api.Document]?, settings: Api.ThemeSettings?) - case webPageAttributeUniqueStarGift(gift: Api.StarGift) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webPageAttributeStarGiftAuction(let gift, let endDate): - if boxed { - buffer.appendInt32(29770178) - } - gift.serialize(buffer, true) - serializeInt32(endDate, buffer: buffer, boxed: false) - break - case .webPageAttributeStarGiftCollection(let icons): - if boxed { - buffer.appendInt32(835375875) - } + public class Cons_webPageAttributeStarGiftAuction { + public var gift: Api.StarGift + public var endDate: Int32 + public init(gift: Api.StarGift, endDate: Int32) { + self.gift = gift + self.endDate = endDate + } + } + public class Cons_webPageAttributeStarGiftCollection { + public var icons: [Api.Document] + public init(icons: [Api.Document]) { + self.icons = icons + } + } + public class Cons_webPageAttributeStickerSet { + public var flags: Int32 + public var stickers: [Api.Document] + public init(flags: Int32, stickers: [Api.Document]) { + self.flags = flags + self.stickers = stickers + } + } + public class Cons_webPageAttributeStory { + public var flags: Int32 + public var peer: Api.Peer + public var id: Int32 + public var story: Api.StoryItem? + public init(flags: Int32, peer: Api.Peer, id: Int32, story: Api.StoryItem?) { + self.flags = flags + self.peer = peer + self.id = id + self.story = story + } + } + public class Cons_webPageAttributeTheme { + public var flags: Int32 + public var documents: [Api.Document]? + public var settings: Api.ThemeSettings? + public init(flags: Int32, documents: [Api.Document]?, settings: Api.ThemeSettings?) { + self.flags = flags + self.documents = documents + self.settings = settings + } + } + public class Cons_webPageAttributeUniqueStarGift { + public var gift: Api.StarGift + public init(gift: Api.StarGift) { + self.gift = gift + } + } + case webPageAttributeStarGiftAuction(Cons_webPageAttributeStarGiftAuction) + case webPageAttributeStarGiftCollection(Cons_webPageAttributeStarGiftCollection) + case webPageAttributeStickerSet(Cons_webPageAttributeStickerSet) + case webPageAttributeStory(Cons_webPageAttributeStory) + case webPageAttributeTheme(Cons_webPageAttributeTheme) + case webPageAttributeUniqueStarGift(Cons_webPageAttributeUniqueStarGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webPageAttributeStarGiftAuction(let _data): + if boxed { + buffer.appendInt32(29770178) + } + _data.gift.serialize(buffer, true) + serializeInt32(_data.endDate, buffer: buffer, boxed: false) + break + case .webPageAttributeStarGiftCollection(let _data): + if boxed { + buffer.appendInt32(835375875) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.icons.count)) + for item in _data.icons { + item.serialize(buffer, true) + } + break + case .webPageAttributeStickerSet(let _data): + if boxed { + buffer.appendInt32(1355547603) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { + item.serialize(buffer, true) + } + break + case .webPageAttributeStory(let _data): + if boxed { + buffer.appendInt32(781501415) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.story!.serialize(buffer, true) + } + break + case .webPageAttributeTheme(let _data): + if boxed { + buffer.appendInt32(1421174295) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(icons.count)) - for item in icons { + buffer.appendInt32(Int32(_data.documents!.count)) + for item in _data.documents! { item.serialize(buffer, true) } - break - case .webPageAttributeStickerSet(let flags, let stickers): - if boxed { - buffer.appendInt32(1355547603) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - break - case .webPageAttributeStory(let flags, let peer, let id, let story): - if boxed { - buffer.appendInt32(781501415) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {story!.serialize(buffer, true)} - break - case .webPageAttributeTheme(let flags, let documents, let settings): - if boxed { - buffer.appendInt32(1421174295) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents!.count)) - for item in documents! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {settings!.serialize(buffer, true)} - break - case .webPageAttributeUniqueStarGift(let gift): - if boxed { - buffer.appendInt32(-814781000) - } - gift.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webPageAttributeStarGiftAuction(let gift, let endDate): - return ("webPageAttributeStarGiftAuction", [("gift", gift as Any), ("endDate", endDate as Any)]) - case .webPageAttributeStarGiftCollection(let icons): - return ("webPageAttributeStarGiftCollection", [("icons", icons as Any)]) - case .webPageAttributeStickerSet(let flags, let stickers): - return ("webPageAttributeStickerSet", [("flags", flags as Any), ("stickers", stickers as Any)]) - case .webPageAttributeStory(let flags, let peer, let id, let story): - return ("webPageAttributeStory", [("flags", flags as Any), ("peer", peer as Any), ("id", id as Any), ("story", story as Any)]) - case .webPageAttributeTheme(let flags, let documents, let settings): - return ("webPageAttributeTheme", [("flags", flags as Any), ("documents", documents as Any), ("settings", settings as Any)]) - case .webPageAttributeUniqueStarGift(let gift): - return ("webPageAttributeUniqueStarGift", [("gift", gift as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.settings!.serialize(buffer, true) + } + break + case .webPageAttributeUniqueStarGift(let _data): + if boxed { + buffer.appendInt32(-814781000) + } + _data.gift.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webPageAttributeStarGiftAuction(let _data): + return ("webPageAttributeStarGiftAuction", [("gift", _data.gift as Any), ("endDate", _data.endDate as Any)]) + case .webPageAttributeStarGiftCollection(let _data): + return ("webPageAttributeStarGiftCollection", [("icons", _data.icons as Any)]) + case .webPageAttributeStickerSet(let _data): + return ("webPageAttributeStickerSet", [("flags", _data.flags as Any), ("stickers", _data.stickers as Any)]) + case .webPageAttributeStory(let _data): + return ("webPageAttributeStory", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("id", _data.id as Any), ("story", _data.story as Any)]) + case .webPageAttributeTheme(let _data): + return ("webPageAttributeTheme", [("flags", _data.flags as Any), ("documents", _data.documents as Any), ("settings", _data.settings as Any)]) + case .webPageAttributeUniqueStarGift(let _data): + return ("webPageAttributeUniqueStarGift", [("gift", _data.gift as Any)]) + } + } + public static func parse_webPageAttributeStarGiftAuction(_ reader: BufferReader) -> WebPageAttribute? { var _1: Api.StarGift? if let signature = reader.readInt32() { @@ -94,7 +150,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.WebPageAttribute.webPageAttributeStarGiftAuction(gift: _1!, endDate: _2!) + return Api.WebPageAttribute.webPageAttributeStarGiftAuction(Cons_webPageAttributeStarGiftAuction(gift: _1!, endDate: _2!)) } else { return nil @@ -107,7 +163,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.WebPageAttribute.webPageAttributeStarGiftCollection(icons: _1!) + return Api.WebPageAttribute.webPageAttributeStarGiftCollection(Cons_webPageAttributeStarGiftCollection(icons: _1!)) } else { return nil @@ -123,7 +179,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.WebPageAttribute.webPageAttributeStickerSet(flags: _1!, stickers: _2!) + return Api.WebPageAttribute.webPageAttributeStickerSet(Cons_webPageAttributeStickerSet(flags: _1!, stickers: _2!)) } else { return nil @@ -139,15 +195,17 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Api.StoryItem? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StoryItem - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StoryItem + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.WebPageAttribute.webPageAttributeStory(flags: _1!, peer: _2!, id: _3!, story: _4) + return Api.WebPageAttribute.webPageAttributeStory(Cons_webPageAttributeStory(flags: _1!, peer: _2!, id: _3!, story: _4)) } else { return nil @@ -157,18 +215,22 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: [Api.Document]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + } var _3: Api.ThemeSettings? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ThemeSettings - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ThemeSettings + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.WebPageAttribute.webPageAttributeTheme(flags: _1!, documents: _2, settings: _3) + return Api.WebPageAttribute.webPageAttributeTheme(Cons_webPageAttributeTheme(flags: _1!, documents: _2, settings: _3)) } else { return nil @@ -181,144 +243,185 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.WebPageAttribute.webPageAttributeUniqueStarGift(gift: _1!) + return Api.WebPageAttribute.webPageAttributeUniqueStarGift(Cons_webPageAttributeUniqueStarGift(gift: _1!)) } else { return nil } } - } } public extension Api { enum WebViewMessageSent: TypeConstructorDescription { - case webViewMessageSent(flags: Int32, msgId: Api.InputBotInlineMessageID?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webViewMessageSent(let flags, let msgId): - if boxed { - buffer.appendInt32(211046684) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {msgId!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webViewMessageSent(let flags, let msgId): - return ("webViewMessageSent", [("flags", flags as Any), ("msgId", msgId as Any)]) - } - } - + public class Cons_webViewMessageSent { + public var flags: Int32 + public var msgId: Api.InputBotInlineMessageID? + public init(flags: Int32, msgId: Api.InputBotInlineMessageID?) { + self.flags = flags + self.msgId = msgId + } + } + case webViewMessageSent(Cons_webViewMessageSent) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webViewMessageSent(let _data): + if boxed { + buffer.appendInt32(211046684) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.msgId!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webViewMessageSent(let _data): + return ("webViewMessageSent", [("flags", _data.flags as Any), ("msgId", _data.msgId as Any)]) + } + } + public static func parse_webViewMessageSent(_ reader: BufferReader) -> WebViewMessageSent? { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputBotInlineMessageID? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.WebViewMessageSent.webViewMessageSent(flags: _1!, msgId: _2) + return Api.WebViewMessageSent.webViewMessageSent(Cons_webViewMessageSent(flags: _1!, msgId: _2)) } else { return nil } } - } } public extension Api { enum WebViewResult: TypeConstructorDescription { - case webViewResultUrl(flags: Int32, queryId: Int64?, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webViewResultUrl(let flags, let queryId, let url): - if boxed { - buffer.appendInt32(1294139288) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(queryId!, buffer: buffer, boxed: false)} - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webViewResultUrl(let flags, let queryId, let url): - return ("webViewResultUrl", [("flags", flags as Any), ("queryId", queryId as Any), ("url", url as Any)]) - } - } - + public class Cons_webViewResultUrl { + public var flags: Int32 + public var queryId: Int64? + public var url: String + public init(flags: Int32, queryId: Int64?, url: String) { + self.flags = flags + self.queryId = queryId + self.url = url + } + } + case webViewResultUrl(Cons_webViewResultUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webViewResultUrl(let _data): + if boxed { + buffer.appendInt32(1294139288) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.queryId!, buffer: buffer, boxed: false) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webViewResultUrl(let _data): + return ("webViewResultUrl", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("url", _data.url as Any)]) + } + } + public static func parse_webViewResultUrl(_ reader: BufferReader) -> WebViewResult? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } var _3: String? _3 = parseString(reader) let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.WebViewResult.webViewResultUrl(flags: _1!, queryId: _2, url: _3!) + return Api.WebViewResult.webViewResultUrl(Cons_webViewResultUrl(flags: _1!, queryId: _2, url: _3!)) } else { return nil } } - } } public extension Api.account { enum AuthorizationForm: TypeConstructorDescription { - case authorizationForm(flags: Int32, requiredTypes: [Api.SecureRequiredType], values: [Api.SecureValue], errors: [Api.SecureValueError], users: [Api.User], privacyPolicyUrl: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .authorizationForm(let flags, let requiredTypes, let values, let errors, let users, let privacyPolicyUrl): - if boxed { - buffer.appendInt32(-1389486888) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(requiredTypes.count)) - for item in requiredTypes { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(values.count)) - for item in values { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(errors.count)) - for item in errors { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(privacyPolicyUrl!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .authorizationForm(let flags, let requiredTypes, let values, let errors, let users, let privacyPolicyUrl): - return ("authorizationForm", [("flags", flags as Any), ("requiredTypes", requiredTypes as Any), ("values", values as Any), ("errors", errors as Any), ("users", users as Any), ("privacyPolicyUrl", privacyPolicyUrl as Any)]) - } - } - + public class Cons_authorizationForm { + public var flags: Int32 + public var requiredTypes: [Api.SecureRequiredType] + public var values: [Api.SecureValue] + public var errors: [Api.SecureValueError] + public var users: [Api.User] + public var privacyPolicyUrl: String? + public init(flags: Int32, requiredTypes: [Api.SecureRequiredType], values: [Api.SecureValue], errors: [Api.SecureValueError], users: [Api.User], privacyPolicyUrl: String?) { + self.flags = flags + self.requiredTypes = requiredTypes + self.values = values + self.errors = errors + self.users = users + self.privacyPolicyUrl = privacyPolicyUrl + } + } + case authorizationForm(Cons_authorizationForm) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .authorizationForm(let _data): + if boxed { + buffer.appendInt32(-1389486888) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.requiredTypes.count)) + for item in _data.requiredTypes { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.values.count)) + for item in _data.values { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.errors.count)) + for item in _data.errors { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.privacyPolicyUrl!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .authorizationForm(let _data): + return ("authorizationForm", [("flags", _data.flags as Any), ("requiredTypes", _data.requiredTypes as Any), ("values", _data.values as Any), ("errors", _data.errors as Any), ("users", _data.users as Any), ("privacyPolicyUrl", _data.privacyPolicyUrl as Any)]) + } + } + public static func parse_authorizationForm(_ reader: BufferReader) -> AuthorizationForm? { var _1: Int32? _1 = reader.readInt32() @@ -339,7 +442,9 @@ public extension Api.account { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -347,42 +452,49 @@ public extension Api.account { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.AuthorizationForm.authorizationForm(flags: _1!, requiredTypes: _2!, values: _3!, errors: _4!, users: _5!, privacyPolicyUrl: _6) + return Api.account.AuthorizationForm.authorizationForm(Cons_authorizationForm(flags: _1!, requiredTypes: _2!, values: _3!, errors: _4!, users: _5!, privacyPolicyUrl: _6)) } else { return nil } } - } } public extension Api.account { enum Authorizations: TypeConstructorDescription { - case authorizations(authorizationTtlDays: Int32, authorizations: [Api.Authorization]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .authorizations(let authorizationTtlDays, let authorizations): - if boxed { - buffer.appendInt32(1275039392) - } - serializeInt32(authorizationTtlDays, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(authorizations.count)) - for item in authorizations { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .authorizations(let authorizationTtlDays, let authorizations): - return ("authorizations", [("authorizationTtlDays", authorizationTtlDays as Any), ("authorizations", authorizations as Any)]) - } - } - + public class Cons_authorizations { + public var authorizationTtlDays: Int32 + public var authorizations: [Api.Authorization] + public init(authorizationTtlDays: Int32, authorizations: [Api.Authorization]) { + self.authorizationTtlDays = authorizationTtlDays + self.authorizations = authorizations + } + } + case authorizations(Cons_authorizations) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .authorizations(let _data): + if boxed { + buffer.appendInt32(1275039392) + } + serializeInt32(_data.authorizationTtlDays, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.authorizations.count)) + for item in _data.authorizations { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .authorizations(let _data): + return ("authorizations", [("authorizationTtlDays", _data.authorizationTtlDays as Any), ("authorizations", _data.authorizations as Any)]) + } + } + public static func parse_authorizations(_ reader: BufferReader) -> Authorizations? { var _1: Int32? _1 = reader.readInt32() @@ -393,39 +505,48 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.Authorizations.authorizations(authorizationTtlDays: _1!, authorizations: _2!) + return Api.account.Authorizations.authorizations(Cons_authorizations(authorizationTtlDays: _1!, authorizations: _2!)) } else { return nil } } - } } public extension Api.account { enum AutoDownloadSettings: TypeConstructorDescription { - case autoDownloadSettings(low: Api.AutoDownloadSettings, medium: Api.AutoDownloadSettings, high: Api.AutoDownloadSettings) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .autoDownloadSettings(let low, let medium, let high): - if boxed { - buffer.appendInt32(1674235686) - } - low.serialize(buffer, true) - medium.serialize(buffer, true) - high.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .autoDownloadSettings(let low, let medium, let high): - return ("autoDownloadSettings", [("low", low as Any), ("medium", medium as Any), ("high", high as Any)]) - } - } - + public class Cons_autoDownloadSettings { + public var low: Api.AutoDownloadSettings + public var medium: Api.AutoDownloadSettings + public var high: Api.AutoDownloadSettings + public init(low: Api.AutoDownloadSettings, medium: Api.AutoDownloadSettings, high: Api.AutoDownloadSettings) { + self.low = low + self.medium = medium + self.high = high + } + } + case autoDownloadSettings(Cons_autoDownloadSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .autoDownloadSettings(let _data): + if boxed { + buffer.appendInt32(1674235686) + } + _data.low.serialize(buffer, true) + _data.medium.serialize(buffer, true) + _data.high.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .autoDownloadSettings(let _data): + return ("autoDownloadSettings", [("low", _data.low as Any), ("medium", _data.medium as Any), ("high", _data.high as Any)]) + } + } + public static func parse_autoDownloadSettings(_ reader: BufferReader) -> AutoDownloadSettings? { var _1: Api.AutoDownloadSettings? if let signature = reader.readInt32() { @@ -443,54 +564,69 @@ public extension Api.account { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.account.AutoDownloadSettings.autoDownloadSettings(low: _1!, medium: _2!, high: _3!) + return Api.account.AutoDownloadSettings.autoDownloadSettings(Cons_autoDownloadSettings(low: _1!, medium: _2!, high: _3!)) } else { return nil } } - } } public extension Api.account { enum AutoSaveSettings: TypeConstructorDescription { - case autoSaveSettings(usersSettings: Api.AutoSaveSettings, chatsSettings: Api.AutoSaveSettings, broadcastsSettings: Api.AutoSaveSettings, exceptions: [Api.AutoSaveException], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .autoSaveSettings(let usersSettings, let chatsSettings, let broadcastsSettings, let exceptions, let chats, let users): - if boxed { - buffer.appendInt32(1279133341) - } - usersSettings.serialize(buffer, true) - chatsSettings.serialize(buffer, true) - broadcastsSettings.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(exceptions.count)) - for item in exceptions { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .autoSaveSettings(let usersSettings, let chatsSettings, let broadcastsSettings, let exceptions, let chats, let users): - return ("autoSaveSettings", [("usersSettings", usersSettings as Any), ("chatsSettings", chatsSettings as Any), ("broadcastsSettings", broadcastsSettings as Any), ("exceptions", exceptions as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_autoSaveSettings { + public var usersSettings: Api.AutoSaveSettings + public var chatsSettings: Api.AutoSaveSettings + public var broadcastsSettings: Api.AutoSaveSettings + public var exceptions: [Api.AutoSaveException] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(usersSettings: Api.AutoSaveSettings, chatsSettings: Api.AutoSaveSettings, broadcastsSettings: Api.AutoSaveSettings, exceptions: [Api.AutoSaveException], chats: [Api.Chat], users: [Api.User]) { + self.usersSettings = usersSettings + self.chatsSettings = chatsSettings + self.broadcastsSettings = broadcastsSettings + self.exceptions = exceptions + self.chats = chats + self.users = users + } + } + case autoSaveSettings(Cons_autoSaveSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .autoSaveSettings(let _data): + if boxed { + buffer.appendInt32(1279133341) + } + _data.usersSettings.serialize(buffer, true) + _data.chatsSettings.serialize(buffer, true) + _data.broadcastsSettings.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.exceptions.count)) + for item in _data.exceptions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .autoSaveSettings(let _data): + return ("autoSaveSettings", [("usersSettings", _data.usersSettings as Any), ("chatsSettings", _data.chatsSettings as Any), ("broadcastsSettings", _data.broadcastsSettings as Any), ("exceptions", _data.exceptions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_autoSaveSettings(_ reader: BufferReader) -> AutoSaveSettings? { var _1: Api.AutoSaveSettings? if let signature = reader.readInt32() { @@ -523,51 +659,60 @@ public extension Api.account { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.AutoSaveSettings.autoSaveSettings(usersSettings: _1!, chatsSettings: _2!, broadcastsSettings: _3!, exceptions: _4!, chats: _5!, users: _6!) + return Api.account.AutoSaveSettings.autoSaveSettings(Cons_autoSaveSettings(usersSettings: _1!, chatsSettings: _2!, broadcastsSettings: _3!, exceptions: _4!, chats: _5!, users: _6!)) } else { return nil } } - } } public extension Api.account { enum BusinessChatLinks: TypeConstructorDescription { - case businessChatLinks(links: [Api.BusinessChatLink], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessChatLinks(let links, let chats, let users): - if boxed { - buffer.appendInt32(-331111727) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(links.count)) - for item in links { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .businessChatLinks(let links, let chats, let users): - return ("businessChatLinks", [("links", links as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_businessChatLinks { + public var links: [Api.BusinessChatLink] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(links: [Api.BusinessChatLink], chats: [Api.Chat], users: [Api.User]) { + self.links = links + self.chats = chats + self.users = users + } + } + case businessChatLinks(Cons_businessChatLinks) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .businessChatLinks(let _data): + if boxed { + buffer.appendInt32(-331111727) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.links.count)) + for item in _data.links { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .businessChatLinks(let _data): + return ("businessChatLinks", [("links", _data.links as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_businessChatLinks(_ reader: BufferReader) -> BusinessChatLinks? { var _1: [Api.BusinessChatLink]? if let _ = reader.readInt32() { @@ -585,63 +730,79 @@ public extension Api.account { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.account.BusinessChatLinks.businessChatLinks(links: _1!, chats: _2!, users: _3!) + return Api.account.BusinessChatLinks.businessChatLinks(Cons_businessChatLinks(links: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.account { enum ChatThemes: TypeConstructorDescription { - case chatThemes(flags: Int32, hash: Int64, themes: [Api.ChatTheme], chats: [Api.Chat], users: [Api.User], nextOffset: String?) + public class Cons_chatThemes { + public var flags: Int32 + public var hash: Int64 + public var themes: [Api.ChatTheme] + public var chats: [Api.Chat] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, hash: Int64, themes: [Api.ChatTheme], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.hash = hash + self.themes = themes + self.chats = chats + self.users = users + self.nextOffset = nextOffset + } + } + case chatThemes(Cons_chatThemes) case chatThemesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatThemes(let flags, let hash, let themes, let chats, let users, let nextOffset): - if boxed { - buffer.appendInt32(-1106673293) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(themes.count)) - for item in themes { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - case .chatThemesNotModified: - if boxed { - buffer.appendInt32(-535699004) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatThemes(let flags, let hash, let themes, let chats, let users, let nextOffset): - return ("chatThemes", [("flags", flags as Any), ("hash", hash as Any), ("themes", themes as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - case .chatThemesNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatThemes(let _data): + if boxed { + buffer.appendInt32(-1106673293) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.themes.count)) + for item in _data.themes { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + case .chatThemesNotModified: + if boxed { + buffer.appendInt32(-535699004) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatThemes(let _data): + return ("chatThemes", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("themes", _data.themes as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + case .chatThemesNotModified: return ("chatThemesNotModified", []) - } - } - + } + } + public static func parse_chatThemes(_ reader: BufferReader) -> ChatThemes? { var _1: Int32? _1 = reader.readInt32() @@ -660,7 +821,9 @@ public extension Api.account { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -668,7 +831,7 @@ public extension Api.account { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.ChatThemes.chatThemes(flags: _1!, hash: _2!, themes: _3!, chats: _4!, users: _5!, nextOffset: _6) + return Api.account.ChatThemes.chatThemes(Cons_chatThemes(flags: _1!, hash: _2!, themes: _3!, chats: _4!, users: _5!, nextOffset: _6)) } else { return nil @@ -677,40 +840,47 @@ public extension Api.account { public static func parse_chatThemesNotModified(_ reader: BufferReader) -> ChatThemes? { return Api.account.ChatThemes.chatThemesNotModified } - } } public extension Api.account { enum ConnectedBots: TypeConstructorDescription { - case connectedBots(connectedBots: [Api.ConnectedBot], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .connectedBots(let connectedBots, let users): - if boxed { - buffer.appendInt32(400029819) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(connectedBots.count)) - for item in connectedBots { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .connectedBots(let connectedBots, let users): - return ("connectedBots", [("connectedBots", connectedBots as Any), ("users", users as Any)]) - } - } - + public class Cons_connectedBots { + public var connectedBots: [Api.ConnectedBot] + public var users: [Api.User] + public init(connectedBots: [Api.ConnectedBot], users: [Api.User]) { + self.connectedBots = connectedBots + self.users = users + } + } + case connectedBots(Cons_connectedBots) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .connectedBots(let _data): + if boxed { + buffer.appendInt32(400029819) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.connectedBots.count)) + for item in _data.connectedBots { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .connectedBots(let _data): + return ("connectedBots", [("connectedBots", _data.connectedBots as Any), ("users", _data.users as Any)]) + } + } + public static func parse_connectedBots(_ reader: BufferReader) -> ConnectedBots? { var _1: [Api.ConnectedBot]? if let _ = reader.readInt32() { @@ -723,89 +893,107 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.ConnectedBots.connectedBots(connectedBots: _1!, users: _2!) + return Api.account.ConnectedBots.connectedBots(Cons_connectedBots(connectedBots: _1!, users: _2!)) } else { return nil } } - } } public extension Api.account { enum ContentSettings: TypeConstructorDescription { - case contentSettings(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contentSettings(let flags): - if boxed { - buffer.appendInt32(1474462241) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contentSettings(let flags): - return ("contentSettings", [("flags", flags as Any)]) - } - } - + public class Cons_contentSettings { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case contentSettings(Cons_contentSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contentSettings(let _data): + if boxed { + buffer.appendInt32(1474462241) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contentSettings(let _data): + return ("contentSettings", [("flags", _data.flags as Any)]) + } + } + public static func parse_contentSettings(_ reader: BufferReader) -> ContentSettings? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.account.ContentSettings.contentSettings(flags: _1!) + return Api.account.ContentSettings.contentSettings(Cons_contentSettings(flags: _1!)) } else { return nil } } - } } public extension Api.account { enum EmailVerified: TypeConstructorDescription { - case emailVerified(email: String) - case emailVerifiedLogin(email: String, sentCode: Api.auth.SentCode) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emailVerified(let email): - if boxed { - buffer.appendInt32(731303195) - } - serializeString(email, buffer: buffer, boxed: false) - break - case .emailVerifiedLogin(let email, let sentCode): - if boxed { - buffer.appendInt32(-507835039) - } - serializeString(email, buffer: buffer, boxed: false) - sentCode.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emailVerified(let email): - return ("emailVerified", [("email", email as Any)]) - case .emailVerifiedLogin(let email, let sentCode): - return ("emailVerifiedLogin", [("email", email as Any), ("sentCode", sentCode as Any)]) - } - } - + public class Cons_emailVerified { + public var email: String + public init(email: String) { + self.email = email + } + } + public class Cons_emailVerifiedLogin { + public var email: String + public var sentCode: Api.auth.SentCode + public init(email: String, sentCode: Api.auth.SentCode) { + self.email = email + self.sentCode = sentCode + } + } + case emailVerified(Cons_emailVerified) + case emailVerifiedLogin(Cons_emailVerifiedLogin) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emailVerified(let _data): + if boxed { + buffer.appendInt32(731303195) + } + serializeString(_data.email, buffer: buffer, boxed: false) + break + case .emailVerifiedLogin(let _data): + if boxed { + buffer.appendInt32(-507835039) + } + serializeString(_data.email, buffer: buffer, boxed: false) + _data.sentCode.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emailVerified(let _data): + return ("emailVerified", [("email", _data.email as Any)]) + case .emailVerifiedLogin(let _data): + return ("emailVerifiedLogin", [("email", _data.email as Any), ("sentCode", _data.sentCode as Any)]) + } + } + public static func parse_emailVerified(_ reader: BufferReader) -> EmailVerified? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.account.EmailVerified.emailVerified(email: _1!) + return Api.account.EmailVerified.emailVerified(Cons_emailVerified(email: _1!)) } else { return nil @@ -821,51 +1009,57 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.EmailVerified.emailVerifiedLogin(email: _1!, sentCode: _2!) + return Api.account.EmailVerified.emailVerifiedLogin(Cons_emailVerifiedLogin(email: _1!, sentCode: _2!)) } else { return nil } } - } } public extension Api.account { enum EmojiStatuses: TypeConstructorDescription { - case emojiStatuses(hash: Int64, statuses: [Api.EmojiStatus]) + public class Cons_emojiStatuses { + public var hash: Int64 + public var statuses: [Api.EmojiStatus] + public init(hash: Int64, statuses: [Api.EmojiStatus]) { + self.hash = hash + self.statuses = statuses + } + } + case emojiStatuses(Cons_emojiStatuses) case emojiStatusesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiStatuses(let hash, let statuses): - if boxed { - buffer.appendInt32(-1866176559) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(statuses.count)) - for item in statuses { - item.serialize(buffer, true) - } - break - case .emojiStatusesNotModified: - if boxed { - buffer.appendInt32(-796072379) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiStatuses(let hash, let statuses): - return ("emojiStatuses", [("hash", hash as Any), ("statuses", statuses as Any)]) - case .emojiStatusesNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiStatuses(let _data): + if boxed { + buffer.appendInt32(-1866176559) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.statuses.count)) + for item in _data.statuses { + item.serialize(buffer, true) + } + break + case .emojiStatusesNotModified: + if boxed { + buffer.appendInt32(-796072379) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiStatuses(let _data): + return ("emojiStatuses", [("hash", _data.hash as Any), ("statuses", _data.statuses as Any)]) + case .emojiStatusesNotModified: return ("emojiStatusesNotModified", []) - } - } - + } + } + public static func parse_emojiStatuses(_ reader: BufferReader) -> EmojiStatuses? { var _1: Int64? _1 = reader.readInt64() @@ -876,7 +1070,7 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.EmojiStatuses.emojiStatuses(hash: _1!, statuses: _2!) + return Api.account.EmojiStatuses.emojiStatuses(Cons_emojiStatuses(hash: _1!, statuses: _2!)) } else { return nil @@ -885,67 +1079,77 @@ public extension Api.account { public static func parse_emojiStatusesNotModified(_ reader: BufferReader) -> EmojiStatuses? { return Api.account.EmojiStatuses.emojiStatusesNotModified } - } } public extension Api.account { enum PaidMessagesRevenue: TypeConstructorDescription { - case paidMessagesRevenue(starsAmount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paidMessagesRevenue(let starsAmount): - if boxed { - buffer.appendInt32(504403720) - } - serializeInt64(starsAmount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paidMessagesRevenue(let starsAmount): - return ("paidMessagesRevenue", [("starsAmount", starsAmount as Any)]) - } - } - + public class Cons_paidMessagesRevenue { + public var starsAmount: Int64 + public init(starsAmount: Int64) { + self.starsAmount = starsAmount + } + } + case paidMessagesRevenue(Cons_paidMessagesRevenue) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paidMessagesRevenue(let _data): + if boxed { + buffer.appendInt32(504403720) + } + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paidMessagesRevenue(let _data): + return ("paidMessagesRevenue", [("starsAmount", _data.starsAmount as Any)]) + } + } + public static func parse_paidMessagesRevenue(_ reader: BufferReader) -> PaidMessagesRevenue? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.account.PaidMessagesRevenue.paidMessagesRevenue(starsAmount: _1!) + return Api.account.PaidMessagesRevenue.paidMessagesRevenue(Cons_paidMessagesRevenue(starsAmount: _1!)) } else { return nil } } - } } public extension Api.account { enum PasskeyRegistrationOptions: TypeConstructorDescription { - case passkeyRegistrationOptions(options: Api.DataJSON) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passkeyRegistrationOptions(let options): - if boxed { - buffer.appendInt32(-513057567) - } - options.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passkeyRegistrationOptions(let options): - return ("passkeyRegistrationOptions", [("options", options as Any)]) - } - } - + public class Cons_passkeyRegistrationOptions { + public var options: Api.DataJSON + public init(options: Api.DataJSON) { + self.options = options + } + } + case passkeyRegistrationOptions(Cons_passkeyRegistrationOptions) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passkeyRegistrationOptions(let _data): + if boxed { + buffer.appendInt32(-513057567) + } + _data.options.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passkeyRegistrationOptions(let _data): + return ("passkeyRegistrationOptions", [("options", _data.options as Any)]) + } + } + public static func parse_passkeyRegistrationOptions(_ reader: BufferReader) -> PasskeyRegistrationOptions? { var _1: Api.DataJSON? if let signature = reader.readInt32() { @@ -953,41 +1157,46 @@ public extension Api.account { } let _c1 = _1 != nil if _c1 { - return Api.account.PasskeyRegistrationOptions.passkeyRegistrationOptions(options: _1!) + return Api.account.PasskeyRegistrationOptions.passkeyRegistrationOptions(Cons_passkeyRegistrationOptions(options: _1!)) } else { return nil } } - } } public extension Api.account { enum Passkeys: TypeConstructorDescription { - case passkeys(passkeys: [Api.Passkey]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passkeys(let passkeys): - if boxed { - buffer.appendInt32(-119494116) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(passkeys.count)) - for item in passkeys { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passkeys(let passkeys): - return ("passkeys", [("passkeys", passkeys as Any)]) - } - } - + public class Cons_passkeys { + public var passkeys: [Api.Passkey] + public init(passkeys: [Api.Passkey]) { + self.passkeys = passkeys + } + } + case passkeys(Cons_passkeys) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passkeys(let _data): + if boxed { + buffer.appendInt32(-119494116) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.passkeys.count)) + for item in _data.passkeys { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passkeys(let _data): + return ("passkeys", [("passkeys", _data.passkeys as Any)]) + } + } + public static func parse_passkeys(_ reader: BufferReader) -> Passkeys? { var _1: [Api.Passkey]? if let _ = reader.readInt32() { @@ -995,62 +1204,111 @@ public extension Api.account { } let _c1 = _1 != nil if _c1 { - return Api.account.Passkeys.passkeys(passkeys: _1!) + return Api.account.Passkeys.passkeys(Cons_passkeys(passkeys: _1!)) } else { return nil } } - } } public extension Api.account { enum Password: TypeConstructorDescription { - case password(flags: Int32, currentAlgo: Api.PasswordKdfAlgo?, srpB: Buffer?, srpId: Int64?, hint: String?, emailUnconfirmedPattern: String?, newAlgo: Api.PasswordKdfAlgo, newSecureAlgo: Api.SecurePasswordKdfAlgo, secureRandom: Buffer, pendingResetDate: Int32?, loginEmailPattern: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .password(let flags, let currentAlgo, let srpB, let srpId, let hint, let emailUnconfirmedPattern, let newAlgo, let newSecureAlgo, let secureRandom, let pendingResetDate, let loginEmailPattern): - if boxed { - buffer.appendInt32(-1787080453) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {currentAlgo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeBytes(srpB!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(srpId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(hint!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(emailUnconfirmedPattern!, buffer: buffer, boxed: false)} - newAlgo.serialize(buffer, true) - newSecureAlgo.serialize(buffer, true) - serializeBytes(secureRandom, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(pendingResetDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {serializeString(loginEmailPattern!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .password(let flags, let currentAlgo, let srpB, let srpId, let hint, let emailUnconfirmedPattern, let newAlgo, let newSecureAlgo, let secureRandom, let pendingResetDate, let loginEmailPattern): - return ("password", [("flags", flags as Any), ("currentAlgo", currentAlgo as Any), ("srpB", srpB as Any), ("srpId", srpId as Any), ("hint", hint as Any), ("emailUnconfirmedPattern", emailUnconfirmedPattern as Any), ("newAlgo", newAlgo as Any), ("newSecureAlgo", newSecureAlgo as Any), ("secureRandom", secureRandom as Any), ("pendingResetDate", pendingResetDate as Any), ("loginEmailPattern", loginEmailPattern as Any)]) - } - } - + public class Cons_password { + public var flags: Int32 + public var currentAlgo: Api.PasswordKdfAlgo? + public var srpB: Buffer? + public var srpId: Int64? + public var hint: String? + public var emailUnconfirmedPattern: String? + public var newAlgo: Api.PasswordKdfAlgo + public var newSecureAlgo: Api.SecurePasswordKdfAlgo + public var secureRandom: Buffer + public var pendingResetDate: Int32? + public var loginEmailPattern: String? + public init(flags: Int32, currentAlgo: Api.PasswordKdfAlgo?, srpB: Buffer?, srpId: Int64?, hint: String?, emailUnconfirmedPattern: String?, newAlgo: Api.PasswordKdfAlgo, newSecureAlgo: Api.SecurePasswordKdfAlgo, secureRandom: Buffer, pendingResetDate: Int32?, loginEmailPattern: String?) { + self.flags = flags + self.currentAlgo = currentAlgo + self.srpB = srpB + self.srpId = srpId + self.hint = hint + self.emailUnconfirmedPattern = emailUnconfirmedPattern + self.newAlgo = newAlgo + self.newSecureAlgo = newSecureAlgo + self.secureRandom = secureRandom + self.pendingResetDate = pendingResetDate + self.loginEmailPattern = loginEmailPattern + } + } + case password(Cons_password) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .password(let _data): + if boxed { + buffer.appendInt32(-1787080453) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.currentAlgo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeBytes(_data.srpB!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.srpId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.hint!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.emailUnconfirmedPattern!, buffer: buffer, boxed: false) + } + _data.newAlgo.serialize(buffer, true) + _data.newSecureAlgo.serialize(buffer, true) + serializeBytes(_data.secureRandom, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.pendingResetDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.loginEmailPattern!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .password(let _data): + return ("password", [("flags", _data.flags as Any), ("currentAlgo", _data.currentAlgo as Any), ("srpB", _data.srpB as Any), ("srpId", _data.srpId as Any), ("hint", _data.hint as Any), ("emailUnconfirmedPattern", _data.emailUnconfirmedPattern as Any), ("newAlgo", _data.newAlgo as Any), ("newSecureAlgo", _data.newSecureAlgo as Any), ("secureRandom", _data.secureRandom as Any), ("pendingResetDate", _data.pendingResetDate as Any), ("loginEmailPattern", _data.loginEmailPattern as Any)]) + } + } + public static func parse_password(_ reader: BufferReader) -> Password? { var _1: Int32? _1 = reader.readInt32() var _2: Api.PasswordKdfAlgo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo + } + } var _3: Buffer? - if Int(_1!) & Int(1 << 2) != 0 {_3 = parseBytes(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = parseBytes(reader) + } var _4: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt64() + } var _5: String? - if Int(_1!) & Int(1 << 3) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = parseString(reader) + } var _6: String? - if Int(_1!) & Int(1 << 4) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = parseString(reader) + } var _7: Api.PasswordKdfAlgo? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo @@ -1062,9 +1320,13 @@ public extension Api.account { var _9: Buffer? _9 = parseBytes(reader) var _10: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _10 = reader.readInt32() + } var _11: String? - if Int(_1!) & Int(1 << 6) != 0 {_11 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _11 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil @@ -1077,59 +1339,94 @@ public extension Api.account { let _c10 = (Int(_1!) & Int(1 << 5) == 0) || _10 != nil let _c11 = (Int(_1!) & Int(1 << 6) == 0) || _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.account.Password.password(flags: _1!, currentAlgo: _2, srpB: _3, srpId: _4, hint: _5, emailUnconfirmedPattern: _6, newAlgo: _7!, newSecureAlgo: _8!, secureRandom: _9!, pendingResetDate: _10, loginEmailPattern: _11) + return Api.account.Password.password(Cons_password(flags: _1!, currentAlgo: _2, srpB: _3, srpId: _4, hint: _5, emailUnconfirmedPattern: _6, newAlgo: _7!, newSecureAlgo: _8!, secureRandom: _9!, pendingResetDate: _10, loginEmailPattern: _11)) } else { return nil } } - } } public extension Api.account { enum PasswordInputSettings: TypeConstructorDescription { - case passwordInputSettings(flags: Int32, newAlgo: Api.PasswordKdfAlgo?, newPasswordHash: Buffer?, hint: String?, email: String?, newSecureSettings: Api.SecureSecretSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passwordInputSettings(let flags, let newAlgo, let newPasswordHash, let hint, let email, let newSecureSettings): - if boxed { - buffer.appendInt32(-1036572727) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {newAlgo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(newPasswordHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(hint!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(email!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {newSecureSettings!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passwordInputSettings(let flags, let newAlgo, let newPasswordHash, let hint, let email, let newSecureSettings): - return ("passwordInputSettings", [("flags", flags as Any), ("newAlgo", newAlgo as Any), ("newPasswordHash", newPasswordHash as Any), ("hint", hint as Any), ("email", email as Any), ("newSecureSettings", newSecureSettings as Any)]) - } - } - + public class Cons_passwordInputSettings { + public var flags: Int32 + public var newAlgo: Api.PasswordKdfAlgo? + public var newPasswordHash: Buffer? + public var hint: String? + public var email: String? + public var newSecureSettings: Api.SecureSecretSettings? + public init(flags: Int32, newAlgo: Api.PasswordKdfAlgo?, newPasswordHash: Buffer?, hint: String?, email: String?, newSecureSettings: Api.SecureSecretSettings?) { + self.flags = flags + self.newAlgo = newAlgo + self.newPasswordHash = newPasswordHash + self.hint = hint + self.email = email + self.newSecureSettings = newSecureSettings + } + } + case passwordInputSettings(Cons_passwordInputSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passwordInputSettings(let _data): + if boxed { + buffer.appendInt32(-1036572727) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.newAlgo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.newPasswordHash!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.hint!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.email!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.newSecureSettings!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passwordInputSettings(let _data): + return ("passwordInputSettings", [("flags", _data.flags as Any), ("newAlgo", _data.newAlgo as Any), ("newPasswordHash", _data.newPasswordHash as Any), ("hint", _data.hint as Any), ("email", _data.email as Any), ("newSecureSettings", _data.newSecureSettings as Any)]) + } + } + public static func parse_passwordInputSettings(_ reader: BufferReader) -> PasswordInputSettings? { var _1: Int32? _1 = reader.readInt32() var _2: Api.PasswordKdfAlgo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo + } + } var _3: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseBytes(reader) + } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: Api.SecureSecretSettings? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.SecureSecretSettings - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.SecureSecretSettings + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -1137,97 +1434,123 @@ public extension Api.account { let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.PasswordInputSettings.passwordInputSettings(flags: _1!, newAlgo: _2, newPasswordHash: _3, hint: _4, email: _5, newSecureSettings: _6) + return Api.account.PasswordInputSettings.passwordInputSettings(Cons_passwordInputSettings(flags: _1!, newAlgo: _2, newPasswordHash: _3, hint: _4, email: _5, newSecureSettings: _6)) } else { return nil } } - } } public extension Api.account { enum PasswordSettings: TypeConstructorDescription { - case passwordSettings(flags: Int32, email: String?, secureSettings: Api.SecureSecretSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passwordSettings(let flags, let email, let secureSettings): - if boxed { - buffer.appendInt32(-1705233435) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(email!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {secureSettings!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passwordSettings(let flags, let email, let secureSettings): - return ("passwordSettings", [("flags", flags as Any), ("email", email as Any), ("secureSettings", secureSettings as Any)]) - } - } - + public class Cons_passwordSettings { + public var flags: Int32 + public var email: String? + public var secureSettings: Api.SecureSecretSettings? + public init(flags: Int32, email: String?, secureSettings: Api.SecureSecretSettings?) { + self.flags = flags + self.email = email + self.secureSettings = secureSettings + } + } + case passwordSettings(Cons_passwordSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passwordSettings(let _data): + if boxed { + buffer.appendInt32(-1705233435) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.email!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.secureSettings!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passwordSettings(let _data): + return ("passwordSettings", [("flags", _data.flags as Any), ("email", _data.email as Any), ("secureSettings", _data.secureSettings as Any)]) + } + } + public static func parse_passwordSettings(_ reader: BufferReader) -> PasswordSettings? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: Api.SecureSecretSettings? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.SecureSecretSettings - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.SecureSecretSettings + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.account.PasswordSettings.passwordSettings(flags: _1!, email: _2, secureSettings: _3) + return Api.account.PasswordSettings.passwordSettings(Cons_passwordSettings(flags: _1!, email: _2, secureSettings: _3)) } else { return nil } } - } } public extension Api.account { enum PrivacyRules: TypeConstructorDescription { - case privacyRules(rules: [Api.PrivacyRule], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .privacyRules(let rules, let chats, let users): - if boxed { - buffer.appendInt32(1352683077) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rules.count)) - for item in rules { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .privacyRules(let rules, let chats, let users): - return ("privacyRules", [("rules", rules as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_privacyRules { + public var rules: [Api.PrivacyRule] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(rules: [Api.PrivacyRule], chats: [Api.Chat], users: [Api.User]) { + self.rules = rules + self.chats = chats + self.users = users + } + } + case privacyRules(Cons_privacyRules) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .privacyRules(let _data): + if boxed { + buffer.appendInt32(1352683077) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rules.count)) + for item in _data.rules { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .privacyRules(let _data): + return ("privacyRules", [("rules", _data.rules as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_privacyRules(_ reader: BufferReader) -> PrivacyRules? { var _1: [Api.PrivacyRule]? if let _ = reader.readInt32() { @@ -1245,61 +1568,71 @@ public extension Api.account { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.account.PrivacyRules.privacyRules(rules: _1!, chats: _2!, users: _3!) + return Api.account.PrivacyRules.privacyRules(Cons_privacyRules(rules: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.account { enum ResetPasswordResult: TypeConstructorDescription { - case resetPasswordFailedWait(retryDate: Int32) + public class Cons_resetPasswordFailedWait { + public var retryDate: Int32 + public init(retryDate: Int32) { + self.retryDate = retryDate + } + } + public class Cons_resetPasswordRequestedWait { + public var untilDate: Int32 + public init(untilDate: Int32) { + self.untilDate = untilDate + } + } + case resetPasswordFailedWait(Cons_resetPasswordFailedWait) case resetPasswordOk - case resetPasswordRequestedWait(untilDate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .resetPasswordFailedWait(let retryDate): - if boxed { - buffer.appendInt32(-478701471) - } - serializeInt32(retryDate, buffer: buffer, boxed: false) - break - case .resetPasswordOk: - if boxed { - buffer.appendInt32(-383330754) - } - - break - case .resetPasswordRequestedWait(let untilDate): - if boxed { - buffer.appendInt32(-370148227) - } - serializeInt32(untilDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .resetPasswordFailedWait(let retryDate): - return ("resetPasswordFailedWait", [("retryDate", retryDate as Any)]) - case .resetPasswordOk: + case resetPasswordRequestedWait(Cons_resetPasswordRequestedWait) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .resetPasswordFailedWait(let _data): + if boxed { + buffer.appendInt32(-478701471) + } + serializeInt32(_data.retryDate, buffer: buffer, boxed: false) + break + case .resetPasswordOk: + if boxed { + buffer.appendInt32(-383330754) + } + break + case .resetPasswordRequestedWait(let _data): + if boxed { + buffer.appendInt32(-370148227) + } + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .resetPasswordFailedWait(let _data): + return ("resetPasswordFailedWait", [("retryDate", _data.retryDate as Any)]) + case .resetPasswordOk: return ("resetPasswordOk", []) - case .resetPasswordRequestedWait(let untilDate): - return ("resetPasswordRequestedWait", [("untilDate", untilDate as Any)]) - } - } - + case .resetPasswordRequestedWait(let _data): + return ("resetPasswordRequestedWait", [("untilDate", _data.untilDate as Any)]) + } + } + public static func parse_resetPasswordFailedWait(_ reader: BufferReader) -> ResetPasswordResult? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.account.ResetPasswordResult.resetPasswordFailedWait(retryDate: _1!) + return Api.account.ResetPasswordResult.resetPasswordFailedWait(Cons_resetPasswordFailedWait(retryDate: _1!)) } else { return nil @@ -1313,54 +1646,71 @@ public extension Api.account { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.account.ResetPasswordResult.resetPasswordRequestedWait(untilDate: _1!) + return Api.account.ResetPasswordResult.resetPasswordRequestedWait(Cons_resetPasswordRequestedWait(untilDate: _1!)) } else { return nil } } - } } public extension Api.account { enum ResolvedBusinessChatLinks: TypeConstructorDescription { - case resolvedBusinessChatLinks(flags: Int32, peer: Api.Peer, message: String, entities: [Api.MessageEntity]?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .resolvedBusinessChatLinks(let flags, let peer, let message, let entities, let chats, let users): - if boxed { - buffer.appendInt32(-1708937439) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} + public class Cons_resolvedBusinessChatLinks { + public var flags: Int32 + public var peer: Api.Peer + public var message: String + public var entities: [Api.MessageEntity]? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, peer: Api.Peer, message: String, entities: [Api.MessageEntity]?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.peer = peer + self.message = message + self.entities = entities + self.chats = chats + self.users = users + } + } + case resolvedBusinessChatLinks(Cons_resolvedBusinessChatLinks) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .resolvedBusinessChatLinks(let _data): + if boxed { + buffer.appendInt32(-1708937439) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .resolvedBusinessChatLinks(let flags, let peer, let message, let entities, let chats, let users): - return ("resolvedBusinessChatLinks", [("flags", flags as Any), ("peer", peer as Any), ("message", message as Any), ("entities", entities as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .resolvedBusinessChatLinks(let _data): + return ("resolvedBusinessChatLinks", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_resolvedBusinessChatLinks(_ reader: BufferReader) -> ResolvedBusinessChatLinks? { var _1: Int32? _1 = reader.readInt32() @@ -1371,9 +1721,11 @@ public extension Api.account { var _3: String? _3 = parseString(reader) var _4: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _5: [Api.Chat]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -1389,12 +1741,11 @@ public extension Api.account { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.ResolvedBusinessChatLinks.resolvedBusinessChatLinks(flags: _1!, peer: _2!, message: _3!, entities: _4, chats: _5!, users: _6!) + return Api.account.ResolvedBusinessChatLinks.resolvedBusinessChatLinks(Cons_resolvedBusinessChatLinks(flags: _1!, peer: _2!, message: _3!, entities: _4, chats: _5!, users: _6!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api31.swift b/submodules/TelegramApi/Sources/Api31.swift index 0d25527d8c..76a151e474 100644 --- a/submodules/TelegramApi/Sources/Api31.swift +++ b/submodules/TelegramApi/Sources/Api31.swift @@ -1,38 +1,43 @@ public extension Api.account { enum SavedMusicIds: TypeConstructorDescription { - case savedMusicIds(ids: [Int64]) + public class Cons_savedMusicIds { + public var ids: [Int64] + public init(ids: [Int64]) { + self.ids = ids + } + } + case savedMusicIds(Cons_savedMusicIds) case savedMusicIdsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedMusicIds(let ids): - if boxed { - buffer.appendInt32(-1718786506) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ids.count)) - for item in ids { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .savedMusicIdsNotModified: - if boxed { - buffer.appendInt32(1338514798) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedMusicIds(let ids): - return ("savedMusicIds", [("ids", ids as Any)]) - case .savedMusicIdsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedMusicIds(let _data): + if boxed { + buffer.appendInt32(-1718786506) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.ids.count)) + for item in _data.ids { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .savedMusicIdsNotModified: + if boxed { + buffer.appendInt32(1338514798) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedMusicIds(let _data): + return ("savedMusicIds", [("ids", _data.ids as Any)]) + case .savedMusicIdsNotModified: return ("savedMusicIdsNotModified", []) - } - } - + } + } + public static func parse_savedMusicIds(_ reader: BufferReader) -> SavedMusicIds? { var _1: [Int64]? if let _ = reader.readInt32() { @@ -40,7 +45,7 @@ public extension Api.account { } let _c1 = _1 != nil if _c1 { - return Api.account.SavedMusicIds.savedMusicIds(ids: _1!) + return Api.account.SavedMusicIds.savedMusicIds(Cons_savedMusicIds(ids: _1!)) } else { return nil @@ -49,40 +54,44 @@ public extension Api.account { public static func parse_savedMusicIdsNotModified(_ reader: BufferReader) -> SavedMusicIds? { return Api.account.SavedMusicIds.savedMusicIdsNotModified } - } } public extension Api.account { enum SavedRingtone: TypeConstructorDescription { + public class Cons_savedRingtoneConverted { + public var document: Api.Document + public init(document: Api.Document) { + self.document = document + } + } case savedRingtone - case savedRingtoneConverted(document: Api.Document) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedRingtone: - if boxed { - buffer.appendInt32(-1222230163) - } - - break - case .savedRingtoneConverted(let document): - if boxed { - buffer.appendInt32(523271863) - } - document.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedRingtone: + case savedRingtoneConverted(Cons_savedRingtoneConverted) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedRingtone: + if boxed { + buffer.appendInt32(-1222230163) + } + break + case .savedRingtoneConverted(let _data): + if boxed { + buffer.appendInt32(523271863) + } + _data.document.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedRingtone: return ("savedRingtone", []) - case .savedRingtoneConverted(let document): - return ("savedRingtoneConverted", [("document", document as Any)]) - } - } - + case .savedRingtoneConverted(let _data): + return ("savedRingtoneConverted", [("document", _data.document as Any)]) + } + } + public static func parse_savedRingtone(_ reader: BufferReader) -> SavedRingtone? { return Api.account.SavedRingtone.savedRingtone } @@ -93,51 +102,57 @@ public extension Api.account { } let _c1 = _1 != nil if _c1 { - return Api.account.SavedRingtone.savedRingtoneConverted(document: _1!) + return Api.account.SavedRingtone.savedRingtoneConverted(Cons_savedRingtoneConverted(document: _1!)) } else { return nil } } - } } public extension Api.account { enum SavedRingtones: TypeConstructorDescription { - case savedRingtones(hash: Int64, ringtones: [Api.Document]) + public class Cons_savedRingtones { + public var hash: Int64 + public var ringtones: [Api.Document] + public init(hash: Int64, ringtones: [Api.Document]) { + self.hash = hash + self.ringtones = ringtones + } + } + case savedRingtones(Cons_savedRingtones) case savedRingtonesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedRingtones(let hash, let ringtones): - if boxed { - buffer.appendInt32(-1041683259) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ringtones.count)) - for item in ringtones { - item.serialize(buffer, true) - } - break - case .savedRingtonesNotModified: - if boxed { - buffer.appendInt32(-67704655) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedRingtones(let hash, let ringtones): - return ("savedRingtones", [("hash", hash as Any), ("ringtones", ringtones as Any)]) - case .savedRingtonesNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedRingtones(let _data): + if boxed { + buffer.appendInt32(-1041683259) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.ringtones.count)) + for item in _data.ringtones { + item.serialize(buffer, true) + } + break + case .savedRingtonesNotModified: + if boxed { + buffer.appendInt32(-67704655) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedRingtones(let _data): + return ("savedRingtones", [("hash", _data.hash as Any), ("ringtones", _data.ringtones as Any)]) + case .savedRingtonesNotModified: return ("savedRingtonesNotModified", []) - } - } - + } + } + public static func parse_savedRingtones(_ reader: BufferReader) -> SavedRingtones? { var _1: Int64? _1 = reader.readInt64() @@ -148,7 +163,7 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.SavedRingtones.savedRingtones(hash: _1!, ringtones: _2!) + return Api.account.SavedRingtones.savedRingtones(Cons_savedRingtones(hash: _1!, ringtones: _2!)) } else { return nil @@ -157,32 +172,39 @@ public extension Api.account { public static func parse_savedRingtonesNotModified(_ reader: BufferReader) -> SavedRingtones? { return Api.account.SavedRingtones.savedRingtonesNotModified } - } } public extension Api.account { enum SentEmailCode: TypeConstructorDescription { - case sentEmailCode(emailPattern: String, length: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sentEmailCode(let emailPattern, let length): - if boxed { - buffer.appendInt32(-2128640689) - } - serializeString(emailPattern, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sentEmailCode(let emailPattern, let length): - return ("sentEmailCode", [("emailPattern", emailPattern as Any), ("length", length as Any)]) - } - } - + public class Cons_sentEmailCode { + public var emailPattern: String + public var length: Int32 + public init(emailPattern: String, length: Int32) { + self.emailPattern = emailPattern + self.length = length + } + } + case sentEmailCode(Cons_sentEmailCode) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sentEmailCode(let _data): + if boxed { + buffer.appendInt32(-2128640689) + } + serializeString(_data.emailPattern, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sentEmailCode(let _data): + return ("sentEmailCode", [("emailPattern", _data.emailPattern as Any), ("length", _data.length as Any)]) + } + } + public static func parse_sentEmailCode(_ reader: BufferReader) -> SentEmailCode? { var _1: String? _1 = parseString(reader) @@ -191,87 +213,98 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.SentEmailCode.sentEmailCode(emailPattern: _1!, length: _2!) + return Api.account.SentEmailCode.sentEmailCode(Cons_sentEmailCode(emailPattern: _1!, length: _2!)) } else { return nil } } - } } public extension Api.account { enum Takeout: TypeConstructorDescription { - case takeout(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .takeout(let id): - if boxed { - buffer.appendInt32(1304052993) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .takeout(let id): - return ("takeout", [("id", id as Any)]) - } - } - + public class Cons_takeout { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + case takeout(Cons_takeout) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .takeout(let _data): + if boxed { + buffer.appendInt32(1304052993) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .takeout(let _data): + return ("takeout", [("id", _data.id as Any)]) + } + } + public static func parse_takeout(_ reader: BufferReader) -> Takeout? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.account.Takeout.takeout(id: _1!) + return Api.account.Takeout.takeout(Cons_takeout(id: _1!)) } else { return nil } } - } } public extension Api.account { enum Themes: TypeConstructorDescription { - case themes(hash: Int64, themes: [Api.Theme]) + public class Cons_themes { + public var hash: Int64 + public var themes: [Api.Theme] + public init(hash: Int64, themes: [Api.Theme]) { + self.hash = hash + self.themes = themes + } + } + case themes(Cons_themes) case themesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .themes(let hash, let themes): - if boxed { - buffer.appendInt32(-1707242387) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(themes.count)) - for item in themes { - item.serialize(buffer, true) - } - break - case .themesNotModified: - if boxed { - buffer.appendInt32(-199313886) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .themes(let hash, let themes): - return ("themes", [("hash", hash as Any), ("themes", themes as Any)]) - case .themesNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .themes(let _data): + if boxed { + buffer.appendInt32(-1707242387) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.themes.count)) + for item in _data.themes { + item.serialize(buffer, true) + } + break + case .themesNotModified: + if boxed { + buffer.appendInt32(-199313886) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .themes(let _data): + return ("themes", [("hash", _data.hash as Any), ("themes", _data.themes as Any)]) + case .themesNotModified: return ("themesNotModified", []) - } - } - + } + } + public static func parse_themes(_ reader: BufferReader) -> Themes? { var _1: Int64? _1 = reader.readInt64() @@ -282,7 +315,7 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.Themes.themes(hash: _1!, themes: _2!) + return Api.account.Themes.themes(Cons_themes(hash: _1!, themes: _2!)) } else { return nil @@ -291,32 +324,39 @@ public extension Api.account { public static func parse_themesNotModified(_ reader: BufferReader) -> Themes? { return Api.account.Themes.themesNotModified } - } } public extension Api.account { enum TmpPassword: TypeConstructorDescription { - case tmpPassword(tmpPassword: Buffer, validUntil: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .tmpPassword(let tmpPassword, let validUntil): - if boxed { - buffer.appendInt32(-614138572) - } - serializeBytes(tmpPassword, buffer: buffer, boxed: false) - serializeInt32(validUntil, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .tmpPassword(let tmpPassword, let validUntil): - return ("tmpPassword", [("tmpPassword", tmpPassword as Any), ("validUntil", validUntil as Any)]) - } - } - + public class Cons_tmpPassword { + public var tmpPassword: Buffer + public var validUntil: Int32 + public init(tmpPassword: Buffer, validUntil: Int32) { + self.tmpPassword = tmpPassword + self.validUntil = validUntil + } + } + case tmpPassword(Cons_tmpPassword) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .tmpPassword(let _data): + if boxed { + buffer.appendInt32(-614138572) + } + serializeBytes(_data.tmpPassword, buffer: buffer, boxed: false) + serializeInt32(_data.validUntil, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .tmpPassword(let _data): + return ("tmpPassword", [("tmpPassword", _data.tmpPassword as Any), ("validUntil", _data.validUntil as Any)]) + } + } + public static func parse_tmpPassword(_ reader: BufferReader) -> TmpPassword? { var _1: Buffer? _1 = parseBytes(reader) @@ -325,51 +365,57 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.TmpPassword.tmpPassword(tmpPassword: _1!, validUntil: _2!) + return Api.account.TmpPassword.tmpPassword(Cons_tmpPassword(tmpPassword: _1!, validUntil: _2!)) } else { return nil } } - } } public extension Api.account { enum WallPapers: TypeConstructorDescription { - case wallPapers(hash: Int64, wallpapers: [Api.WallPaper]) + public class Cons_wallPapers { + public var hash: Int64 + public var wallpapers: [Api.WallPaper] + public init(hash: Int64, wallpapers: [Api.WallPaper]) { + self.hash = hash + self.wallpapers = wallpapers + } + } + case wallPapers(Cons_wallPapers) case wallPapersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .wallPapers(let hash, let wallpapers): - if boxed { - buffer.appendInt32(-842824308) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(wallpapers.count)) - for item in wallpapers { - item.serialize(buffer, true) - } - break - case .wallPapersNotModified: - if boxed { - buffer.appendInt32(471437699) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .wallPapers(let hash, let wallpapers): - return ("wallPapers", [("hash", hash as Any), ("wallpapers", wallpapers as Any)]) - case .wallPapersNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .wallPapers(let _data): + if boxed { + buffer.appendInt32(-842824308) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.wallpapers.count)) + for item in _data.wallpapers { + item.serialize(buffer, true) + } + break + case .wallPapersNotModified: + if boxed { + buffer.appendInt32(471437699) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .wallPapers(let _data): + return ("wallPapers", [("hash", _data.hash as Any), ("wallpapers", _data.wallpapers as Any)]) + case .wallPapersNotModified: return ("wallPapersNotModified", []) - } - } - + } + } + public static func parse_wallPapers(_ reader: BufferReader) -> WallPapers? { var _1: Int64? _1 = reader.readInt64() @@ -380,7 +426,7 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.WallPapers.wallPapers(hash: _1!, wallpapers: _2!) + return Api.account.WallPapers.wallPapers(Cons_wallPapers(hash: _1!, wallpapers: _2!)) } else { return nil @@ -389,40 +435,47 @@ public extension Api.account { public static func parse_wallPapersNotModified(_ reader: BufferReader) -> WallPapers? { return Api.account.WallPapers.wallPapersNotModified } - } } public extension Api.account { enum WebAuthorizations: TypeConstructorDescription { - case webAuthorizations(authorizations: [Api.WebAuthorization], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webAuthorizations(let authorizations, let users): - if boxed { - buffer.appendInt32(-313079300) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(authorizations.count)) - for item in authorizations { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webAuthorizations(let authorizations, let users): - return ("webAuthorizations", [("authorizations", authorizations as Any), ("users", users as Any)]) - } - } - + public class Cons_webAuthorizations { + public var authorizations: [Api.WebAuthorization] + public var users: [Api.User] + public init(authorizations: [Api.WebAuthorization], users: [Api.User]) { + self.authorizations = authorizations + self.users = users + } + } + case webAuthorizations(Cons_webAuthorizations) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webAuthorizations(let _data): + if boxed { + buffer.appendInt32(-313079300) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.authorizations.count)) + for item in _data.authorizations { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webAuthorizations(let _data): + return ("webAuthorizations", [("authorizations", _data.authorizations as Any), ("users", _data.users as Any)]) + } + } + public static func parse_webAuthorizations(_ reader: BufferReader) -> WebAuthorizations? { var _1: [Api.WebAuthorization]? if let _ = reader.readInt32() { @@ -435,60 +488,95 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.WebAuthorizations.webAuthorizations(authorizations: _1!, users: _2!) + return Api.account.WebAuthorizations.webAuthorizations(Cons_webAuthorizations(authorizations: _1!, users: _2!)) } else { return nil } } - } } public extension Api.auth { enum Authorization: TypeConstructorDescription { - case authorization(flags: Int32, otherwiseReloginDays: Int32?, tmpSessions: Int32?, futureAuthToken: Buffer?, user: Api.User) - case authorizationSignUpRequired(flags: Int32, termsOfService: Api.help.TermsOfService?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .authorization(let flags, let otherwiseReloginDays, let tmpSessions, let futureAuthToken, let user): - if boxed { - buffer.appendInt32(782418132) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(otherwiseReloginDays!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(tmpSessions!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeBytes(futureAuthToken!, buffer: buffer, boxed: false)} - user.serialize(buffer, true) - break - case .authorizationSignUpRequired(let flags, let termsOfService): - if boxed { - buffer.appendInt32(1148485274) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {termsOfService!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .authorization(let flags, let otherwiseReloginDays, let tmpSessions, let futureAuthToken, let user): - return ("authorization", [("flags", flags as Any), ("otherwiseReloginDays", otherwiseReloginDays as Any), ("tmpSessions", tmpSessions as Any), ("futureAuthToken", futureAuthToken as Any), ("user", user as Any)]) - case .authorizationSignUpRequired(let flags, let termsOfService): - return ("authorizationSignUpRequired", [("flags", flags as Any), ("termsOfService", termsOfService as Any)]) - } - } - + public class Cons_authorization { + public var flags: Int32 + public var otherwiseReloginDays: Int32? + public var tmpSessions: Int32? + public var futureAuthToken: Buffer? + public var user: Api.User + public init(flags: Int32, otherwiseReloginDays: Int32?, tmpSessions: Int32?, futureAuthToken: Buffer?, user: Api.User) { + self.flags = flags + self.otherwiseReloginDays = otherwiseReloginDays + self.tmpSessions = tmpSessions + self.futureAuthToken = futureAuthToken + self.user = user + } + } + public class Cons_authorizationSignUpRequired { + public var flags: Int32 + public var termsOfService: Api.help.TermsOfService? + public init(flags: Int32, termsOfService: Api.help.TermsOfService?) { + self.flags = flags + self.termsOfService = termsOfService + } + } + case authorization(Cons_authorization) + case authorizationSignUpRequired(Cons_authorizationSignUpRequired) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .authorization(let _data): + if boxed { + buffer.appendInt32(782418132) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.otherwiseReloginDays!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.tmpSessions!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeBytes(_data.futureAuthToken!, buffer: buffer, boxed: false) + } + _data.user.serialize(buffer, true) + break + case .authorizationSignUpRequired(let _data): + if boxed { + buffer.appendInt32(1148485274) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.termsOfService!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .authorization(let _data): + return ("authorization", [("flags", _data.flags as Any), ("otherwiseReloginDays", _data.otherwiseReloginDays as Any), ("tmpSessions", _data.tmpSessions as Any), ("futureAuthToken", _data.futureAuthToken as Any), ("user", _data.user as Any)]) + case .authorizationSignUpRequired(let _data): + return ("authorizationSignUpRequired", [("flags", _data.flags as Any), ("termsOfService", _data.termsOfService as Any)]) + } + } + public static func parse_authorization(_ reader: BufferReader) -> Authorization? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Buffer? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseBytes(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseBytes(reader) + } var _5: Api.User? if let signature = reader.readInt32() { _5 = Api.parse(reader, signature: signature) as? Api.User @@ -499,7 +587,7 @@ public extension Api.auth { let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.Authorization.authorization(flags: _1!, otherwiseReloginDays: _2, tmpSessions: _3, futureAuthToken: _4, user: _5!) + return Api.auth.Authorization.authorization(Cons_authorization(flags: _1!, otherwiseReloginDays: _2, tmpSessions: _3, futureAuthToken: _4, user: _5!)) } else { return nil @@ -509,19 +597,20 @@ public extension Api.auth { var _1: Int32? _1 = reader.readInt32() var _2: Api.help.TermsOfService? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.help.TermsOfService - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.help.TermsOfService + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.auth.Authorization.authorizationSignUpRequired(flags: _1!, termsOfService: _2) + return Api.auth.Authorization.authorizationSignUpRequired(Cons_authorizationSignUpRequired(flags: _1!, termsOfService: _2)) } else { return nil } } - } } public extension Api.auth { @@ -531,57 +620,52 @@ public extension Api.auth { case codeTypeFragmentSms case codeTypeMissedCall case codeTypeSms - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .codeTypeCall: - if boxed { - buffer.appendInt32(1948046307) - } - - break - case .codeTypeFlashCall: - if boxed { - buffer.appendInt32(577556219) - } - - break - case .codeTypeFragmentSms: - if boxed { - buffer.appendInt32(116234636) - } - - break - case .codeTypeMissedCall: - if boxed { - buffer.appendInt32(-702884114) - } - - break - case .codeTypeSms: - if boxed { - buffer.appendInt32(1923290508) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .codeTypeCall: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .codeTypeCall: + if boxed { + buffer.appendInt32(1948046307) + } + break + case .codeTypeFlashCall: + if boxed { + buffer.appendInt32(577556219) + } + break + case .codeTypeFragmentSms: + if boxed { + buffer.appendInt32(116234636) + } + break + case .codeTypeMissedCall: + if boxed { + buffer.appendInt32(-702884114) + } + break + case .codeTypeSms: + if boxed { + buffer.appendInt32(1923290508) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .codeTypeCall: return ("codeTypeCall", []) - case .codeTypeFlashCall: + case .codeTypeFlashCall: return ("codeTypeFlashCall", []) - case .codeTypeFragmentSms: + case .codeTypeFragmentSms: return ("codeTypeFragmentSms", []) - case .codeTypeMissedCall: + case .codeTypeMissedCall: return ("codeTypeMissedCall", []) - case .codeTypeSms: + case .codeTypeSms: return ("codeTypeSms", []) - } - } - + } + } + public static func parse_codeTypeCall(_ reader: BufferReader) -> CodeType? { return Api.auth.CodeType.codeTypeCall } @@ -597,32 +681,39 @@ public extension Api.auth { public static func parse_codeTypeSms(_ reader: BufferReader) -> CodeType? { return Api.auth.CodeType.codeTypeSms } - } } public extension Api.auth { enum ExportedAuthorization: TypeConstructorDescription { - case exportedAuthorization(id: Int64, bytes: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedAuthorization(let id, let bytes): - if boxed { - buffer.appendInt32(-1271602504) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedAuthorization(let id, let bytes): - return ("exportedAuthorization", [("id", id as Any), ("bytes", bytes as Any)]) - } - } - + public class Cons_exportedAuthorization { + public var id: Int64 + public var bytes: Buffer + public init(id: Int64, bytes: Buffer) { + self.id = id + self.bytes = bytes + } + } + case exportedAuthorization(Cons_exportedAuthorization) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedAuthorization(let _data): + if boxed { + buffer.appendInt32(-1271602504) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedAuthorization(let _data): + return ("exportedAuthorization", [("id", _data.id as Any), ("bytes", _data.bytes as Any)]) + } + } + public static func parse_exportedAuthorization(_ reader: BufferReader) -> ExportedAuthorization? { var _1: Int64? _1 = reader.readInt64() @@ -631,97 +722,129 @@ public extension Api.auth { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.ExportedAuthorization.exportedAuthorization(id: _1!, bytes: _2!) + return Api.auth.ExportedAuthorization.exportedAuthorization(Cons_exportedAuthorization(id: _1!, bytes: _2!)) } else { return nil } } - } } public extension Api.auth { enum LoggedOut: TypeConstructorDescription { - case loggedOut(flags: Int32, futureAuthToken: Buffer?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .loggedOut(let flags, let futureAuthToken): - if boxed { - buffer.appendInt32(-1012759713) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(futureAuthToken!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .loggedOut(let flags, let futureAuthToken): - return ("loggedOut", [("flags", flags as Any), ("futureAuthToken", futureAuthToken as Any)]) - } - } - + public class Cons_loggedOut { + public var flags: Int32 + public var futureAuthToken: Buffer? + public init(flags: Int32, futureAuthToken: Buffer?) { + self.flags = flags + self.futureAuthToken = futureAuthToken + } + } + case loggedOut(Cons_loggedOut) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .loggedOut(let _data): + if boxed { + buffer.appendInt32(-1012759713) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.futureAuthToken!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .loggedOut(let _data): + return ("loggedOut", [("flags", _data.flags as Any), ("futureAuthToken", _data.futureAuthToken as Any)]) + } + } + public static func parse_loggedOut(_ reader: BufferReader) -> LoggedOut? { var _1: Int32? _1 = reader.readInt32() var _2: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseBytes(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.auth.LoggedOut.loggedOut(flags: _1!, futureAuthToken: _2) + return Api.auth.LoggedOut.loggedOut(Cons_loggedOut(flags: _1!, futureAuthToken: _2)) } else { return nil } } - } } public extension Api.auth { enum LoginToken: TypeConstructorDescription { - case loginToken(expires: Int32, token: Buffer) - case loginTokenMigrateTo(dcId: Int32, token: Buffer) - case loginTokenSuccess(authorization: Api.auth.Authorization) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .loginToken(let expires, let token): - if boxed { - buffer.appendInt32(1654593920) - } - serializeInt32(expires, buffer: buffer, boxed: false) - serializeBytes(token, buffer: buffer, boxed: false) - break - case .loginTokenMigrateTo(let dcId, let token): - if boxed { - buffer.appendInt32(110008598) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeBytes(token, buffer: buffer, boxed: false) - break - case .loginTokenSuccess(let authorization): - if boxed { - buffer.appendInt32(957176926) - } - authorization.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .loginToken(let expires, let token): - return ("loginToken", [("expires", expires as Any), ("token", token as Any)]) - case .loginTokenMigrateTo(let dcId, let token): - return ("loginTokenMigrateTo", [("dcId", dcId as Any), ("token", token as Any)]) - case .loginTokenSuccess(let authorization): - return ("loginTokenSuccess", [("authorization", authorization as Any)]) - } - } - + public class Cons_loginToken { + public var expires: Int32 + public var token: Buffer + public init(expires: Int32, token: Buffer) { + self.expires = expires + self.token = token + } + } + public class Cons_loginTokenMigrateTo { + public var dcId: Int32 + public var token: Buffer + public init(dcId: Int32, token: Buffer) { + self.dcId = dcId + self.token = token + } + } + public class Cons_loginTokenSuccess { + public var authorization: Api.auth.Authorization + public init(authorization: Api.auth.Authorization) { + self.authorization = authorization + } + } + case loginToken(Cons_loginToken) + case loginTokenMigrateTo(Cons_loginTokenMigrateTo) + case loginTokenSuccess(Cons_loginTokenSuccess) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .loginToken(let _data): + if boxed { + buffer.appendInt32(1654593920) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + serializeBytes(_data.token, buffer: buffer, boxed: false) + break + case .loginTokenMigrateTo(let _data): + if boxed { + buffer.appendInt32(110008598) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeBytes(_data.token, buffer: buffer, boxed: false) + break + case .loginTokenSuccess(let _data): + if boxed { + buffer.appendInt32(957176926) + } + _data.authorization.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .loginToken(let _data): + return ("loginToken", [("expires", _data.expires as Any), ("token", _data.token as Any)]) + case .loginTokenMigrateTo(let _data): + return ("loginTokenMigrateTo", [("dcId", _data.dcId as Any), ("token", _data.token as Any)]) + case .loginTokenSuccess(let _data): + return ("loginTokenSuccess", [("authorization", _data.authorization as Any)]) + } + } + public static func parse_loginToken(_ reader: BufferReader) -> LoginToken? { var _1: Int32? _1 = reader.readInt32() @@ -730,7 +853,7 @@ public extension Api.auth { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.LoginToken.loginToken(expires: _1!, token: _2!) + return Api.auth.LoginToken.loginToken(Cons_loginToken(expires: _1!, token: _2!)) } else { return nil @@ -744,7 +867,7 @@ public extension Api.auth { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.LoginToken.loginTokenMigrateTo(dcId: _1!, token: _2!) + return Api.auth.LoginToken.loginTokenMigrateTo(Cons_loginTokenMigrateTo(dcId: _1!, token: _2!)) } else { return nil @@ -757,37 +880,42 @@ public extension Api.auth { } let _c1 = _1 != nil if _c1 { - return Api.auth.LoginToken.loginTokenSuccess(authorization: _1!) + return Api.auth.LoginToken.loginTokenSuccess(Cons_loginTokenSuccess(authorization: _1!)) } else { return nil } } - } } public extension Api.auth { enum PasskeyLoginOptions: TypeConstructorDescription { - case passkeyLoginOptions(options: Api.DataJSON) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passkeyLoginOptions(let options): - if boxed { - buffer.appendInt32(-503089271) - } - options.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passkeyLoginOptions(let options): - return ("passkeyLoginOptions", [("options", options as Any)]) - } - } - + public class Cons_passkeyLoginOptions { + public var options: Api.DataJSON + public init(options: Api.DataJSON) { + self.options = options + } + } + case passkeyLoginOptions(Cons_passkeyLoginOptions) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passkeyLoginOptions(let _data): + if boxed { + buffer.appendInt32(-503089271) + } + _data.options.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passkeyLoginOptions(let _data): + return ("passkeyLoginOptions", [("options", _data.options as Any)]) + } + } + public static func parse_passkeyLoginOptions(_ reader: BufferReader) -> PasskeyLoginOptions? { var _1: Api.DataJSON? if let signature = reader.readInt32() { @@ -795,100 +923,144 @@ public extension Api.auth { } let _c1 = _1 != nil if _c1 { - return Api.auth.PasskeyLoginOptions.passkeyLoginOptions(options: _1!) + return Api.auth.PasskeyLoginOptions.passkeyLoginOptions(Cons_passkeyLoginOptions(options: _1!)) } else { return nil } } - } } public extension Api.auth { enum PasswordRecovery: TypeConstructorDescription { - case passwordRecovery(emailPattern: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passwordRecovery(let emailPattern): - if boxed { - buffer.appendInt32(326715557) - } - serializeString(emailPattern, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passwordRecovery(let emailPattern): - return ("passwordRecovery", [("emailPattern", emailPattern as Any)]) - } - } - + public class Cons_passwordRecovery { + public var emailPattern: String + public init(emailPattern: String) { + self.emailPattern = emailPattern + } + } + case passwordRecovery(Cons_passwordRecovery) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passwordRecovery(let _data): + if boxed { + buffer.appendInt32(326715557) + } + serializeString(_data.emailPattern, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passwordRecovery(let _data): + return ("passwordRecovery", [("emailPattern", _data.emailPattern as Any)]) + } + } + public static func parse_passwordRecovery(_ reader: BufferReader) -> PasswordRecovery? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.auth.PasswordRecovery.passwordRecovery(emailPattern: _1!) + return Api.auth.PasswordRecovery.passwordRecovery(Cons_passwordRecovery(emailPattern: _1!)) } else { return nil } } - } } public extension Api.auth { enum SentCode: TypeConstructorDescription { - case sentCode(flags: Int32, type: Api.auth.SentCodeType, phoneCodeHash: String, nextType: Api.auth.CodeType?, timeout: Int32?) - case sentCodePaymentRequired(storeProduct: String, phoneCodeHash: String, supportEmailAddress: String, supportEmailSubject: String, currency: String, amount: Int64) - case sentCodeSuccess(authorization: Api.auth.Authorization) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sentCode(let flags, let type, let phoneCodeHash, let nextType, let timeout): - if boxed { - buffer.appendInt32(1577067778) - } - serializeInt32(flags, buffer: buffer, boxed: false) - type.serialize(buffer, true) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {nextType!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(timeout!, buffer: buffer, boxed: false)} - break - case .sentCodePaymentRequired(let storeProduct, let phoneCodeHash, let supportEmailAddress, let supportEmailSubject, let currency, let amount): - if boxed { - buffer.appendInt32(-527082948) - } - serializeString(storeProduct, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(supportEmailAddress, buffer: buffer, boxed: false) - serializeString(supportEmailSubject, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - break - case .sentCodeSuccess(let authorization): - if boxed { - buffer.appendInt32(596704836) - } - authorization.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sentCode(let flags, let type, let phoneCodeHash, let nextType, let timeout): - return ("sentCode", [("flags", flags as Any), ("type", type as Any), ("phoneCodeHash", phoneCodeHash as Any), ("nextType", nextType as Any), ("timeout", timeout as Any)]) - case .sentCodePaymentRequired(let storeProduct, let phoneCodeHash, let supportEmailAddress, let supportEmailSubject, let currency, let amount): - return ("sentCodePaymentRequired", [("storeProduct", storeProduct as Any), ("phoneCodeHash", phoneCodeHash as Any), ("supportEmailAddress", supportEmailAddress as Any), ("supportEmailSubject", supportEmailSubject as Any), ("currency", currency as Any), ("amount", amount as Any)]) - case .sentCodeSuccess(let authorization): - return ("sentCodeSuccess", [("authorization", authorization as Any)]) - } - } - + public class Cons_sentCode { + public var flags: Int32 + public var type: Api.auth.SentCodeType + public var phoneCodeHash: String + public var nextType: Api.auth.CodeType? + public var timeout: Int32? + public init(flags: Int32, type: Api.auth.SentCodeType, phoneCodeHash: String, nextType: Api.auth.CodeType?, timeout: Int32?) { + self.flags = flags + self.type = type + self.phoneCodeHash = phoneCodeHash + self.nextType = nextType + self.timeout = timeout + } + } + public class Cons_sentCodePaymentRequired { + public var storeProduct: String + public var phoneCodeHash: String + public var supportEmailAddress: String + public var supportEmailSubject: String + public var currency: String + public var amount: Int64 + public init(storeProduct: String, phoneCodeHash: String, supportEmailAddress: String, supportEmailSubject: String, currency: String, amount: Int64) { + self.storeProduct = storeProduct + self.phoneCodeHash = phoneCodeHash + self.supportEmailAddress = supportEmailAddress + self.supportEmailSubject = supportEmailSubject + self.currency = currency + self.amount = amount + } + } + public class Cons_sentCodeSuccess { + public var authorization: Api.auth.Authorization + public init(authorization: Api.auth.Authorization) { + self.authorization = authorization + } + } + case sentCode(Cons_sentCode) + case sentCodePaymentRequired(Cons_sentCodePaymentRequired) + case sentCodeSuccess(Cons_sentCodeSuccess) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sentCode(let _data): + if boxed { + buffer.appendInt32(1577067778) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.type.serialize(buffer, true) + serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.nextType!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.timeout!, buffer: buffer, boxed: false) + } + break + case .sentCodePaymentRequired(let _data): + if boxed { + buffer.appendInt32(-527082948) + } + serializeString(_data.storeProduct, buffer: buffer, boxed: false) + serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) + serializeString(_data.supportEmailAddress, buffer: buffer, boxed: false) + serializeString(_data.supportEmailSubject, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + break + case .sentCodeSuccess(let _data): + if boxed { + buffer.appendInt32(596704836) + } + _data.authorization.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sentCode(let _data): + return ("sentCode", [("flags", _data.flags as Any), ("type", _data.type as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("nextType", _data.nextType as Any), ("timeout", _data.timeout as Any)]) + case .sentCodePaymentRequired(let _data): + return ("sentCodePaymentRequired", [("storeProduct", _data.storeProduct as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("supportEmailAddress", _data.supportEmailAddress as Any), ("supportEmailSubject", _data.supportEmailSubject as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + case .sentCodeSuccess(let _data): + return ("sentCodeSuccess", [("authorization", _data.authorization as Any)]) + } + } + public static func parse_sentCode(_ reader: BufferReader) -> SentCode? { var _1: Int32? _1 = reader.readInt32() @@ -899,18 +1071,22 @@ public extension Api.auth { var _3: String? _3 = parseString(reader) var _4: Api.auth.CodeType? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.auth.CodeType - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.auth.CodeType + } + } var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.SentCode.sentCode(flags: _1!, type: _2!, phoneCodeHash: _3!, nextType: _4, timeout: _5) + return Api.auth.SentCode.sentCode(Cons_sentCode(flags: _1!, type: _2!, phoneCodeHash: _3!, nextType: _4, timeout: _5)) } else { return nil @@ -936,7 +1112,7 @@ public extension Api.auth { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.auth.SentCode.sentCodePaymentRequired(storeProduct: _1!, phoneCodeHash: _2!, supportEmailAddress: _3!, supportEmailSubject: _4!, currency: _5!, amount: _6!) + return Api.auth.SentCode.sentCodePaymentRequired(Cons_sentCodePaymentRequired(storeProduct: _1!, phoneCodeHash: _2!, supportEmailAddress: _3!, supportEmailSubject: _4!, currency: _5!, amount: _6!)) } else { return nil @@ -949,147 +1125,258 @@ public extension Api.auth { } let _c1 = _1 != nil if _c1 { - return Api.auth.SentCode.sentCodeSuccess(authorization: _1!) + return Api.auth.SentCode.sentCodeSuccess(Cons_sentCodeSuccess(authorization: _1!)) } else { return nil } } - } } public extension Api.auth { enum SentCodeType: TypeConstructorDescription { - case sentCodeTypeApp(length: Int32) - case sentCodeTypeCall(length: Int32) - case sentCodeTypeEmailCode(flags: Int32, emailPattern: String, length: Int32, resetAvailablePeriod: Int32?, resetPendingDate: Int32?) - case sentCodeTypeFirebaseSms(flags: Int32, nonce: Buffer?, playIntegrityProjectId: Int64?, playIntegrityNonce: Buffer?, receipt: String?, pushTimeout: Int32?, length: Int32) - case sentCodeTypeFlashCall(pattern: String) - case sentCodeTypeFragmentSms(url: String, length: Int32) - case sentCodeTypeMissedCall(prefix: String, length: Int32) - case sentCodeTypeSetUpEmailRequired(flags: Int32) - case sentCodeTypeSms(length: Int32) - case sentCodeTypeSmsPhrase(flags: Int32, beginning: String?) - case sentCodeTypeSmsWord(flags: Int32, beginning: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sentCodeTypeApp(let length): - if boxed { - buffer.appendInt32(1035688326) - } - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeCall(let length): - if boxed { - buffer.appendInt32(1398007207) - } - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeEmailCode(let flags, let emailPattern, let length, let resetAvailablePeriod, let resetPendingDate): - if boxed { - buffer.appendInt32(-196020837) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(emailPattern, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(resetAvailablePeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(resetPendingDate!, buffer: buffer, boxed: false)} - break - case .sentCodeTypeFirebaseSms(let flags, let nonce, let playIntegrityProjectId, let playIntegrityNonce, let receipt, let pushTimeout, let length): - if boxed { - buffer.appendInt32(10475318) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(nonce!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(playIntegrityProjectId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeBytes(playIntegrityNonce!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(receipt!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(pushTimeout!, buffer: buffer, boxed: false)} - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeFlashCall(let pattern): - if boxed { - buffer.appendInt32(-1425815847) - } - serializeString(pattern, buffer: buffer, boxed: false) - break - case .sentCodeTypeFragmentSms(let url, let length): - if boxed { - buffer.appendInt32(-648651719) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeMissedCall(let prefix, let length): - if boxed { - buffer.appendInt32(-2113903484) - } - serializeString(prefix, buffer: buffer, boxed: false) - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeSetUpEmailRequired(let flags): - if boxed { - buffer.appendInt32(-1521934870) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .sentCodeTypeSms(let length): - if boxed { - buffer.appendInt32(-1073693790) - } - serializeInt32(length, buffer: buffer, boxed: false) - break - case .sentCodeTypeSmsPhrase(let flags, let beginning): - if boxed { - buffer.appendInt32(-1284008785) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(beginning!, buffer: buffer, boxed: false)} - break - case .sentCodeTypeSmsWord(let flags, let beginning): - if boxed { - buffer.appendInt32(-1542017919) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(beginning!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sentCodeTypeApp(let length): - return ("sentCodeTypeApp", [("length", length as Any)]) - case .sentCodeTypeCall(let length): - return ("sentCodeTypeCall", [("length", length as Any)]) - case .sentCodeTypeEmailCode(let flags, let emailPattern, let length, let resetAvailablePeriod, let resetPendingDate): - return ("sentCodeTypeEmailCode", [("flags", flags as Any), ("emailPattern", emailPattern as Any), ("length", length as Any), ("resetAvailablePeriod", resetAvailablePeriod as Any), ("resetPendingDate", resetPendingDate as Any)]) - case .sentCodeTypeFirebaseSms(let flags, let nonce, let playIntegrityProjectId, let playIntegrityNonce, let receipt, let pushTimeout, let length): - return ("sentCodeTypeFirebaseSms", [("flags", flags as Any), ("nonce", nonce as Any), ("playIntegrityProjectId", playIntegrityProjectId as Any), ("playIntegrityNonce", playIntegrityNonce as Any), ("receipt", receipt as Any), ("pushTimeout", pushTimeout as Any), ("length", length as Any)]) - case .sentCodeTypeFlashCall(let pattern): - return ("sentCodeTypeFlashCall", [("pattern", pattern as Any)]) - case .sentCodeTypeFragmentSms(let url, let length): - return ("sentCodeTypeFragmentSms", [("url", url as Any), ("length", length as Any)]) - case .sentCodeTypeMissedCall(let prefix, let length): - return ("sentCodeTypeMissedCall", [("prefix", prefix as Any), ("length", length as Any)]) - case .sentCodeTypeSetUpEmailRequired(let flags): - return ("sentCodeTypeSetUpEmailRequired", [("flags", flags as Any)]) - case .sentCodeTypeSms(let length): - return ("sentCodeTypeSms", [("length", length as Any)]) - case .sentCodeTypeSmsPhrase(let flags, let beginning): - return ("sentCodeTypeSmsPhrase", [("flags", flags as Any), ("beginning", beginning as Any)]) - case .sentCodeTypeSmsWord(let flags, let beginning): - return ("sentCodeTypeSmsWord", [("flags", flags as Any), ("beginning", beginning as Any)]) - } - } - + public class Cons_sentCodeTypeApp { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + } + public class Cons_sentCodeTypeCall { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + } + public class Cons_sentCodeTypeEmailCode { + public var flags: Int32 + public var emailPattern: String + public var length: Int32 + public var resetAvailablePeriod: Int32? + public var resetPendingDate: Int32? + public init(flags: Int32, emailPattern: String, length: Int32, resetAvailablePeriod: Int32?, resetPendingDate: Int32?) { + self.flags = flags + self.emailPattern = emailPattern + self.length = length + self.resetAvailablePeriod = resetAvailablePeriod + self.resetPendingDate = resetPendingDate + } + } + public class Cons_sentCodeTypeFirebaseSms { + public var flags: Int32 + public var nonce: Buffer? + public var playIntegrityProjectId: Int64? + public var playIntegrityNonce: Buffer? + public var receipt: String? + public var pushTimeout: Int32? + public var length: Int32 + public init(flags: Int32, nonce: Buffer?, playIntegrityProjectId: Int64?, playIntegrityNonce: Buffer?, receipt: String?, pushTimeout: Int32?, length: Int32) { + self.flags = flags + self.nonce = nonce + self.playIntegrityProjectId = playIntegrityProjectId + self.playIntegrityNonce = playIntegrityNonce + self.receipt = receipt + self.pushTimeout = pushTimeout + self.length = length + } + } + public class Cons_sentCodeTypeFlashCall { + public var pattern: String + public init(pattern: String) { + self.pattern = pattern + } + } + public class Cons_sentCodeTypeFragmentSms { + public var url: String + public var length: Int32 + public init(url: String, length: Int32) { + self.url = url + self.length = length + } + } + public class Cons_sentCodeTypeMissedCall { + public var prefix: String + public var length: Int32 + public init(prefix: String, length: Int32) { + self.prefix = prefix + self.length = length + } + } + public class Cons_sentCodeTypeSetUpEmailRequired { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_sentCodeTypeSms { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + } + public class Cons_sentCodeTypeSmsPhrase { + public var flags: Int32 + public var beginning: String? + public init(flags: Int32, beginning: String?) { + self.flags = flags + self.beginning = beginning + } + } + public class Cons_sentCodeTypeSmsWord { + public var flags: Int32 + public var beginning: String? + public init(flags: Int32, beginning: String?) { + self.flags = flags + self.beginning = beginning + } + } + case sentCodeTypeApp(Cons_sentCodeTypeApp) + case sentCodeTypeCall(Cons_sentCodeTypeCall) + case sentCodeTypeEmailCode(Cons_sentCodeTypeEmailCode) + case sentCodeTypeFirebaseSms(Cons_sentCodeTypeFirebaseSms) + case sentCodeTypeFlashCall(Cons_sentCodeTypeFlashCall) + case sentCodeTypeFragmentSms(Cons_sentCodeTypeFragmentSms) + case sentCodeTypeMissedCall(Cons_sentCodeTypeMissedCall) + case sentCodeTypeSetUpEmailRequired(Cons_sentCodeTypeSetUpEmailRequired) + case sentCodeTypeSms(Cons_sentCodeTypeSms) + case sentCodeTypeSmsPhrase(Cons_sentCodeTypeSmsPhrase) + case sentCodeTypeSmsWord(Cons_sentCodeTypeSmsWord) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sentCodeTypeApp(let _data): + if boxed { + buffer.appendInt32(1035688326) + } + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeCall(let _data): + if boxed { + buffer.appendInt32(1398007207) + } + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeEmailCode(let _data): + if boxed { + buffer.appendInt32(-196020837) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.emailPattern, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.resetAvailablePeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.resetPendingDate!, buffer: buffer, boxed: false) + } + break + case .sentCodeTypeFirebaseSms(let _data): + if boxed { + buffer.appendInt32(10475318) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeBytes(_data.nonce!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.playIntegrityProjectId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeBytes(_data.playIntegrityNonce!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.receipt!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.pushTimeout!, buffer: buffer, boxed: false) + } + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeFlashCall(let _data): + if boxed { + buffer.appendInt32(-1425815847) + } + serializeString(_data.pattern, buffer: buffer, boxed: false) + break + case .sentCodeTypeFragmentSms(let _data): + if boxed { + buffer.appendInt32(-648651719) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeMissedCall(let _data): + if boxed { + buffer.appendInt32(-2113903484) + } + serializeString(_data.prefix, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeSetUpEmailRequired(let _data): + if boxed { + buffer.appendInt32(-1521934870) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .sentCodeTypeSms(let _data): + if boxed { + buffer.appendInt32(-1073693790) + } + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .sentCodeTypeSmsPhrase(let _data): + if boxed { + buffer.appendInt32(-1284008785) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.beginning!, buffer: buffer, boxed: false) + } + break + case .sentCodeTypeSmsWord(let _data): + if boxed { + buffer.appendInt32(-1542017919) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.beginning!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sentCodeTypeApp(let _data): + return ("sentCodeTypeApp", [("length", _data.length as Any)]) + case .sentCodeTypeCall(let _data): + return ("sentCodeTypeCall", [("length", _data.length as Any)]) + case .sentCodeTypeEmailCode(let _data): + return ("sentCodeTypeEmailCode", [("flags", _data.flags as Any), ("emailPattern", _data.emailPattern as Any), ("length", _data.length as Any), ("resetAvailablePeriod", _data.resetAvailablePeriod as Any), ("resetPendingDate", _data.resetPendingDate as Any)]) + case .sentCodeTypeFirebaseSms(let _data): + return ("sentCodeTypeFirebaseSms", [("flags", _data.flags as Any), ("nonce", _data.nonce as Any), ("playIntegrityProjectId", _data.playIntegrityProjectId as Any), ("playIntegrityNonce", _data.playIntegrityNonce as Any), ("receipt", _data.receipt as Any), ("pushTimeout", _data.pushTimeout as Any), ("length", _data.length as Any)]) + case .sentCodeTypeFlashCall(let _data): + return ("sentCodeTypeFlashCall", [("pattern", _data.pattern as Any)]) + case .sentCodeTypeFragmentSms(let _data): + return ("sentCodeTypeFragmentSms", [("url", _data.url as Any), ("length", _data.length as Any)]) + case .sentCodeTypeMissedCall(let _data): + return ("sentCodeTypeMissedCall", [("prefix", _data.prefix as Any), ("length", _data.length as Any)]) + case .sentCodeTypeSetUpEmailRequired(let _data): + return ("sentCodeTypeSetUpEmailRequired", [("flags", _data.flags as Any)]) + case .sentCodeTypeSms(let _data): + return ("sentCodeTypeSms", [("length", _data.length as Any)]) + case .sentCodeTypeSmsPhrase(let _data): + return ("sentCodeTypeSmsPhrase", [("flags", _data.flags as Any), ("beginning", _data.beginning as Any)]) + case .sentCodeTypeSmsWord(let _data): + return ("sentCodeTypeSmsWord", [("flags", _data.flags as Any), ("beginning", _data.beginning as Any)]) + } + } + public static func parse_sentCodeTypeApp(_ reader: BufferReader) -> SentCodeType? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.auth.SentCodeType.sentCodeTypeApp(length: _1!) + return Api.auth.SentCodeType.sentCodeTypeApp(Cons_sentCodeTypeApp(length: _1!)) } else { return nil @@ -1100,7 +1387,7 @@ public extension Api.auth { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.auth.SentCodeType.sentCodeTypeCall(length: _1!) + return Api.auth.SentCodeType.sentCodeTypeCall(Cons_sentCodeTypeCall(length: _1!)) } else { return nil @@ -1114,16 +1401,20 @@ public extension Api.auth { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.SentCodeType.sentCodeTypeEmailCode(flags: _1!, emailPattern: _2!, length: _3!, resetAvailablePeriod: _4, resetPendingDate: _5) + return Api.auth.SentCodeType.sentCodeTypeEmailCode(Cons_sentCodeTypeEmailCode(flags: _1!, emailPattern: _2!, length: _3!, resetAvailablePeriod: _4, resetPendingDate: _5)) } else { return nil @@ -1133,15 +1424,25 @@ public extension Api.auth { var _1: Int32? _1 = reader.readInt32() var _2: Buffer? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseBytes(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseBytes(reader) + } var _3: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = reader.readInt64() + } var _4: Buffer? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseBytes(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseBytes(reader) + } var _5: String? - if Int(_1!) & Int(1 << 1) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } var _7: Int32? _7 = reader.readInt32() let _c1 = _1 != nil @@ -1152,7 +1453,7 @@ public extension Api.auth { let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.auth.SentCodeType.sentCodeTypeFirebaseSms(flags: _1!, nonce: _2, playIntegrityProjectId: _3, playIntegrityNonce: _4, receipt: _5, pushTimeout: _6, length: _7!) + return Api.auth.SentCodeType.sentCodeTypeFirebaseSms(Cons_sentCodeTypeFirebaseSms(flags: _1!, nonce: _2, playIntegrityProjectId: _3, playIntegrityNonce: _4, receipt: _5, pushTimeout: _6, length: _7!)) } else { return nil @@ -1163,7 +1464,7 @@ public extension Api.auth { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.auth.SentCodeType.sentCodeTypeFlashCall(pattern: _1!) + return Api.auth.SentCodeType.sentCodeTypeFlashCall(Cons_sentCodeTypeFlashCall(pattern: _1!)) } else { return nil @@ -1177,7 +1478,7 @@ public extension Api.auth { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeFragmentSms(url: _1!, length: _2!) + return Api.auth.SentCodeType.sentCodeTypeFragmentSms(Cons_sentCodeTypeFragmentSms(url: _1!, length: _2!)) } else { return nil @@ -1191,7 +1492,7 @@ public extension Api.auth { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeMissedCall(prefix: _1!, length: _2!) + return Api.auth.SentCodeType.sentCodeTypeMissedCall(Cons_sentCodeTypeMissedCall(prefix: _1!, length: _2!)) } else { return nil @@ -1202,7 +1503,7 @@ public extension Api.auth { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.auth.SentCodeType.sentCodeTypeSetUpEmailRequired(flags: _1!) + return Api.auth.SentCodeType.sentCodeTypeSetUpEmailRequired(Cons_sentCodeTypeSetUpEmailRequired(flags: _1!)) } else { return nil @@ -1213,7 +1514,7 @@ public extension Api.auth { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.auth.SentCodeType.sentCodeTypeSms(length: _1!) + return Api.auth.SentCodeType.sentCodeTypeSms(Cons_sentCodeTypeSms(length: _1!)) } else { return nil @@ -1223,11 +1524,13 @@ public extension Api.auth { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeSmsPhrase(flags: _1!, beginning: _2) + return Api.auth.SentCodeType.sentCodeTypeSmsPhrase(Cons_sentCodeTypeSmsPhrase(flags: _1!, beginning: _2)) } else { return nil @@ -1237,16 +1540,17 @@ public extension Api.auth { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeSmsWord(flags: _1!, beginning: _2) + return Api.auth.SentCodeType.sentCodeTypeSmsWord(Cons_sentCodeTypeSmsWord(flags: _1!, beginning: _2)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api32.swift b/submodules/TelegramApi/Sources/Api32.swift index b35e39041e..c066d8edae 100644 --- a/submodules/TelegramApi/Sources/Api32.swift +++ b/submodules/TelegramApi/Sources/Api32.swift @@ -1,27 +1,37 @@ public extension Api.bots { enum BotInfo: TypeConstructorDescription { - case botInfo(name: String, about: String, description: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botInfo(let name, let about, let description): - if boxed { - buffer.appendInt32(-391678544) - } - serializeString(name, buffer: buffer, boxed: false) - serializeString(about, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botInfo(let name, let about, let description): - return ("botInfo", [("name", name as Any), ("about", about as Any), ("description", description as Any)]) - } - } - + public class Cons_botInfo { + public var name: String + public var about: String + public var description: String + public init(name: String, about: String, description: String) { + self.name = name + self.about = about + self.description = description + } + } + case botInfo(Cons_botInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botInfo(let _data): + if boxed { + buffer.appendInt32(-391678544) + } + serializeString(_data.name, buffer: buffer, boxed: false) + serializeString(_data.about, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botInfo(let _data): + return ("botInfo", [("name", _data.name as Any), ("about", _data.about as Any), ("description", _data.description as Any)]) + } + } + public static func parse_botInfo(_ reader: BufferReader) -> BotInfo? { var _1: String? _1 = parseString(reader) @@ -33,48 +43,61 @@ public extension Api.bots { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.bots.BotInfo.botInfo(name: _1!, about: _2!, description: _3!) + return Api.bots.BotInfo.botInfo(Cons_botInfo(name: _1!, about: _2!, description: _3!)) } else { return nil } } - } } public extension Api.bots { enum PopularAppBots: TypeConstructorDescription { - case popularAppBots(flags: Int32, nextOffset: String?, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .popularAppBots(let flags, let nextOffset, let users): - if boxed { - buffer.appendInt32(428978491) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .popularAppBots(let flags, let nextOffset, let users): - return ("popularAppBots", [("flags", flags as Any), ("nextOffset", nextOffset as Any), ("users", users as Any)]) - } - } - + public class Cons_popularAppBots { + public var flags: Int32 + public var nextOffset: String? + public var users: [Api.User] + public init(flags: Int32, nextOffset: String?, users: [Api.User]) { + self.flags = flags + self.nextOffset = nextOffset + self.users = users + } + } + case popularAppBots(Cons_popularAppBots) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .popularAppBots(let _data): + if boxed { + buffer.appendInt32(428978491) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .popularAppBots(let _data): + return ("popularAppBots", [("flags", _data.flags as Any), ("nextOffset", _data.nextOffset as Any), ("users", _data.users as Any)]) + } + } + public static func parse_popularAppBots(_ reader: BufferReader) -> PopularAppBots? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: [Api.User]? if let _ = reader.readInt32() { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) @@ -83,46 +106,53 @@ public extension Api.bots { let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.bots.PopularAppBots.popularAppBots(flags: _1!, nextOffset: _2, users: _3!) + return Api.bots.PopularAppBots.popularAppBots(Cons_popularAppBots(flags: _1!, nextOffset: _2, users: _3!)) } else { return nil } } - } } public extension Api.bots { enum PreviewInfo: TypeConstructorDescription { - case previewInfo(media: [Api.BotPreviewMedia], langCodes: [String]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .previewInfo(let media, let langCodes): - if boxed { - buffer.appendInt32(212278628) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(media.count)) - for item in media { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(langCodes.count)) - for item in langCodes { - serializeString(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .previewInfo(let media, let langCodes): - return ("previewInfo", [("media", media as Any), ("langCodes", langCodes as Any)]) - } - } - + public class Cons_previewInfo { + public var media: [Api.BotPreviewMedia] + public var langCodes: [String] + public init(media: [Api.BotPreviewMedia], langCodes: [String]) { + self.media = media + self.langCodes = langCodes + } + } + case previewInfo(Cons_previewInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .previewInfo(let _data): + if boxed { + buffer.appendInt32(212278628) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.media.count)) + for item in _data.media { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.langCodes.count)) + for item in _data.langCodes { + serializeString(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .previewInfo(let _data): + return ("previewInfo", [("media", _data.media as Any), ("langCodes", _data.langCodes as Any)]) + } + } + public static func parse_previewInfo(_ reader: BufferReader) -> PreviewInfo? { var _1: [Api.BotPreviewMedia]? if let _ = reader.readInt32() { @@ -135,51 +165,60 @@ public extension Api.bots { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.bots.PreviewInfo.previewInfo(media: _1!, langCodes: _2!) + return Api.bots.PreviewInfo.previewInfo(Cons_previewInfo(media: _1!, langCodes: _2!)) } else { return nil } } - } } public extension Api.channels { enum AdminLogResults: TypeConstructorDescription { - case adminLogResults(events: [Api.ChannelAdminLogEvent], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .adminLogResults(let events, let chats, let users): - if boxed { - buffer.appendInt32(-309659827) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(events.count)) - for item in events { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .adminLogResults(let events, let chats, let users): - return ("adminLogResults", [("events", events as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_adminLogResults { + public var events: [Api.ChannelAdminLogEvent] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(events: [Api.ChannelAdminLogEvent], chats: [Api.Chat], users: [Api.User]) { + self.events = events + self.chats = chats + self.users = users + } + } + case adminLogResults(Cons_adminLogResults) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .adminLogResults(let _data): + if boxed { + buffer.appendInt32(-309659827) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.events.count)) + for item in _data.events { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .adminLogResults(let _data): + return ("adminLogResults", [("events", _data.events as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_adminLogResults(_ reader: BufferReader) -> AdminLogResults? { var _1: [Api.ChannelAdminLogEvent]? if let _ = reader.readInt32() { @@ -197,47 +236,56 @@ public extension Api.channels { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.channels.AdminLogResults.adminLogResults(events: _1!, chats: _2!, users: _3!) + return Api.channels.AdminLogResults.adminLogResults(Cons_adminLogResults(events: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.channels { enum ChannelParticipant: TypeConstructorDescription { - case channelParticipant(participant: Api.ChannelParticipant, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelParticipant(let participant, let chats, let users): - if boxed { - buffer.appendInt32(-541588713) - } - participant.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelParticipant(let participant, let chats, let users): - return ("channelParticipant", [("participant", participant as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_channelParticipant { + public var participant: Api.ChannelParticipant + public var chats: [Api.Chat] + public var users: [Api.User] + public init(participant: Api.ChannelParticipant, chats: [Api.Chat], users: [Api.User]) { + self.participant = participant + self.chats = chats + self.users = users + } + } + case channelParticipant(Cons_channelParticipant) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelParticipant(let _data): + if boxed { + buffer.appendInt32(-541588713) + } + _data.participant.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelParticipant(let _data): + return ("channelParticipant", [("participant", _data.participant as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { var _1: Api.ChannelParticipant? if let signature = reader.readInt32() { @@ -255,61 +303,71 @@ public extension Api.channels { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.channels.ChannelParticipant.channelParticipant(participant: _1!, chats: _2!, users: _3!) + return Api.channels.ChannelParticipant.channelParticipant(Cons_channelParticipant(participant: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.channels { enum ChannelParticipants: TypeConstructorDescription { - case channelParticipants(count: Int32, participants: [Api.ChannelParticipant], chats: [Api.Chat], users: [Api.User]) + public class Cons_channelParticipants { + public var count: Int32 + public var participants: [Api.ChannelParticipant] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(count: Int32, participants: [Api.ChannelParticipant], chats: [Api.Chat], users: [Api.User]) { + self.count = count + self.participants = participants + self.chats = chats + self.users = users + } + } + case channelParticipants(Cons_channelParticipants) case channelParticipantsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelParticipants(let count, let participants, let chats, let users): - if boxed { - buffer.appendInt32(-1699676497) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants.count)) - for item in participants { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .channelParticipantsNotModified: - if boxed { - buffer.appendInt32(-266911767) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelParticipants(let count, let participants, let chats, let users): - return ("channelParticipants", [("count", count as Any), ("participants", participants as Any), ("chats", chats as Any), ("users", users as Any)]) - case .channelParticipantsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelParticipants(let _data): + if boxed { + buffer.appendInt32(-1699676497) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .channelParticipantsNotModified: + if boxed { + buffer.appendInt32(-266911767) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelParticipants(let _data): + return ("channelParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .channelParticipantsNotModified: return ("channelParticipantsNotModified", []) - } - } - + } + } + public static func parse_channelParticipants(_ reader: BufferReader) -> ChannelParticipants? { var _1: Int32? _1 = reader.readInt32() @@ -330,7 +388,7 @@ public extension Api.channels { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.channels.ChannelParticipants.channelParticipants(count: _1!, participants: _2!, chats: _3!, users: _4!) + return Api.channels.ChannelParticipants.channelParticipants(Cons_channelParticipants(count: _1!, participants: _2!, chats: _3!, users: _4!)) } else { return nil @@ -339,45 +397,54 @@ public extension Api.channels { public static func parse_channelParticipantsNotModified(_ reader: BufferReader) -> ChannelParticipants? { return Api.channels.ChannelParticipants.channelParticipantsNotModified } - } } public extension Api.channels { enum SendAsPeers: TypeConstructorDescription { - case sendAsPeers(peers: [Api.SendAsPeer], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sendAsPeers(let peers, let chats, let users): - if boxed { - buffer.appendInt32(-191450938) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sendAsPeers(let peers, let chats, let users): - return ("sendAsPeers", [("peers", peers as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_sendAsPeers { + public var peers: [Api.SendAsPeer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(peers: [Api.SendAsPeer], chats: [Api.Chat], users: [Api.User]) { + self.peers = peers + self.chats = chats + self.users = users + } + } + case sendAsPeers(Cons_sendAsPeers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sendAsPeers(let _data): + if boxed { + buffer.appendInt32(-191450938) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sendAsPeers(let _data): + return ("sendAsPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_sendAsPeers(_ reader: BufferReader) -> SendAsPeers? { var _1: [Api.SendAsPeer]? if let _ = reader.readInt32() { @@ -395,60 +462,65 @@ public extension Api.channels { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.channels.SendAsPeers.sendAsPeers(peers: _1!, chats: _2!, users: _3!) + return Api.channels.SendAsPeers.sendAsPeers(Cons_sendAsPeers(peers: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.channels { enum SponsoredMessageReportResult: TypeConstructorDescription { + public class Cons_sponsoredMessageReportResultChooseOption { + public var title: String + public var options: [Api.SponsoredMessageReportOption] + public init(title: String, options: [Api.SponsoredMessageReportOption]) { + self.title = title + self.options = options + } + } case sponsoredMessageReportResultAdsHidden - case sponsoredMessageReportResultChooseOption(title: String, options: [Api.SponsoredMessageReportOption]) + case sponsoredMessageReportResultChooseOption(Cons_sponsoredMessageReportResultChooseOption) case sponsoredMessageReportResultReported - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredMessageReportResultAdsHidden: - if boxed { - buffer.appendInt32(1044107055) - } - - break - case .sponsoredMessageReportResultChooseOption(let title, let options): - if boxed { - buffer.appendInt32(-2073059774) - } - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(options.count)) - for item in options { - item.serialize(buffer, true) - } - break - case .sponsoredMessageReportResultReported: - if boxed { - buffer.appendInt32(-1384544183) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredMessageReportResultAdsHidden: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredMessageReportResultAdsHidden: + if boxed { + buffer.appendInt32(1044107055) + } + break + case .sponsoredMessageReportResultChooseOption(let _data): + if boxed { + buffer.appendInt32(-2073059774) + } + serializeString(_data.title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.options.count)) + for item in _data.options { + item.serialize(buffer, true) + } + break + case .sponsoredMessageReportResultReported: + if boxed { + buffer.appendInt32(-1384544183) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredMessageReportResultAdsHidden: return ("sponsoredMessageReportResultAdsHidden", []) - case .sponsoredMessageReportResultChooseOption(let title, let options): - return ("sponsoredMessageReportResultChooseOption", [("title", title as Any), ("options", options as Any)]) - case .sponsoredMessageReportResultReported: + case .sponsoredMessageReportResultChooseOption(let _data): + return ("sponsoredMessageReportResultChooseOption", [("title", _data.title as Any), ("options", _data.options as Any)]) + case .sponsoredMessageReportResultReported: return ("sponsoredMessageReportResultReported", []) - } - } - + } + } + public static func parse_sponsoredMessageReportResultAdsHidden(_ reader: BufferReader) -> SponsoredMessageReportResult? { return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultAdsHidden } @@ -462,7 +534,7 @@ public extension Api.channels { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultChooseOption(title: _1!, options: _2!) + return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultChooseOption(Cons_sponsoredMessageReportResultChooseOption(title: _1!, options: _2!)) } else { return nil @@ -471,77 +543,108 @@ public extension Api.channels { public static func parse_sponsoredMessageReportResultReported(_ reader: BufferReader) -> SponsoredMessageReportResult? { return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultReported } - } } public extension Api.chatlists { enum ChatlistInvite: TypeConstructorDescription { - case chatlistInvite(flags: Int32, title: Api.TextWithEntities, emoticon: String?, peers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) - case chatlistInviteAlready(filterId: Int32, missingPeers: [Api.Peer], alreadyPeers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatlistInvite(let flags, let title, let emoticon, let peers, let chats, let users): - if boxed { - buffer.appendInt32(-250687953) - } - serializeInt32(flags, buffer: buffer, boxed: false) - title.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(emoticon!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .chatlistInviteAlready(let filterId, let missingPeers, let alreadyPeers, let chats, let users): - if boxed { - buffer.appendInt32(-91752871) - } - serializeInt32(filterId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(missingPeers.count)) - for item in missingPeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(alreadyPeers.count)) - for item in alreadyPeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatlistInvite(let flags, let title, let emoticon, let peers, let chats, let users): - return ("chatlistInvite", [("flags", flags as Any), ("title", title as Any), ("emoticon", emoticon as Any), ("peers", peers as Any), ("chats", chats as Any), ("users", users as Any)]) - case .chatlistInviteAlready(let filterId, let missingPeers, let alreadyPeers, let chats, let users): - return ("chatlistInviteAlready", [("filterId", filterId as Any), ("missingPeers", missingPeers as Any), ("alreadyPeers", alreadyPeers as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_chatlistInvite { + public var flags: Int32 + public var title: Api.TextWithEntities + public var emoticon: String? + public var peers: [Api.Peer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, title: Api.TextWithEntities, emoticon: String?, peers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.title = title + self.emoticon = emoticon + self.peers = peers + self.chats = chats + self.users = users + } + } + public class Cons_chatlistInviteAlready { + public var filterId: Int32 + public var missingPeers: [Api.Peer] + public var alreadyPeers: [Api.Peer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(filterId: Int32, missingPeers: [Api.Peer], alreadyPeers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) { + self.filterId = filterId + self.missingPeers = missingPeers + self.alreadyPeers = alreadyPeers + self.chats = chats + self.users = users + } + } + case chatlistInvite(Cons_chatlistInvite) + case chatlistInviteAlready(Cons_chatlistInviteAlready) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatlistInvite(let _data): + if boxed { + buffer.appendInt32(-250687953) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .chatlistInviteAlready(let _data): + if boxed { + buffer.appendInt32(-91752871) + } + serializeInt32(_data.filterId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.missingPeers.count)) + for item in _data.missingPeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.alreadyPeers.count)) + for item in _data.alreadyPeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatlistInvite(let _data): + return ("chatlistInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .chatlistInviteAlready(let _data): + return ("chatlistInviteAlready", [("filterId", _data.filterId as Any), ("missingPeers", _data.missingPeers as Any), ("alreadyPeers", _data.alreadyPeers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_chatlistInvite(_ reader: BufferReader) -> ChatlistInvite? { var _1: Int32? _1 = reader.readInt32() @@ -550,7 +653,9 @@ public extension Api.chatlists { _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: [Api.Peer]? if let _ = reader.readInt32() { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) @@ -570,7 +675,7 @@ public extension Api.chatlists { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.chatlists.ChatlistInvite.chatlistInvite(flags: _1!, title: _2!, emoticon: _3, peers: _4!, chats: _5!, users: _6!) + return Api.chatlists.ChatlistInvite.chatlistInvite(Cons_chatlistInvite(flags: _1!, title: _2!, emoticon: _3, peers: _4!, chats: _5!, users: _6!)) } else { return nil @@ -601,51 +706,60 @@ public extension Api.chatlists { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.chatlists.ChatlistInvite.chatlistInviteAlready(filterId: _1!, missingPeers: _2!, alreadyPeers: _3!, chats: _4!, users: _5!) + return Api.chatlists.ChatlistInvite.chatlistInviteAlready(Cons_chatlistInviteAlready(filterId: _1!, missingPeers: _2!, alreadyPeers: _3!, chats: _4!, users: _5!)) } else { return nil } } - } } public extension Api.chatlists { enum ChatlistUpdates: TypeConstructorDescription { - case chatlistUpdates(missingPeers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatlistUpdates(let missingPeers, let chats, let users): - if boxed { - buffer.appendInt32(-1816295539) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(missingPeers.count)) - for item in missingPeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatlistUpdates(let missingPeers, let chats, let users): - return ("chatlistUpdates", [("missingPeers", missingPeers as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_chatlistUpdates { + public var missingPeers: [Api.Peer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(missingPeers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) { + self.missingPeers = missingPeers + self.chats = chats + self.users = users + } + } + case chatlistUpdates(Cons_chatlistUpdates) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatlistUpdates(let _data): + if boxed { + buffer.appendInt32(-1816295539) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.missingPeers.count)) + for item in _data.missingPeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatlistUpdates(let _data): + return ("chatlistUpdates", [("missingPeers", _data.missingPeers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_chatlistUpdates(_ reader: BufferReader) -> ChatlistUpdates? { var _1: [Api.Peer]? if let _ = reader.readInt32() { @@ -663,38 +777,45 @@ public extension Api.chatlists { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.chatlists.ChatlistUpdates.chatlistUpdates(missingPeers: _1!, chats: _2!, users: _3!) + return Api.chatlists.ChatlistUpdates.chatlistUpdates(Cons_chatlistUpdates(missingPeers: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.chatlists { enum ExportedChatlistInvite: TypeConstructorDescription { - case exportedChatlistInvite(filter: Api.DialogFilter, invite: Api.ExportedChatlistInvite) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedChatlistInvite(let filter, let invite): - if boxed { - buffer.appendInt32(283567014) - } - filter.serialize(buffer, true) - invite.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedChatlistInvite(let filter, let invite): - return ("exportedChatlistInvite", [("filter", filter as Any), ("invite", invite as Any)]) - } - } - + public class Cons_exportedChatlistInvite { + public var filter: Api.DialogFilter + public var invite: Api.ExportedChatlistInvite + public init(filter: Api.DialogFilter, invite: Api.ExportedChatlistInvite) { + self.filter = filter + self.invite = invite + } + } + case exportedChatlistInvite(Cons_exportedChatlistInvite) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedChatlistInvite(let _data): + if boxed { + buffer.appendInt32(283567014) + } + _data.filter.serialize(buffer, true) + _data.invite.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedChatlistInvite(let _data): + return ("exportedChatlistInvite", [("filter", _data.filter as Any), ("invite", _data.invite as Any)]) + } + } + public static func parse_exportedChatlistInvite(_ reader: BufferReader) -> ExportedChatlistInvite? { var _1: Api.DialogFilter? if let signature = reader.readInt32() { @@ -707,51 +828,60 @@ public extension Api.chatlists { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.chatlists.ExportedChatlistInvite.exportedChatlistInvite(filter: _1!, invite: _2!) + return Api.chatlists.ExportedChatlistInvite.exportedChatlistInvite(Cons_exportedChatlistInvite(filter: _1!, invite: _2!)) } else { return nil } } - } } public extension Api.chatlists { enum ExportedInvites: TypeConstructorDescription { - case exportedInvites(invites: [Api.ExportedChatlistInvite], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedInvites(let invites, let chats, let users): - if boxed { - buffer.appendInt32(279670215) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(invites.count)) - for item in invites { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedInvites(let invites, let chats, let users): - return ("exportedInvites", [("invites", invites as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_exportedInvites { + public var invites: [Api.ExportedChatlistInvite] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(invites: [Api.ExportedChatlistInvite], chats: [Api.Chat], users: [Api.User]) { + self.invites = invites + self.chats = chats + self.users = users + } + } + case exportedInvites(Cons_exportedInvites) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedInvites(let _data): + if boxed { + buffer.appendInt32(279670215) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.invites.count)) + for item in _data.invites { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedInvites(let _data): + return ("exportedInvites", [("invites", _data.invites as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_exportedInvites(_ reader: BufferReader) -> ExportedInvites? { var _1: [Api.ExportedChatlistInvite]? if let _ = reader.readInt32() { @@ -769,75 +899,96 @@ public extension Api.chatlists { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.chatlists.ExportedInvites.exportedInvites(invites: _1!, chats: _2!, users: _3!) + return Api.chatlists.ExportedInvites.exportedInvites(Cons_exportedInvites(invites: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.contacts { enum Blocked: TypeConstructorDescription { - case blocked(blocked: [Api.PeerBlocked], chats: [Api.Chat], users: [Api.User]) - case blockedSlice(count: Int32, blocked: [Api.PeerBlocked], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .blocked(let blocked, let chats, let users): - if boxed { - buffer.appendInt32(182326673) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocked.count)) - for item in blocked { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .blockedSlice(let count, let blocked, let chats, let users): - if boxed { - buffer.appendInt32(-513392236) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(blocked.count)) - for item in blocked { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .blocked(let blocked, let chats, let users): - return ("blocked", [("blocked", blocked as Any), ("chats", chats as Any), ("users", users as Any)]) - case .blockedSlice(let count, let blocked, let chats, let users): - return ("blockedSlice", [("count", count as Any), ("blocked", blocked as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_blocked { + public var blocked: [Api.PeerBlocked] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(blocked: [Api.PeerBlocked], chats: [Api.Chat], users: [Api.User]) { + self.blocked = blocked + self.chats = chats + self.users = users + } + } + public class Cons_blockedSlice { + public var count: Int32 + public var blocked: [Api.PeerBlocked] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(count: Int32, blocked: [Api.PeerBlocked], chats: [Api.Chat], users: [Api.User]) { + self.count = count + self.blocked = blocked + self.chats = chats + self.users = users + } + } + case blocked(Cons_blocked) + case blockedSlice(Cons_blockedSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .blocked(let _data): + if boxed { + buffer.appendInt32(182326673) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocked.count)) + for item in _data.blocked { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .blockedSlice(let _data): + if boxed { + buffer.appendInt32(-513392236) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.blocked.count)) + for item in _data.blocked { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .blocked(let _data): + return ("blocked", [("blocked", _data.blocked as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .blockedSlice(let _data): + return ("blockedSlice", [("count", _data.count as Any), ("blocked", _data.blocked as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_blocked(_ reader: BufferReader) -> Blocked? { var _1: [Api.PeerBlocked]? if let _ = reader.readInt32() { @@ -855,7 +1006,7 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.Blocked.blocked(blocked: _1!, chats: _2!, users: _3!) + return Api.contacts.Blocked.blocked(Cons_blocked(blocked: _1!, chats: _2!, users: _3!)) } else { return nil @@ -881,46 +1032,53 @@ public extension Api.contacts { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.Blocked.blockedSlice(count: _1!, blocked: _2!, chats: _3!, users: _4!) + return Api.contacts.Blocked.blockedSlice(Cons_blockedSlice(count: _1!, blocked: _2!, chats: _3!, users: _4!)) } else { return nil } } - } } public extension Api.contacts { enum ContactBirthdays: TypeConstructorDescription { - case contactBirthdays(contacts: [Api.ContactBirthday], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contactBirthdays(let contacts, let users): - if boxed { - buffer.appendInt32(290452237) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(contacts.count)) - for item in contacts { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contactBirthdays(let contacts, let users): - return ("contactBirthdays", [("contacts", contacts as Any), ("users", users as Any)]) - } - } - + public class Cons_contactBirthdays { + public var contacts: [Api.ContactBirthday] + public var users: [Api.User] + public init(contacts: [Api.ContactBirthday], users: [Api.User]) { + self.contacts = contacts + self.users = users + } + } + case contactBirthdays(Cons_contactBirthdays) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contactBirthdays(let _data): + if boxed { + buffer.appendInt32(290452237) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.contacts.count)) + for item in _data.contacts { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contactBirthdays(let _data): + return ("contactBirthdays", [("contacts", _data.contacts as Any), ("users", _data.users as Any)]) + } + } + public static func parse_contactBirthdays(_ reader: BufferReader) -> ContactBirthdays? { var _1: [Api.ContactBirthday]? if let _ = reader.readInt32() { @@ -933,56 +1091,64 @@ public extension Api.contacts { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.contacts.ContactBirthdays.contactBirthdays(contacts: _1!, users: _2!) + return Api.contacts.ContactBirthdays.contactBirthdays(Cons_contactBirthdays(contacts: _1!, users: _2!)) } else { return nil } } - } } public extension Api.contacts { enum Contacts: TypeConstructorDescription { - case contacts(contacts: [Api.Contact], savedCount: Int32, users: [Api.User]) + public class Cons_contacts { + public var contacts: [Api.Contact] + public var savedCount: Int32 + public var users: [Api.User] + public init(contacts: [Api.Contact], savedCount: Int32, users: [Api.User]) { + self.contacts = contacts + self.savedCount = savedCount + self.users = users + } + } + case contacts(Cons_contacts) case contactsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contacts(let contacts, let savedCount, let users): - if boxed { - buffer.appendInt32(-353862078) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(contacts.count)) - for item in contacts { - item.serialize(buffer, true) - } - serializeInt32(savedCount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .contactsNotModified: - if boxed { - buffer.appendInt32(-1219778094) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contacts(let contacts, let savedCount, let users): - return ("contacts", [("contacts", contacts as Any), ("savedCount", savedCount as Any), ("users", users as Any)]) - case .contactsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contacts(let _data): + if boxed { + buffer.appendInt32(-353862078) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.contacts.count)) + for item in _data.contacts { + item.serialize(buffer, true) + } + serializeInt32(_data.savedCount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .contactsNotModified: + if boxed { + buffer.appendInt32(-1219778094) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contacts(let _data): + return ("contacts", [("contacts", _data.contacts as Any), ("savedCount", _data.savedCount as Any), ("users", _data.users as Any)]) + case .contactsNotModified: return ("contactsNotModified", []) - } - } - + } + } + public static func parse_contacts(_ reader: BufferReader) -> Contacts? { var _1: [Api.Contact]? if let _ = reader.readInt32() { @@ -998,7 +1164,7 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.Contacts.contacts(contacts: _1!, savedCount: _2!, users: _3!) + return Api.contacts.Contacts.contacts(Cons_contacts(contacts: _1!, savedCount: _2!, users: _3!)) } else { return nil @@ -1007,50 +1173,61 @@ public extension Api.contacts { public static func parse_contactsNotModified(_ reader: BufferReader) -> Contacts? { return Api.contacts.Contacts.contactsNotModified } - } } public extension Api.contacts { enum Found: TypeConstructorDescription { - case found(myResults: [Api.Peer], results: [Api.Peer], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .found(let myResults, let results, let chats, let users): - if boxed { - buffer.appendInt32(-1290580579) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(myResults.count)) - for item in myResults { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(results.count)) - for item in results { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .found(let myResults, let results, let chats, let users): - return ("found", [("myResults", myResults as Any), ("results", results as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_found { + public var myResults: [Api.Peer] + public var results: [Api.Peer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(myResults: [Api.Peer], results: [Api.Peer], chats: [Api.Chat], users: [Api.User]) { + self.myResults = myResults + self.results = results + self.chats = chats + self.users = users + } + } + case found(Cons_found) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .found(let _data): + if boxed { + buffer.appendInt32(-1290580579) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.myResults.count)) + for item in _data.myResults { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.results.count)) + for item in _data.results { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .found(let _data): + return ("found", [("myResults", _data.myResults as Any), ("results", _data.results as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_found(_ reader: BufferReader) -> Found? { var _1: [Api.Peer]? if let _ = reader.readInt32() { @@ -1073,56 +1250,67 @@ public extension Api.contacts { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.Found.found(myResults: _1!, results: _2!, chats: _3!, users: _4!) + return Api.contacts.Found.found(Cons_found(myResults: _1!, results: _2!, chats: _3!, users: _4!)) } else { return nil } } - } } public extension Api.contacts { enum ImportedContacts: TypeConstructorDescription { - case importedContacts(imported: [Api.ImportedContact], popularInvites: [Api.PopularContact], retryContacts: [Int64], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .importedContacts(let imported, let popularInvites, let retryContacts, let users): - if boxed { - buffer.appendInt32(2010127419) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(imported.count)) - for item in imported { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(popularInvites.count)) - for item in popularInvites { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(retryContacts.count)) - for item in retryContacts { - serializeInt64(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .importedContacts(let imported, let popularInvites, let retryContacts, let users): - return ("importedContacts", [("imported", imported as Any), ("popularInvites", popularInvites as Any), ("retryContacts", retryContacts as Any), ("users", users as Any)]) - } - } - + public class Cons_importedContacts { + public var imported: [Api.ImportedContact] + public var popularInvites: [Api.PopularContact] + public var retryContacts: [Int64] + public var users: [Api.User] + public init(imported: [Api.ImportedContact], popularInvites: [Api.PopularContact], retryContacts: [Int64], users: [Api.User]) { + self.imported = imported + self.popularInvites = popularInvites + self.retryContacts = retryContacts + self.users = users + } + } + case importedContacts(Cons_importedContacts) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .importedContacts(let _data): + if boxed { + buffer.appendInt32(2010127419) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.imported.count)) + for item in _data.imported { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.popularInvites.count)) + for item in _data.popularInvites { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.retryContacts.count)) + for item in _data.retryContacts { + serializeInt64(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .importedContacts(let _data): + return ("importedContacts", [("imported", _data.imported as Any), ("popularInvites", _data.popularInvites as Any), ("retryContacts", _data.retryContacts as Any), ("users", _data.users as Any)]) + } + } + public static func parse_importedContacts(_ reader: BufferReader) -> ImportedContacts? { var _1: [Api.ImportedContact]? if let _ = reader.readInt32() { @@ -1145,47 +1333,56 @@ public extension Api.contacts { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.ImportedContacts.importedContacts(imported: _1!, popularInvites: _2!, retryContacts: _3!, users: _4!) + return Api.contacts.ImportedContacts.importedContacts(Cons_importedContacts(imported: _1!, popularInvites: _2!, retryContacts: _3!, users: _4!)) } else { return nil } } - } } public extension Api.contacts { enum ResolvedPeer: TypeConstructorDescription { - case resolvedPeer(peer: Api.Peer, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .resolvedPeer(let peer, let chats, let users): - if boxed { - buffer.appendInt32(2131196633) - } - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .resolvedPeer(let peer, let chats, let users): - return ("resolvedPeer", [("peer", peer as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_resolvedPeer { + public var peer: Api.Peer + public var chats: [Api.Chat] + public var users: [Api.User] + public init(peer: Api.Peer, chats: [Api.Chat], users: [Api.User]) { + self.peer = peer + self.chats = chats + self.users = users + } + } + case resolvedPeer(Cons_resolvedPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .resolvedPeer(let _data): + if boxed { + buffer.appendInt32(2131196633) + } + _data.peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .resolvedPeer(let _data): + return ("resolvedPeer", [("peer", _data.peer as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_resolvedPeer(_ reader: BufferReader) -> ResolvedPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -1203,60 +1400,68 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.ResolvedPeer.resolvedPeer(peer: _1!, chats: _2!, users: _3!) + return Api.contacts.ResolvedPeer.resolvedPeer(Cons_resolvedPeer(peer: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.contacts { enum SponsoredPeers: TypeConstructorDescription { - case sponsoredPeers(peers: [Api.SponsoredPeer], chats: [Api.Chat], users: [Api.User]) + public class Cons_sponsoredPeers { + public var peers: [Api.SponsoredPeer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(peers: [Api.SponsoredPeer], chats: [Api.Chat], users: [Api.User]) { + self.peers = peers + self.chats = chats + self.users = users + } + } + case sponsoredPeers(Cons_sponsoredPeers) case sponsoredPeersEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredPeers(let peers, let chats, let users): - if boxed { - buffer.appendInt32(-352114556) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .sponsoredPeersEmpty: - if boxed { - buffer.appendInt32(-365775695) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredPeers(let peers, let chats, let users): - return ("sponsoredPeers", [("peers", peers as Any), ("chats", chats as Any), ("users", users as Any)]) - case .sponsoredPeersEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredPeers(let _data): + if boxed { + buffer.appendInt32(-352114556) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .sponsoredPeersEmpty: + if boxed { + buffer.appendInt32(-365775695) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredPeers(let _data): + return ("sponsoredPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .sponsoredPeersEmpty: return ("sponsoredPeersEmpty", []) - } - } - + } + } + public static func parse_sponsoredPeers(_ reader: BufferReader) -> SponsoredPeers? { var _1: [Api.SponsoredPeer]? if let _ = reader.readInt32() { @@ -1274,7 +1479,7 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.SponsoredPeers.sponsoredPeers(peers: _1!, chats: _2!, users: _3!) + return Api.contacts.SponsoredPeers.sponsoredPeers(Cons_sponsoredPeers(peers: _1!, chats: _2!, users: _3!)) } else { return nil @@ -1283,63 +1488,70 @@ public extension Api.contacts { public static func parse_sponsoredPeersEmpty(_ reader: BufferReader) -> SponsoredPeers? { return Api.contacts.SponsoredPeers.sponsoredPeersEmpty } - } } public extension Api.contacts { enum TopPeers: TypeConstructorDescription { - case topPeers(categories: [Api.TopPeerCategoryPeers], chats: [Api.Chat], users: [Api.User]) + public class Cons_topPeers { + public var categories: [Api.TopPeerCategoryPeers] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(categories: [Api.TopPeerCategoryPeers], chats: [Api.Chat], users: [Api.User]) { + self.categories = categories + self.chats = chats + self.users = users + } + } + case topPeers(Cons_topPeers) case topPeersDisabled case topPeersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .topPeers(let categories, let chats, let users): - if boxed { - buffer.appendInt32(1891070632) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(categories.count)) - for item in categories { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .topPeersDisabled: - if boxed { - buffer.appendInt32(-1255369827) - } - - break - case .topPeersNotModified: - if boxed { - buffer.appendInt32(-567906571) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeers(let categories, let chats, let users): - return ("topPeers", [("categories", categories as Any), ("chats", chats as Any), ("users", users as Any)]) - case .topPeersDisabled: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .topPeers(let _data): + if boxed { + buffer.appendInt32(1891070632) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.categories.count)) + for item in _data.categories { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .topPeersDisabled: + if boxed { + buffer.appendInt32(-1255369827) + } + break + case .topPeersNotModified: + if boxed { + buffer.appendInt32(-567906571) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .topPeers(let _data): + return ("topPeers", [("categories", _data.categories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .topPeersDisabled: return ("topPeersDisabled", []) - case .topPeersNotModified: + case .topPeersNotModified: return ("topPeersNotModified", []) - } - } - + } + } + public static func parse_topPeers(_ reader: BufferReader) -> TopPeers? { var _1: [Api.TopPeerCategoryPeers]? if let _ = reader.readInt32() { @@ -1357,7 +1569,7 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.TopPeers.topPeers(categories: _1!, chats: _2!, users: _3!) + return Api.contacts.TopPeers.topPeers(Cons_topPeers(categories: _1!, chats: _2!, users: _3!)) } else { return nil @@ -1369,36 +1581,51 @@ public extension Api.contacts { public static func parse_topPeersNotModified(_ reader: BufferReader) -> TopPeers? { return Api.contacts.TopPeers.topPeersNotModified } - } } public extension Api.fragment { enum CollectibleInfo: TypeConstructorDescription { - case collectibleInfo(purchaseDate: Int32, currency: String, amount: Int64, cryptoCurrency: String, cryptoAmount: Int64, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .collectibleInfo(let purchaseDate, let currency, let amount, let cryptoCurrency, let cryptoAmount, let url): - if boxed { - buffer.appendInt32(1857945489) - } - serializeInt32(purchaseDate, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(amount, buffer: buffer, boxed: false) - serializeString(cryptoCurrency, buffer: buffer, boxed: false) - serializeInt64(cryptoAmount, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .collectibleInfo(let purchaseDate, let currency, let amount, let cryptoCurrency, let cryptoAmount, let url): - return ("collectibleInfo", [("purchaseDate", purchaseDate as Any), ("currency", currency as Any), ("amount", amount as Any), ("cryptoCurrency", cryptoCurrency as Any), ("cryptoAmount", cryptoAmount as Any), ("url", url as Any)]) - } - } - + public class Cons_collectibleInfo { + public var purchaseDate: Int32 + public var currency: String + public var amount: Int64 + public var cryptoCurrency: String + public var cryptoAmount: Int64 + public var url: String + public init(purchaseDate: Int32, currency: String, amount: Int64, cryptoCurrency: String, cryptoAmount: Int64, url: String) { + self.purchaseDate = purchaseDate + self.currency = currency + self.amount = amount + self.cryptoCurrency = cryptoCurrency + self.cryptoAmount = cryptoAmount + self.url = url + } + } + case collectibleInfo(Cons_collectibleInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .collectibleInfo(let _data): + if boxed { + buffer.appendInt32(1857945489) + } + serializeInt32(_data.purchaseDate, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.amount, buffer: buffer, boxed: false) + serializeString(_data.cryptoCurrency, buffer: buffer, boxed: false) + serializeInt64(_data.cryptoAmount, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .collectibleInfo(let _data): + return ("collectibleInfo", [("purchaseDate", _data.purchaseDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("url", _data.url as Any)]) + } + } + public static func parse_collectibleInfo(_ reader: BufferReader) -> CollectibleInfo? { var _1: Int32? _1 = reader.readInt32() @@ -1419,47 +1646,53 @@ public extension Api.fragment { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.fragment.CollectibleInfo.collectibleInfo(purchaseDate: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, url: _6!) + return Api.fragment.CollectibleInfo.collectibleInfo(Cons_collectibleInfo(purchaseDate: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, url: _6!)) } else { return nil } } - } } public extension Api.help { enum AppConfig: TypeConstructorDescription { - case appConfig(hash: Int32, config: Api.JSONValue) + public class Cons_appConfig { + public var hash: Int32 + public var config: Api.JSONValue + public init(hash: Int32, config: Api.JSONValue) { + self.hash = hash + self.config = config + } + } + case appConfig(Cons_appConfig) case appConfigNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .appConfig(let hash, let config): - if boxed { - buffer.appendInt32(-585598930) - } - serializeInt32(hash, buffer: buffer, boxed: false) - config.serialize(buffer, true) - break - case .appConfigNotModified: - if boxed { - buffer.appendInt32(2094949405) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .appConfig(let hash, let config): - return ("appConfig", [("hash", hash as Any), ("config", config as Any)]) - case .appConfigNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .appConfig(let _data): + if boxed { + buffer.appendInt32(-585598930) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + _data.config.serialize(buffer, true) + break + case .appConfigNotModified: + if boxed { + buffer.appendInt32(2094949405) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .appConfig(let _data): + return ("appConfig", [("hash", _data.hash as Any), ("config", _data.config as Any)]) + case .appConfigNotModified: return ("appConfigNotModified", []) - } - } - + } + } + public static func parse_appConfig(_ reader: BufferReader) -> AppConfig? { var _1: Int32? _1 = reader.readInt32() @@ -1470,7 +1703,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.AppConfig.appConfig(hash: _1!, config: _2!) + return Api.help.AppConfig.appConfig(Cons_appConfig(hash: _1!, config: _2!)) } else { return nil @@ -1479,6 +1712,5 @@ public extension Api.help { public static func parse_appConfigNotModified(_ reader: BufferReader) -> AppConfig? { return Api.help.AppConfig.appConfigNotModified } - } } diff --git a/submodules/TelegramApi/Sources/Api33.swift b/submodules/TelegramApi/Sources/Api33.swift index a9067b18c2..c67b56a544 100644 --- a/submodules/TelegramApi/Sources/Api33.swift +++ b/submodules/TelegramApi/Sources/Api33.swift @@ -1,45 +1,70 @@ public extension Api.help { enum AppUpdate: TypeConstructorDescription { - case appUpdate(flags: Int32, id: Int32, version: String, text: String, entities: [Api.MessageEntity], document: Api.Document?, url: String?, sticker: Api.Document?) + public class Cons_appUpdate { + public var flags: Int32 + public var id: Int32 + public var version: String + public var text: String + public var entities: [Api.MessageEntity] + public var document: Api.Document? + public var url: String? + public var sticker: Api.Document? + public init(flags: Int32, id: Int32, version: String, text: String, entities: [Api.MessageEntity], document: Api.Document?, url: String?, sticker: Api.Document?) { + self.flags = flags + self.id = id + self.version = version + self.text = text + self.entities = entities + self.document = document + self.url = url + self.sticker = sticker + } + } + case appUpdate(Cons_appUpdate) case noAppUpdate - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .appUpdate(let flags, let id, let version, let text, let entities, let document, let url, let sticker): - if boxed { - buffer.appendInt32(-860107216) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeString(version, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 1) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {sticker!.serialize(buffer, true)} - break - case .noAppUpdate: - if boxed { - buffer.appendInt32(-1000708810) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .appUpdate(let flags, let id, let version, let text, let entities, let document, let url, let sticker): - return ("appUpdate", [("flags", flags as Any), ("id", id as Any), ("version", version as Any), ("text", text as Any), ("entities", entities as Any), ("document", document as Any), ("url", url as Any), ("sticker", sticker as Any)]) - case .noAppUpdate: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .appUpdate(let _data): + if boxed { + buffer.appendInt32(-860107216) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeString(_data.version, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities.count)) + for item in _data.entities { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.sticker!.serialize(buffer, true) + } + break + case .noAppUpdate: + if boxed { + buffer.appendInt32(-1000708810) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .appUpdate(let _data): + return ("appUpdate", [("flags", _data.flags as Any), ("id", _data.id as Any), ("version", _data.version as Any), ("text", _data.text as Any), ("entities", _data.entities as Any), ("document", _data.document as Any), ("url", _data.url as Any), ("sticker", _data.sticker as Any)]) + case .noAppUpdate: return ("noAppUpdate", []) - } - } - + } + } + public static func parse_appUpdate(_ reader: BufferReader) -> AppUpdate? { var _1: Int32? _1 = reader.readInt32() @@ -54,15 +79,21 @@ public extension Api.help { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) } var _6: Api.Document? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Document + } + } var _7: String? - if Int(_1!) & Int(1 << 2) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _7 = parseString(reader) + } var _8: Api.Document? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -72,7 +103,7 @@ public extension Api.help { let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 3) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.help.AppUpdate.appUpdate(flags: _1!, id: _2!, version: _3!, text: _4!, entities: _5!, document: _6, url: _7, sticker: _8) + return Api.help.AppUpdate.appUpdate(Cons_appUpdate(flags: _1!, id: _2!, version: _3!, text: _4!, entities: _5!, document: _6, url: _7, sticker: _8)) } else { return nil @@ -81,45 +112,51 @@ public extension Api.help { public static func parse_noAppUpdate(_ reader: BufferReader) -> AppUpdate? { return Api.help.AppUpdate.noAppUpdate } - } } public extension Api.help { enum CountriesList: TypeConstructorDescription { - case countriesList(countries: [Api.help.Country], hash: Int32) + public class Cons_countriesList { + public var countries: [Api.help.Country] + public var hash: Int32 + public init(countries: [Api.help.Country], hash: Int32) { + self.countries = countries + self.hash = hash + } + } + case countriesList(Cons_countriesList) case countriesListNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .countriesList(let countries, let hash): - if boxed { - buffer.appendInt32(-2016381538) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(countries.count)) - for item in countries { - item.serialize(buffer, true) - } - serializeInt32(hash, buffer: buffer, boxed: false) - break - case .countriesListNotModified: - if boxed { - buffer.appendInt32(-1815339214) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .countriesList(let countries, let hash): - return ("countriesList", [("countries", countries as Any), ("hash", hash as Any)]) - case .countriesListNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .countriesList(let _data): + if boxed { + buffer.appendInt32(-2016381538) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countries.count)) + for item in _data.countries { + item.serialize(buffer, true) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + break + case .countriesListNotModified: + if boxed { + buffer.appendInt32(-1815339214) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .countriesList(let _data): + return ("countriesList", [("countries", _data.countries as Any), ("hash", _data.hash as Any)]) + case .countriesListNotModified: return ("countriesListNotModified", []) - } - } - + } + } + public static func parse_countriesList(_ reader: BufferReader) -> CountriesList? { var _1: [Api.help.Country]? if let _ = reader.readInt32() { @@ -130,7 +167,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.CountriesList.countriesList(countries: _1!, hash: _2!) + return Api.help.CountriesList.countriesList(Cons_countriesList(countries: _1!, hash: _2!)) } else { return nil @@ -139,39 +176,54 @@ public extension Api.help { public static func parse_countriesListNotModified(_ reader: BufferReader) -> CountriesList? { return Api.help.CountriesList.countriesListNotModified } - } } public extension Api.help { enum Country: TypeConstructorDescription { - case country(flags: Int32, iso2: String, defaultName: String, name: String?, countryCodes: [Api.help.CountryCode]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .country(let flags, let iso2, let defaultName, let name, let countryCodes): - if boxed { - buffer.appendInt32(-1014526429) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(iso2, buffer: buffer, boxed: false) - serializeString(defaultName, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(name!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(countryCodes.count)) - for item in countryCodes { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .country(let flags, let iso2, let defaultName, let name, let countryCodes): - return ("country", [("flags", flags as Any), ("iso2", iso2 as Any), ("defaultName", defaultName as Any), ("name", name as Any), ("countryCodes", countryCodes as Any)]) - } - } - + public class Cons_country { + public var flags: Int32 + public var iso2: String + public var defaultName: String + public var name: String? + public var countryCodes: [Api.help.CountryCode] + public init(flags: Int32, iso2: String, defaultName: String, name: String?, countryCodes: [Api.help.CountryCode]) { + self.flags = flags + self.iso2 = iso2 + self.defaultName = defaultName + self.name = name + self.countryCodes = countryCodes + } + } + case country(Cons_country) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .country(let _data): + if boxed { + buffer.appendInt32(-1014526429) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.iso2, buffer: buffer, boxed: false) + serializeString(_data.defaultName, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.name!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countryCodes.count)) + for item in _data.countryCodes { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .country(let _data): + return ("country", [("flags", _data.flags as Any), ("iso2", _data.iso2 as Any), ("defaultName", _data.defaultName as Any), ("name", _data.name as Any), ("countryCodes", _data.countryCodes as Any)]) + } + } + public static func parse_country(_ reader: BufferReader) -> Country? { var _1: Int32? _1 = reader.readInt32() @@ -180,7 +232,9 @@ public extension Api.help { var _3: String? _3 = parseString(reader) var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: [Api.help.CountryCode]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.CountryCode.self) @@ -191,126 +245,157 @@ public extension Api.help { let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.help.Country.country(flags: _1!, iso2: _2!, defaultName: _3!, name: _4, countryCodes: _5!) + return Api.help.Country.country(Cons_country(flags: _1!, iso2: _2!, defaultName: _3!, name: _4, countryCodes: _5!)) } else { return nil } } - } } public extension Api.help { enum CountryCode: TypeConstructorDescription { - case countryCode(flags: Int32, countryCode: String, prefixes: [String]?, patterns: [String]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .countryCode(let flags, let countryCode, let prefixes, let patterns): - if boxed { - buffer.appendInt32(1107543535) + public class Cons_countryCode { + public var flags: Int32 + public var countryCode: String + public var prefixes: [String]? + public var patterns: [String]? + public init(flags: Int32, countryCode: String, prefixes: [String]?, patterns: [String]?) { + self.flags = flags + self.countryCode = countryCode + self.prefixes = prefixes + self.patterns = patterns + } + } + case countryCode(Cons_countryCode) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .countryCode(let _data): + if boxed { + buffer.appendInt32(1107543535) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.countryCode, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prefixes!.count)) + for item in _data.prefixes! { + serializeString(item, buffer: buffer, boxed: false) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(countryCode, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prefixes!.count)) - for item in prefixes! { + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.patterns!.count)) + for item in _data.patterns! { serializeString(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(patterns!.count)) - for item in patterns! { - serializeString(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .countryCode(let flags, let countryCode, let prefixes, let patterns): - return ("countryCode", [("flags", flags as Any), ("countryCode", countryCode as Any), ("prefixes", prefixes as Any), ("patterns", patterns as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .countryCode(let _data): + return ("countryCode", [("flags", _data.flags as Any), ("countryCode", _data.countryCode as Any), ("prefixes", _data.prefixes as Any), ("patterns", _data.patterns as Any)]) + } + } + public static func parse_countryCode(_ reader: BufferReader) -> CountryCode? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: [String]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } var _4: [String]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.help.CountryCode.countryCode(flags: _1!, countryCode: _2!, prefixes: _3, patterns: _4) + return Api.help.CountryCode.countryCode(Cons_countryCode(flags: _1!, countryCode: _2!, prefixes: _3, patterns: _4)) } else { return nil } } - } } public extension Api.help { enum DeepLinkInfo: TypeConstructorDescription { - case deepLinkInfo(flags: Int32, message: String, entities: [Api.MessageEntity]?) + public class Cons_deepLinkInfo { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?) { + self.flags = flags + self.message = message + self.entities = entities + } + } + case deepLinkInfo(Cons_deepLinkInfo) case deepLinkInfoEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .deepLinkInfo(let flags, let message, let entities): - if boxed { - buffer.appendInt32(1783556146) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .deepLinkInfo(let _data): + if boxed { + buffer.appendInt32(1783556146) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - break - case .deepLinkInfoEmpty: - if boxed { - buffer.appendInt32(1722786150) } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .deepLinkInfo(let flags, let message, let entities): - return ("deepLinkInfo", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any)]) - case .deepLinkInfoEmpty: + } + break + case .deepLinkInfoEmpty: + if boxed { + buffer.appendInt32(1722786150) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .deepLinkInfo(let _data): + return ("deepLinkInfo", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any)]) + case .deepLinkInfoEmpty: return ("deepLinkInfoEmpty", []) - } - } - + } + } + public static func parse_deepLinkInfo(_ reader: BufferReader) -> DeepLinkInfo? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.help.DeepLinkInfo.deepLinkInfo(flags: _1!, message: _2!, entities: _3) + return Api.help.DeepLinkInfo.deepLinkInfo(Cons_deepLinkInfo(flags: _1!, message: _2!, entities: _3)) } else { return nil @@ -319,77 +404,88 @@ public extension Api.help { public static func parse_deepLinkInfoEmpty(_ reader: BufferReader) -> DeepLinkInfo? { return Api.help.DeepLinkInfo.deepLinkInfoEmpty } - } } public extension Api.help { enum InviteText: TypeConstructorDescription { - case inviteText(message: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inviteText(let message): - if boxed { - buffer.appendInt32(415997816) - } - serializeString(message, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inviteText(let message): - return ("inviteText", [("message", message as Any)]) - } - } - + public class Cons_inviteText { + public var message: String + public init(message: String) { + self.message = message + } + } + case inviteText(Cons_inviteText) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inviteText(let _data): + if boxed { + buffer.appendInt32(415997816) + } + serializeString(_data.message, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inviteText(let _data): + return ("inviteText", [("message", _data.message as Any)]) + } + } + public static func parse_inviteText(_ reader: BufferReader) -> InviteText? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.help.InviteText.inviteText(message: _1!) + return Api.help.InviteText.inviteText(Cons_inviteText(message: _1!)) } else { return nil } } - } } public extension Api.help { enum PassportConfig: TypeConstructorDescription { - case passportConfig(hash: Int32, countriesLangs: Api.DataJSON) + public class Cons_passportConfig { + public var hash: Int32 + public var countriesLangs: Api.DataJSON + public init(hash: Int32, countriesLangs: Api.DataJSON) { + self.hash = hash + self.countriesLangs = countriesLangs + } + } + case passportConfig(Cons_passportConfig) case passportConfigNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .passportConfig(let hash, let countriesLangs): - if boxed { - buffer.appendInt32(-1600596305) - } - serializeInt32(hash, buffer: buffer, boxed: false) - countriesLangs.serialize(buffer, true) - break - case .passportConfigNotModified: - if boxed { - buffer.appendInt32(-1078332329) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .passportConfig(let hash, let countriesLangs): - return ("passportConfig", [("hash", hash as Any), ("countriesLangs", countriesLangs as Any)]) - case .passportConfigNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passportConfig(let _data): + if boxed { + buffer.appendInt32(-1600596305) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + _data.countriesLangs.serialize(buffer, true) + break + case .passportConfigNotModified: + if boxed { + buffer.appendInt32(-1078332329) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .passportConfig(let _data): + return ("passportConfig", [("hash", _data.hash as Any), ("countriesLangs", _data.countriesLangs as Any)]) + case .passportConfigNotModified: return ("passportConfigNotModified", []) - } - } - + } + } + public static func parse_passportConfig(_ reader: BufferReader) -> PassportConfig? { var _1: Int32? _1 = reader.readInt32() @@ -400,7 +496,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.PassportConfig.passportConfig(hash: _1!, countriesLangs: _2!) + return Api.help.PassportConfig.passportConfig(Cons_passportConfig(hash: _1!, countriesLangs: _2!)) } else { return nil @@ -409,53 +505,84 @@ public extension Api.help { public static func parse_passportConfigNotModified(_ reader: BufferReader) -> PassportConfig? { return Api.help.PassportConfig.passportConfigNotModified } - } } public extension Api.help { enum PeerColorOption: TypeConstructorDescription { - case peerColorOption(flags: Int32, colorId: Int32, colors: Api.help.PeerColorSet?, darkColors: Api.help.PeerColorSet?, channelMinLevel: Int32?, groupMinLevel: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerColorOption(let flags, let colorId, let colors, let darkColors, let channelMinLevel, let groupMinLevel): - if boxed { - buffer.appendInt32(-1377014082) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(colorId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {colors!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {darkColors!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(channelMinLevel!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(groupMinLevel!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerColorOption(let flags, let colorId, let colors, let darkColors, let channelMinLevel, let groupMinLevel): - return ("peerColorOption", [("flags", flags as Any), ("colorId", colorId as Any), ("colors", colors as Any), ("darkColors", darkColors as Any), ("channelMinLevel", channelMinLevel as Any), ("groupMinLevel", groupMinLevel as Any)]) - } - } - + public class Cons_peerColorOption { + public var flags: Int32 + public var colorId: Int32 + public var colors: Api.help.PeerColorSet? + public var darkColors: Api.help.PeerColorSet? + public var channelMinLevel: Int32? + public var groupMinLevel: Int32? + public init(flags: Int32, colorId: Int32, colors: Api.help.PeerColorSet?, darkColors: Api.help.PeerColorSet?, channelMinLevel: Int32?, groupMinLevel: Int32?) { + self.flags = flags + self.colorId = colorId + self.colors = colors + self.darkColors = darkColors + self.channelMinLevel = channelMinLevel + self.groupMinLevel = groupMinLevel + } + } + case peerColorOption(Cons_peerColorOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerColorOption(let _data): + if boxed { + buffer.appendInt32(-1377014082) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.colorId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.colors!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.darkColors!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.channelMinLevel!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.groupMinLevel!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerColorOption(let _data): + return ("peerColorOption", [("flags", _data.flags as Any), ("colorId", _data.colorId as Any), ("colors", _data.colors as Any), ("darkColors", _data.darkColors as Any), ("channelMinLevel", _data.channelMinLevel as Any), ("groupMinLevel", _data.groupMinLevel as Any)]) + } + } + public static func parse_peerColorOption(_ reader: BufferReader) -> PeerColorOption? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Api.help.PeerColorSet? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.help.PeerColorSet - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.help.PeerColorSet + } + } var _4: Api.help.PeerColorSet? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.help.PeerColorSet - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.help.PeerColorSet + } + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -463,64 +590,79 @@ public extension Api.help { let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.help.PeerColorOption.peerColorOption(flags: _1!, colorId: _2!, colors: _3, darkColors: _4, channelMinLevel: _5, groupMinLevel: _6) + return Api.help.PeerColorOption.peerColorOption(Cons_peerColorOption(flags: _1!, colorId: _2!, colors: _3, darkColors: _4, channelMinLevel: _5, groupMinLevel: _6)) } else { return nil } } - } } public extension Api.help { enum PeerColorSet: TypeConstructorDescription { - case peerColorProfileSet(paletteColors: [Int32], bgColors: [Int32], storyColors: [Int32]) - case peerColorSet(colors: [Int32]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerColorProfileSet(let paletteColors, let bgColors, let storyColors): - if boxed { - buffer.appendInt32(1987928555) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(paletteColors.count)) - for item in paletteColors { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(bgColors.count)) - for item in bgColors { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(storyColors.count)) - for item in storyColors { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .peerColorSet(let colors): - if boxed { - buffer.appendInt32(639736408) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(colors.count)) - for item in colors { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerColorProfileSet(let paletteColors, let bgColors, let storyColors): - return ("peerColorProfileSet", [("paletteColors", paletteColors as Any), ("bgColors", bgColors as Any), ("storyColors", storyColors as Any)]) - case .peerColorSet(let colors): - return ("peerColorSet", [("colors", colors as Any)]) - } - } - + public class Cons_peerColorProfileSet { + public var paletteColors: [Int32] + public var bgColors: [Int32] + public var storyColors: [Int32] + public init(paletteColors: [Int32], bgColors: [Int32], storyColors: [Int32]) { + self.paletteColors = paletteColors + self.bgColors = bgColors + self.storyColors = storyColors + } + } + public class Cons_peerColorSet { + public var colors: [Int32] + public init(colors: [Int32]) { + self.colors = colors + } + } + case peerColorProfileSet(Cons_peerColorProfileSet) + case peerColorSet(Cons_peerColorSet) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerColorProfileSet(let _data): + if boxed { + buffer.appendInt32(1987928555) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.paletteColors.count)) + for item in _data.paletteColors { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.bgColors.count)) + for item in _data.bgColors { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.storyColors.count)) + for item in _data.storyColors { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .peerColorSet(let _data): + if boxed { + buffer.appendInt32(639736408) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.colors.count)) + for item in _data.colors { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerColorProfileSet(let _data): + return ("peerColorProfileSet", [("paletteColors", _data.paletteColors as Any), ("bgColors", _data.bgColors as Any), ("storyColors", _data.storyColors as Any)]) + case .peerColorSet(let _data): + return ("peerColorSet", [("colors", _data.colors as Any)]) + } + } + public static func parse_peerColorProfileSet(_ reader: BufferReader) -> PeerColorSet? { var _1: [Int32]? if let _ = reader.readInt32() { @@ -538,7 +680,7 @@ public extension Api.help { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.help.PeerColorSet.peerColorProfileSet(paletteColors: _1!, bgColors: _2!, storyColors: _3!) + return Api.help.PeerColorSet.peerColorProfileSet(Cons_peerColorProfileSet(paletteColors: _1!, bgColors: _2!, storyColors: _3!)) } else { return nil @@ -551,51 +693,57 @@ public extension Api.help { } let _c1 = _1 != nil if _c1 { - return Api.help.PeerColorSet.peerColorSet(colors: _1!) + return Api.help.PeerColorSet.peerColorSet(Cons_peerColorSet(colors: _1!)) } else { return nil } } - } } public extension Api.help { enum PeerColors: TypeConstructorDescription { - case peerColors(hash: Int32, colors: [Api.help.PeerColorOption]) + public class Cons_peerColors { + public var hash: Int32 + public var colors: [Api.help.PeerColorOption] + public init(hash: Int32, colors: [Api.help.PeerColorOption]) { + self.hash = hash + self.colors = colors + } + } + case peerColors(Cons_peerColors) case peerColorsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerColors(let hash, let colors): - if boxed { - buffer.appendInt32(16313608) - } - serializeInt32(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(colors.count)) - for item in colors { - item.serialize(buffer, true) - } - break - case .peerColorsNotModified: - if boxed { - buffer.appendInt32(732034510) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerColors(let hash, let colors): - return ("peerColors", [("hash", hash as Any), ("colors", colors as Any)]) - case .peerColorsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerColors(let _data): + if boxed { + buffer.appendInt32(16313608) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.colors.count)) + for item in _data.colors { + item.serialize(buffer, true) + } + break + case .peerColorsNotModified: + if boxed { + buffer.appendInt32(732034510) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerColors(let _data): + return ("peerColors", [("hash", _data.hash as Any), ("colors", _data.colors as Any)]) + case .peerColorsNotModified: return ("peerColorsNotModified", []) - } - } - + } + } + public static func parse_peerColors(_ reader: BufferReader) -> PeerColors? { var _1: Int32? _1 = reader.readInt32() @@ -606,7 +754,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.PeerColors.peerColors(hash: _1!, colors: _2!) + return Api.help.PeerColors.peerColors(Cons_peerColors(hash: _1!, colors: _2!)) } else { return nil @@ -615,56 +763,71 @@ public extension Api.help { public static func parse_peerColorsNotModified(_ reader: BufferReader) -> PeerColors? { return Api.help.PeerColors.peerColorsNotModified } - } } public extension Api.help { enum PremiumPromo: TypeConstructorDescription { - case premiumPromo(statusText: String, statusEntities: [Api.MessageEntity], videoSections: [String], videos: [Api.Document], periodOptions: [Api.PremiumSubscriptionOption], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .premiumPromo(let statusText, let statusEntities, let videoSections, let videos, let periodOptions, let users): - if boxed { - buffer.appendInt32(1395946908) - } - serializeString(statusText, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(statusEntities.count)) - for item in statusEntities { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(videoSections.count)) - for item in videoSections { - serializeString(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(videos.count)) - for item in videos { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(periodOptions.count)) - for item in periodOptions { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .premiumPromo(let statusText, let statusEntities, let videoSections, let videos, let periodOptions, let users): - return ("premiumPromo", [("statusText", statusText as Any), ("statusEntities", statusEntities as Any), ("videoSections", videoSections as Any), ("videos", videos as Any), ("periodOptions", periodOptions as Any), ("users", users as Any)]) - } - } - + public class Cons_premiumPromo { + public var statusText: String + public var statusEntities: [Api.MessageEntity] + public var videoSections: [String] + public var videos: [Api.Document] + public var periodOptions: [Api.PremiumSubscriptionOption] + public var users: [Api.User] + public init(statusText: String, statusEntities: [Api.MessageEntity], videoSections: [String], videos: [Api.Document], periodOptions: [Api.PremiumSubscriptionOption], users: [Api.User]) { + self.statusText = statusText + self.statusEntities = statusEntities + self.videoSections = videoSections + self.videos = videos + self.periodOptions = periodOptions + self.users = users + } + } + case premiumPromo(Cons_premiumPromo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .premiumPromo(let _data): + if boxed { + buffer.appendInt32(1395946908) + } + serializeString(_data.statusText, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.statusEntities.count)) + for item in _data.statusEntities { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.videoSections.count)) + for item in _data.videoSections { + serializeString(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.videos.count)) + for item in _data.videos { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.periodOptions.count)) + for item in _data.periodOptions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .premiumPromo(let _data): + return ("premiumPromo", [("statusText", _data.statusText as Any), ("statusEntities", _data.statusEntities as Any), ("videoSections", _data.videoSections as Any), ("videos", _data.videos as Any), ("periodOptions", _data.periodOptions as Any), ("users", _data.users as Any)]) + } + } + public static func parse_premiumPromo(_ reader: BufferReader) -> PremiumPromo? { var _1: String? _1 = parseString(reader) @@ -695,84 +858,127 @@ public extension Api.help { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.help.PremiumPromo.premiumPromo(statusText: _1!, statusEntities: _2!, videoSections: _3!, videos: _4!, periodOptions: _5!, users: _6!) + return Api.help.PremiumPromo.premiumPromo(Cons_premiumPromo(statusText: _1!, statusEntities: _2!, videoSections: _3!, videos: _4!, periodOptions: _5!, users: _6!)) } else { return nil } } - } } public extension Api.help { enum PromoData: TypeConstructorDescription { - case promoData(flags: Int32, expires: Int32, peer: Api.Peer?, psaType: String?, psaMessage: String?, pendingSuggestions: [String], dismissedSuggestions: [String], customPendingSuggestion: Api.PendingSuggestion?, chats: [Api.Chat], users: [Api.User]) - case promoDataEmpty(expires: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .promoData(let flags, let expires, let peer, let psaType, let psaMessage, let pendingSuggestions, let dismissedSuggestions, let customPendingSuggestion, let chats, let users): - if boxed { - buffer.appendInt32(145021050) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(expires, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(psaType!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(psaMessage!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(pendingSuggestions.count)) - for item in pendingSuggestions { - serializeString(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dismissedSuggestions.count)) - for item in dismissedSuggestions { - serializeString(item, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 4) != 0 {customPendingSuggestion!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .promoDataEmpty(let expires): - if boxed { - buffer.appendInt32(-1728664459) - } - serializeInt32(expires, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .promoData(let flags, let expires, let peer, let psaType, let psaMessage, let pendingSuggestions, let dismissedSuggestions, let customPendingSuggestion, let chats, let users): - return ("promoData", [("flags", flags as Any), ("expires", expires as Any), ("peer", peer as Any), ("psaType", psaType as Any), ("psaMessage", psaMessage as Any), ("pendingSuggestions", pendingSuggestions as Any), ("dismissedSuggestions", dismissedSuggestions as Any), ("customPendingSuggestion", customPendingSuggestion as Any), ("chats", chats as Any), ("users", users as Any)]) - case .promoDataEmpty(let expires): - return ("promoDataEmpty", [("expires", expires as Any)]) - } - } - + public class Cons_promoData { + public var flags: Int32 + public var expires: Int32 + public var peer: Api.Peer? + public var psaType: String? + public var psaMessage: String? + public var pendingSuggestions: [String] + public var dismissedSuggestions: [String] + public var customPendingSuggestion: Api.PendingSuggestion? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, expires: Int32, peer: Api.Peer?, psaType: String?, psaMessage: String?, pendingSuggestions: [String], dismissedSuggestions: [String], customPendingSuggestion: Api.PendingSuggestion?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.expires = expires + self.peer = peer + self.psaType = psaType + self.psaMessage = psaMessage + self.pendingSuggestions = pendingSuggestions + self.dismissedSuggestions = dismissedSuggestions + self.customPendingSuggestion = customPendingSuggestion + self.chats = chats + self.users = users + } + } + public class Cons_promoDataEmpty { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + } + case promoData(Cons_promoData) + case promoDataEmpty(Cons_promoDataEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .promoData(let _data): + if boxed { + buffer.appendInt32(145021050) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.peer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.psaType!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.psaMessage!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.pendingSuggestions.count)) + for item in _data.pendingSuggestions { + serializeString(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dismissedSuggestions.count)) + for item in _data.dismissedSuggestions { + serializeString(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.customPendingSuggestion!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .promoDataEmpty(let _data): + if boxed { + buffer.appendInt32(-1728664459) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .promoData(let _data): + return ("promoData", [("flags", _data.flags as Any), ("expires", _data.expires as Any), ("peer", _data.peer as Any), ("psaType", _data.psaType as Any), ("psaMessage", _data.psaMessage as Any), ("pendingSuggestions", _data.pendingSuggestions as Any), ("dismissedSuggestions", _data.dismissedSuggestions as Any), ("customPendingSuggestion", _data.customPendingSuggestion as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .promoDataEmpty(let _data): + return ("promoDataEmpty", [("expires", _data.expires as Any)]) + } + } + public static func parse_promoData(_ reader: BufferReader) -> PromoData? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Api.Peer? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: [String]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) @@ -782,9 +988,11 @@ public extension Api.help { _7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) } var _8: Api.PendingSuggestion? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.PendingSuggestion - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.PendingSuggestion + } + } var _9: [Api.Chat]? if let _ = reader.readInt32() { _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -804,7 +1012,7 @@ public extension Api.help { let _c9 = _9 != nil let _c10 = _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.help.PromoData.promoData(flags: _1!, expires: _2!, peer: _3, psaType: _4, psaMessage: _5, pendingSuggestions: _6!, dismissedSuggestions: _7!, customPendingSuggestion: _8, chats: _9!, users: _10!) + return Api.help.PromoData.promoData(Cons_promoData(flags: _1!, expires: _2!, peer: _3, psaType: _4, psaMessage: _5, pendingSuggestions: _6!, dismissedSuggestions: _7!, customPendingSuggestion: _8, chats: _9!, users: _10!)) } else { return nil @@ -815,51 +1023,60 @@ public extension Api.help { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.help.PromoData.promoDataEmpty(expires: _1!) + return Api.help.PromoData.promoDataEmpty(Cons_promoDataEmpty(expires: _1!)) } else { return nil } } - } } public extension Api.help { enum RecentMeUrls: TypeConstructorDescription { - case recentMeUrls(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .recentMeUrls(let urls, let chats, let users): - if boxed { - buffer.appendInt32(235081943) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(urls.count)) - for item in urls { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .recentMeUrls(let urls, let chats, let users): - return ("recentMeUrls", [("urls", urls as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_recentMeUrls { + public var urls: [Api.RecentMeUrl] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User]) { + self.urls = urls + self.chats = chats + self.users = users + } + } + case recentMeUrls(Cons_recentMeUrls) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .recentMeUrls(let _data): + if boxed { + buffer.appendInt32(235081943) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.urls.count)) + for item in _data.urls { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .recentMeUrls(let _data): + return ("recentMeUrls", [("urls", _data.urls as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? { var _1: [Api.RecentMeUrl]? if let _ = reader.readInt32() { @@ -877,38 +1094,45 @@ public extension Api.help { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.help.RecentMeUrls.recentMeUrls(urls: _1!, chats: _2!, users: _3!) + return Api.help.RecentMeUrls.recentMeUrls(Cons_recentMeUrls(urls: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.help { enum Support: TypeConstructorDescription { - case support(phoneNumber: String, user: Api.User) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .support(let phoneNumber, let user): - if boxed { - buffer.appendInt32(398898678) - } - serializeString(phoneNumber, buffer: buffer, boxed: false) - user.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .support(let phoneNumber, let user): - return ("support", [("phoneNumber", phoneNumber as Any), ("user", user as Any)]) - } - } - + public class Cons_support { + public var phoneNumber: String + public var user: Api.User + public init(phoneNumber: String, user: Api.User) { + self.phoneNumber = phoneNumber + self.user = user + } + } + case support(Cons_support) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .support(let _data): + if boxed { + buffer.appendInt32(398898678) + } + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + _data.user.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .support(let _data): + return ("support", [("phoneNumber", _data.phoneNumber as Any), ("user", _data.user as Any)]) + } + } + public static func parse_support(_ reader: BufferReader) -> Support? { var _1: String? _1 = parseString(reader) @@ -919,81 +1143,101 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.Support.support(phoneNumber: _1!, user: _2!) + return Api.help.Support.support(Cons_support(phoneNumber: _1!, user: _2!)) } else { return nil } } - } } public extension Api.help { enum SupportName: TypeConstructorDescription { - case supportName(name: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .supportName(let name): - if boxed { - buffer.appendInt32(-1945767479) - } - serializeString(name, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .supportName(let name): - return ("supportName", [("name", name as Any)]) - } - } - + public class Cons_supportName { + public var name: String + public init(name: String) { + self.name = name + } + } + case supportName(Cons_supportName) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .supportName(let _data): + if boxed { + buffer.appendInt32(-1945767479) + } + serializeString(_data.name, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .supportName(let _data): + return ("supportName", [("name", _data.name as Any)]) + } + } + public static func parse_supportName(_ reader: BufferReader) -> SupportName? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.help.SupportName.supportName(name: _1!) + return Api.help.SupportName.supportName(Cons_supportName(name: _1!)) } else { return nil } } - } } public extension Api.help { enum TermsOfService: TypeConstructorDescription { - case termsOfService(flags: Int32, id: Api.DataJSON, text: String, entities: [Api.MessageEntity], minAgeConfirm: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .termsOfService(let flags, let id, let text, let entities, let minAgeConfirm): - if boxed { - buffer.appendInt32(2013922064) - } - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - serializeString(text, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(minAgeConfirm!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .termsOfService(let flags, let id, let text, let entities, let minAgeConfirm): - return ("termsOfService", [("flags", flags as Any), ("id", id as Any), ("text", text as Any), ("entities", entities as Any), ("minAgeConfirm", minAgeConfirm as Any)]) - } - } - + public class Cons_termsOfService { + public var flags: Int32 + public var id: Api.DataJSON + public var text: String + public var entities: [Api.MessageEntity] + public var minAgeConfirm: Int32? + public init(flags: Int32, id: Api.DataJSON, text: String, entities: [Api.MessageEntity], minAgeConfirm: Int32?) { + self.flags = flags + self.id = id + self.text = text + self.entities = entities + self.minAgeConfirm = minAgeConfirm + } + } + case termsOfService(Cons_termsOfService) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .termsOfService(let _data): + if boxed { + buffer.appendInt32(2013922064) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.id.serialize(buffer, true) + serializeString(_data.text, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities.count)) + for item in _data.entities { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.minAgeConfirm!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .termsOfService(let _data): + return ("termsOfService", [("flags", _data.flags as Any), ("id", _data.id as Any), ("text", _data.text as Any), ("entities", _data.entities as Any), ("minAgeConfirm", _data.minAgeConfirm as Any)]) + } + } + public static func parse_termsOfService(_ reader: BufferReader) -> TermsOfService? { var _1: Int32? _1 = reader.readInt32() @@ -1008,54 +1252,69 @@ public extension Api.help { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) } var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.help.TermsOfService.termsOfService(flags: _1!, id: _2!, text: _3!, entities: _4!, minAgeConfirm: _5) + return Api.help.TermsOfService.termsOfService(Cons_termsOfService(flags: _1!, id: _2!, text: _3!, entities: _4!, minAgeConfirm: _5)) } else { return nil } } - } } public extension Api.help { enum TermsOfServiceUpdate: TypeConstructorDescription { - case termsOfServiceUpdate(expires: Int32, termsOfService: Api.help.TermsOfService) - case termsOfServiceUpdateEmpty(expires: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .termsOfServiceUpdate(let expires, let termsOfService): - if boxed { - buffer.appendInt32(686618977) - } - serializeInt32(expires, buffer: buffer, boxed: false) - termsOfService.serialize(buffer, true) - break - case .termsOfServiceUpdateEmpty(let expires): - if boxed { - buffer.appendInt32(-483352705) - } - serializeInt32(expires, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .termsOfServiceUpdate(let expires, let termsOfService): - return ("termsOfServiceUpdate", [("expires", expires as Any), ("termsOfService", termsOfService as Any)]) - case .termsOfServiceUpdateEmpty(let expires): - return ("termsOfServiceUpdateEmpty", [("expires", expires as Any)]) - } - } - + public class Cons_termsOfServiceUpdate { + public var expires: Int32 + public var termsOfService: Api.help.TermsOfService + public init(expires: Int32, termsOfService: Api.help.TermsOfService) { + self.expires = expires + self.termsOfService = termsOfService + } + } + public class Cons_termsOfServiceUpdateEmpty { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + } + case termsOfServiceUpdate(Cons_termsOfServiceUpdate) + case termsOfServiceUpdateEmpty(Cons_termsOfServiceUpdateEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .termsOfServiceUpdate(let _data): + if boxed { + buffer.appendInt32(686618977) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + _data.termsOfService.serialize(buffer, true) + break + case .termsOfServiceUpdateEmpty(let _data): + if boxed { + buffer.appendInt32(-483352705) + } + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .termsOfServiceUpdate(let _data): + return ("termsOfServiceUpdate", [("expires", _data.expires as Any), ("termsOfService", _data.termsOfService as Any)]) + case .termsOfServiceUpdateEmpty(let _data): + return ("termsOfServiceUpdateEmpty", [("expires", _data.expires as Any)]) + } + } + public static func parse_termsOfServiceUpdate(_ reader: BufferReader) -> TermsOfServiceUpdate? { var _1: Int32? _1 = reader.readInt32() @@ -1066,7 +1325,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.TermsOfServiceUpdate.termsOfServiceUpdate(expires: _1!, termsOfService: _2!) + return Api.help.TermsOfServiceUpdate.termsOfServiceUpdate(Cons_termsOfServiceUpdate(expires: _1!, termsOfService: _2!)) } else { return nil @@ -1077,51 +1336,57 @@ public extension Api.help { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.help.TermsOfServiceUpdate.termsOfServiceUpdateEmpty(expires: _1!) + return Api.help.TermsOfServiceUpdate.termsOfServiceUpdateEmpty(Cons_termsOfServiceUpdateEmpty(expires: _1!)) } else { return nil } } - } } public extension Api.help { enum TimezonesList: TypeConstructorDescription { - case timezonesList(timezones: [Api.Timezone], hash: Int32) + public class Cons_timezonesList { + public var timezones: [Api.Timezone] + public var hash: Int32 + public init(timezones: [Api.Timezone], hash: Int32) { + self.timezones = timezones + self.hash = hash + } + } + case timezonesList(Cons_timezonesList) case timezonesListNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .timezonesList(let timezones, let hash): - if boxed { - buffer.appendInt32(2071260529) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(timezones.count)) - for item in timezones { - item.serialize(buffer, true) - } - serializeInt32(hash, buffer: buffer, boxed: false) - break - case .timezonesListNotModified: - if boxed { - buffer.appendInt32(-1761146676) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .timezonesList(let timezones, let hash): - return ("timezonesList", [("timezones", timezones as Any), ("hash", hash as Any)]) - case .timezonesListNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .timezonesList(let _data): + if boxed { + buffer.appendInt32(2071260529) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.timezones.count)) + for item in _data.timezones { + item.serialize(buffer, true) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + break + case .timezonesListNotModified: + if boxed { + buffer.appendInt32(-1761146676) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .timezonesList(let _data): + return ("timezonesList", [("timezones", _data.timezones as Any), ("hash", _data.hash as Any)]) + case .timezonesListNotModified: return ("timezonesListNotModified", []) - } - } - + } + } + public static func parse_timezonesList(_ reader: BufferReader) -> TimezonesList? { var _1: [Api.Timezone]? if let _ = reader.readInt32() { @@ -1132,7 +1397,7 @@ public extension Api.help { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.TimezonesList.timezonesList(timezones: _1!, hash: _2!) + return Api.help.TimezonesList.timezonesList(Cons_timezonesList(timezones: _1!, hash: _2!)) } else { return nil @@ -1141,47 +1406,57 @@ public extension Api.help { public static func parse_timezonesListNotModified(_ reader: BufferReader) -> TimezonesList? { return Api.help.TimezonesList.timezonesListNotModified } - } } public extension Api.help { enum UserInfo: TypeConstructorDescription { - case userInfo(message: String, entities: [Api.MessageEntity], author: String, date: Int32) + public class Cons_userInfo { + public var message: String + public var entities: [Api.MessageEntity] + public var author: String + public var date: Int32 + public init(message: String, entities: [Api.MessageEntity], author: String, date: Int32) { + self.message = message + self.entities = entities + self.author = author + self.date = date + } + } + case userInfo(Cons_userInfo) case userInfoEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userInfo(let message, let entities, let author, let date): - if boxed { - buffer.appendInt32(32192344) - } - serializeString(message, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - serializeString(author, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .userInfoEmpty: - if boxed { - buffer.appendInt32(-206688531) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .userInfo(let message, let entities, let author, let date): - return ("userInfo", [("message", message as Any), ("entities", entities as Any), ("author", author as Any), ("date", date as Any)]) - case .userInfoEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userInfo(let _data): + if boxed { + buffer.appendInt32(32192344) + } + serializeString(_data.message, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities.count)) + for item in _data.entities { + item.serialize(buffer, true) + } + serializeString(_data.author, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .userInfoEmpty: + if boxed { + buffer.appendInt32(-206688531) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .userInfo(let _data): + return ("userInfo", [("message", _data.message as Any), ("entities", _data.entities as Any), ("author", _data.author as Any), ("date", _data.date as Any)]) + case .userInfoEmpty: return ("userInfoEmpty", []) - } - } - + } + } + public static func parse_userInfo(_ reader: BufferReader) -> UserInfo? { var _1: String? _1 = parseString(reader) @@ -1198,7 +1473,7 @@ public extension Api.help { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.help.UserInfo.userInfo(message: _1!, entities: _2!, author: _3!, date: _4!) + return Api.help.UserInfo.userInfo(Cons_userInfo(message: _1!, entities: _2!, author: _3!, date: _4!)) } else { return nil @@ -1207,38 +1482,49 @@ public extension Api.help { public static func parse_userInfoEmpty(_ reader: BufferReader) -> UserInfo? { return Api.help.UserInfo.userInfoEmpty } - } } public extension Api.messages { enum AffectedFoundMessages: TypeConstructorDescription { - case affectedFoundMessages(pts: Int32, ptsCount: Int32, offset: Int32, messages: [Int32]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedFoundMessages(let pts, let ptsCount, let offset, let messages): - if boxed { - buffer.appendInt32(-275956116) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedFoundMessages(let pts, let ptsCount, let offset, let messages): - return ("affectedFoundMessages", [("pts", pts as Any), ("ptsCount", ptsCount as Any), ("offset", offset as Any), ("messages", messages as Any)]) - } - } - + public class Cons_affectedFoundMessages { + public var pts: Int32 + public var ptsCount: Int32 + public var offset: Int32 + public var messages: [Int32] + public init(pts: Int32, ptsCount: Int32, offset: Int32, messages: [Int32]) { + self.pts = pts + self.ptsCount = ptsCount + self.offset = offset + self.messages = messages + } + } + case affectedFoundMessages(Cons_affectedFoundMessages) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .affectedFoundMessages(let _data): + if boxed { + buffer.appendInt32(-275956116) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .affectedFoundMessages(let _data): + return ("affectedFoundMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any), ("messages", _data.messages as Any)]) + } + } + public static func parse_affectedFoundMessages(_ reader: BufferReader) -> AffectedFoundMessages? { var _1: Int32? _1 = reader.readInt32() @@ -1255,39 +1541,48 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.AffectedFoundMessages.affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!) + return Api.messages.AffectedFoundMessages.affectedFoundMessages(Cons_affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)) } else { return nil } } - } } public extension Api.messages { enum AffectedHistory: TypeConstructorDescription { - case affectedHistory(pts: Int32, ptsCount: Int32, offset: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedHistory(let pts, let ptsCount, let offset): - if boxed { - buffer.appendInt32(-1269012015) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedHistory(let pts, let ptsCount, let offset): - return ("affectedHistory", [("pts", pts as Any), ("ptsCount", ptsCount as Any), ("offset", offset as Any)]) - } - } - + public class Cons_affectedHistory { + public var pts: Int32 + public var ptsCount: Int32 + public var offset: Int32 + public init(pts: Int32, ptsCount: Int32, offset: Int32) { + self.pts = pts + self.ptsCount = ptsCount + self.offset = offset + } + } + case affectedHistory(Cons_affectedHistory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .affectedHistory(let _data): + if boxed { + buffer.appendInt32(-1269012015) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .affectedHistory(let _data): + return ("affectedHistory", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any)]) + } + } + public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { var _1: Int32? _1 = reader.readInt32() @@ -1299,38 +1594,45 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.AffectedHistory.affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!) + return Api.messages.AffectedHistory.affectedHistory(Cons_affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)) } else { return nil } } - } } public extension Api.messages { enum AffectedMessages: TypeConstructorDescription { - case affectedMessages(pts: Int32, ptsCount: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedMessages(let pts, let ptsCount): - if boxed { - buffer.appendInt32(-2066640507) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(ptsCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedMessages(let pts, let ptsCount): - return ("affectedMessages", [("pts", pts as Any), ("ptsCount", ptsCount as Any)]) - } - } - + public class Cons_affectedMessages { + public var pts: Int32 + public var ptsCount: Int32 + public init(pts: Int32, ptsCount: Int32) { + self.pts = pts + self.ptsCount = ptsCount + } + } + case affectedMessages(Cons_affectedMessages) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .affectedMessages(let _data): + if boxed { + buffer.appendInt32(-2066640507) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .affectedMessages(let _data): + return ("affectedMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + } + } + public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { var _1: Int32? _1 = reader.readInt32() @@ -1339,12 +1641,11 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.AffectedMessages.affectedMessages(pts: _1!, ptsCount: _2!) + return Api.messages.AffectedMessages.affectedMessages(Cons_affectedMessages(pts: _1!, ptsCount: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api34.swift b/submodules/TelegramApi/Sources/Api34.swift index 9803de9170..fbe1750d3d 100644 --- a/submodules/TelegramApi/Sources/Api34.swift +++ b/submodules/TelegramApi/Sources/Api34.swift @@ -1,39 +1,46 @@ public extension Api.messages { enum AllStickers: TypeConstructorDescription { - case allStickers(hash: Int64, sets: [Api.StickerSet]) + public class Cons_allStickers { + public var hash: Int64 + public var sets: [Api.StickerSet] + public init(hash: Int64, sets: [Api.StickerSet]) { + self.hash = hash + self.sets = sets + } + } + case allStickers(Cons_allStickers) case allStickersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .allStickers(let hash, let sets): - if boxed { - buffer.appendInt32(-843329861) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - break - case .allStickersNotModified: - if boxed { - buffer.appendInt32(-395967805) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .allStickers(let hash, let sets): - return ("allStickers", [("hash", hash as Any), ("sets", sets as Any)]) - case .allStickersNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .allStickers(let _data): + if boxed { + buffer.appendInt32(-843329861) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + break + case .allStickersNotModified: + if boxed { + buffer.appendInt32(-395967805) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .allStickers(let _data): + return ("allStickers", [("hash", _data.hash as Any), ("sets", _data.sets as Any)]) + case .allStickersNotModified: return ("allStickersNotModified", []) - } - } - + } + } + public static func parse_allStickers(_ reader: BufferReader) -> AllStickers? { var _1: Int64? _1 = reader.readInt64() @@ -44,7 +51,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.AllStickers.allStickers(hash: _1!, sets: _2!) + return Api.messages.AllStickers.allStickers(Cons_allStickers(hash: _1!, sets: _2!)) } else { return nil @@ -53,36 +60,43 @@ public extension Api.messages { public static func parse_allStickersNotModified(_ reader: BufferReader) -> AllStickers? { return Api.messages.AllStickers.allStickersNotModified } - } } public extension Api.messages { enum ArchivedStickers: TypeConstructorDescription { - case archivedStickers(count: Int32, sets: [Api.StickerSetCovered]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .archivedStickers(let count, let sets): - if boxed { - buffer.appendInt32(1338747336) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .archivedStickers(let count, let sets): - return ("archivedStickers", [("count", count as Any), ("sets", sets as Any)]) - } - } - + public class Cons_archivedStickers { + public var count: Int32 + public var sets: [Api.StickerSetCovered] + public init(count: Int32, sets: [Api.StickerSetCovered]) { + self.count = count + self.sets = sets + } + } + case archivedStickers(Cons_archivedStickers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .archivedStickers(let _data): + if boxed { + buffer.appendInt32(1338747336) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .archivedStickers(let _data): + return ("archivedStickers", [("count", _data.count as Any), ("sets", _data.sets as Any)]) + } + } + public static func parse_archivedStickers(_ reader: BufferReader) -> ArchivedStickers? { var _1: Int32? _1 = reader.readInt32() @@ -93,56 +107,64 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.ArchivedStickers.archivedStickers(count: _1!, sets: _2!) + return Api.messages.ArchivedStickers.archivedStickers(Cons_archivedStickers(count: _1!, sets: _2!)) } else { return nil } } - } } public extension Api.messages { enum AvailableEffects: TypeConstructorDescription { - case availableEffects(hash: Int32, effects: [Api.AvailableEffect], documents: [Api.Document]) + public class Cons_availableEffects { + public var hash: Int32 + public var effects: [Api.AvailableEffect] + public var documents: [Api.Document] + public init(hash: Int32, effects: [Api.AvailableEffect], documents: [Api.Document]) { + self.hash = hash + self.effects = effects + self.documents = documents + } + } + case availableEffects(Cons_availableEffects) case availableEffectsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .availableEffects(let hash, let effects, let documents): - if boxed { - buffer.appendInt32(-1109696146) - } - serializeInt32(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(effects.count)) - for item in effects { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - break - case .availableEffectsNotModified: - if boxed { - buffer.appendInt32(-772957605) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .availableEffects(let hash, let effects, let documents): - return ("availableEffects", [("hash", hash as Any), ("effects", effects as Any), ("documents", documents as Any)]) - case .availableEffectsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .availableEffects(let _data): + if boxed { + buffer.appendInt32(-1109696146) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.effects.count)) + for item in _data.effects { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + item.serialize(buffer, true) + } + break + case .availableEffectsNotModified: + if boxed { + buffer.appendInt32(-772957605) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .availableEffects(let _data): + return ("availableEffects", [("hash", _data.hash as Any), ("effects", _data.effects as Any), ("documents", _data.documents as Any)]) + case .availableEffectsNotModified: return ("availableEffectsNotModified", []) - } - } - + } + } + public static func parse_availableEffects(_ reader: BufferReader) -> AvailableEffects? { var _1: Int32? _1 = reader.readInt32() @@ -158,7 +180,7 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.AvailableEffects.availableEffects(hash: _1!, effects: _2!, documents: _3!) + return Api.messages.AvailableEffects.availableEffects(Cons_availableEffects(hash: _1!, effects: _2!, documents: _3!)) } else { return nil @@ -167,45 +189,51 @@ public extension Api.messages { public static func parse_availableEffectsNotModified(_ reader: BufferReader) -> AvailableEffects? { return Api.messages.AvailableEffects.availableEffectsNotModified } - } } public extension Api.messages { enum AvailableReactions: TypeConstructorDescription { - case availableReactions(hash: Int32, reactions: [Api.AvailableReaction]) + public class Cons_availableReactions { + public var hash: Int32 + public var reactions: [Api.AvailableReaction] + public init(hash: Int32, reactions: [Api.AvailableReaction]) { + self.hash = hash + self.reactions = reactions + } + } + case availableReactions(Cons_availableReactions) case availableReactionsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .availableReactions(let hash, let reactions): - if boxed { - buffer.appendInt32(1989032621) - } - serializeInt32(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - break - case .availableReactionsNotModified: - if boxed { - buffer.appendInt32(-1626924713) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .availableReactions(let hash, let reactions): - return ("availableReactions", [("hash", hash as Any), ("reactions", reactions as Any)]) - case .availableReactionsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .availableReactions(let _data): + if boxed { + buffer.appendInt32(1989032621) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + break + case .availableReactionsNotModified: + if boxed { + buffer.appendInt32(-1626924713) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .availableReactions(let _data): + return ("availableReactions", [("hash", _data.hash as Any), ("reactions", _data.reactions as Any)]) + case .availableReactionsNotModified: return ("availableReactionsNotModified", []) - } - } - + } + } + public static func parse_availableReactions(_ reader: BufferReader) -> AvailableReactions? { var _1: Int32? _1 = reader.readInt32() @@ -216,7 +244,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.AvailableReactions.availableReactions(hash: _1!, reactions: _2!) + return Api.messages.AvailableReactions.availableReactions(Cons_availableReactions(hash: _1!, reactions: _2!)) } else { return nil @@ -225,32 +253,39 @@ public extension Api.messages { public static func parse_availableReactionsNotModified(_ reader: BufferReader) -> AvailableReactions? { return Api.messages.AvailableReactions.availableReactionsNotModified } - } } public extension Api.messages { enum BotApp: TypeConstructorDescription { - case botApp(flags: Int32, app: Api.BotApp) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botApp(let flags, let app): - if boxed { - buffer.appendInt32(-347034123) - } - serializeInt32(flags, buffer: buffer, boxed: false) - app.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botApp(let flags, let app): - return ("botApp", [("flags", flags as Any), ("app", app as Any)]) - } - } - + public class Cons_botApp { + public var flags: Int32 + public var app: Api.BotApp + public init(flags: Int32, app: Api.BotApp) { + self.flags = flags + self.app = app + } + } + case botApp(Cons_botApp) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botApp(let _data): + if boxed { + buffer.appendInt32(-347034123) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.app.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botApp(let _data): + return ("botApp", [("flags", _data.flags as Any), ("app", _data.app as Any)]) + } + } + public static func parse_botApp(_ reader: BufferReader) -> BotApp? { var _1: Int32? _1 = reader.readInt32() @@ -261,47 +296,66 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.BotApp.botApp(flags: _1!, app: _2!) + return Api.messages.BotApp.botApp(Cons_botApp(flags: _1!, app: _2!)) } else { return nil } } - } } public extension Api.messages { enum BotCallbackAnswer: TypeConstructorDescription { - case botCallbackAnswer(flags: Int32, message: String?, url: String?, cacheTime: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botCallbackAnswer(let flags, let message, let url, let cacheTime): - if boxed { - buffer.appendInt32(911761060) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(message!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - serializeInt32(cacheTime, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botCallbackAnswer(let flags, let message, let url, let cacheTime): - return ("botCallbackAnswer", [("flags", flags as Any), ("message", message as Any), ("url", url as Any), ("cacheTime", cacheTime as Any)]) - } - } - + public class Cons_botCallbackAnswer { + public var flags: Int32 + public var message: String? + public var url: String? + public var cacheTime: Int32 + public init(flags: Int32, message: String?, url: String?, cacheTime: Int32) { + self.flags = flags + self.message = message + self.url = url + self.cacheTime = cacheTime + } + } + case botCallbackAnswer(Cons_botCallbackAnswer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botCallbackAnswer(let _data): + if boxed { + buffer.appendInt32(911761060) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.message!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + serializeInt32(_data.cacheTime, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botCallbackAnswer(let _data): + return ("botCallbackAnswer", [("flags", _data.flags as Any), ("message", _data.message as Any), ("url", _data.url as Any), ("cacheTime", _data.cacheTime as Any)]) + } + } + public static func parse_botCallbackAnswer(_ reader: BufferReader) -> BotCallbackAnswer? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: String? - if Int(_1!) & Int(1 << 2) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } var _4: Int32? _4 = reader.readInt32() let _c1 = _1 != nil @@ -309,38 +363,45 @@ public extension Api.messages { let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.BotCallbackAnswer.botCallbackAnswer(flags: _1!, message: _2, url: _3, cacheTime: _4!) + return Api.messages.BotCallbackAnswer.botCallbackAnswer(Cons_botCallbackAnswer(flags: _1!, message: _2, url: _3, cacheTime: _4!)) } else { return nil } } - } } public extension Api.messages { enum BotPreparedInlineMessage: TypeConstructorDescription { - case botPreparedInlineMessage(id: String, expireDate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botPreparedInlineMessage(let id, let expireDate): - if boxed { - buffer.appendInt32(-1899035375) - } - serializeString(id, buffer: buffer, boxed: false) - serializeInt32(expireDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botPreparedInlineMessage(let id, let expireDate): - return ("botPreparedInlineMessage", [("id", id as Any), ("expireDate", expireDate as Any)]) - } - } - + public class Cons_botPreparedInlineMessage { + public var id: String + public var expireDate: Int32 + public init(id: String, expireDate: Int32) { + self.id = id + self.expireDate = expireDate + } + } + case botPreparedInlineMessage(Cons_botPreparedInlineMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botPreparedInlineMessage(let _data): + if boxed { + buffer.appendInt32(-1899035375) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.expireDate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botPreparedInlineMessage(let _data): + return ("botPreparedInlineMessage", [("id", _data.id as Any), ("expireDate", _data.expireDate as Any)]) + } + } + public static func parse_botPreparedInlineMessage(_ reader: BufferReader) -> BotPreparedInlineMessage? { var _1: String? _1 = parseString(reader) @@ -349,67 +410,98 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.BotPreparedInlineMessage.botPreparedInlineMessage(id: _1!, expireDate: _2!) + return Api.messages.BotPreparedInlineMessage.botPreparedInlineMessage(Cons_botPreparedInlineMessage(id: _1!, expireDate: _2!)) } else { return nil } } - } } public extension Api.messages { enum BotResults: TypeConstructorDescription { - case botResults(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .botResults(let flags, let queryId, let nextOffset, let switchPm, let switchWebview, let results, let cacheTime, let users): - if boxed { - buffer.appendInt32(-534646026) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {switchPm!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {switchWebview!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(results.count)) - for item in results { - item.serialize(buffer, true) - } - serializeInt32(cacheTime, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .botResults(let flags, let queryId, let nextOffset, let switchPm, let switchWebview, let results, let cacheTime, let users): - return ("botResults", [("flags", flags as Any), ("queryId", queryId as Any), ("nextOffset", nextOffset as Any), ("switchPm", switchPm as Any), ("switchWebview", switchWebview as Any), ("results", results as Any), ("cacheTime", cacheTime as Any), ("users", users as Any)]) - } - } - + public class Cons_botResults { + public var flags: Int32 + public var queryId: Int64 + public var nextOffset: String? + public var switchPm: Api.InlineBotSwitchPM? + public var switchWebview: Api.InlineBotWebView? + public var results: [Api.BotInlineResult] + public var cacheTime: Int32 + public var users: [Api.User] + public init(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User]) { + self.flags = flags + self.queryId = queryId + self.nextOffset = nextOffset + self.switchPm = switchPm + self.switchWebview = switchWebview + self.results = results + self.cacheTime = cacheTime + self.users = users + } + } + case botResults(Cons_botResults) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .botResults(let _data): + if boxed { + buffer.appendInt32(-534646026) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.switchPm!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.switchWebview!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.results.count)) + for item in _data.results { + item.serialize(buffer, true) + } + serializeInt32(_data.cacheTime, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .botResults(let _data): + return ("botResults", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("nextOffset", _data.nextOffset as Any), ("switchPm", _data.switchPm as Any), ("switchWebview", _data.switchWebview as Any), ("results", _data.results as Any), ("cacheTime", _data.cacheTime as Any), ("users", _data.users as Any)]) + } + } + public static func parse_botResults(_ reader: BufferReader) -> BotResults? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: String? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } var _4: Api.InlineBotSwitchPM? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InlineBotSwitchPM - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InlineBotSwitchPM + } + } var _5: Api.InlineBotWebView? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.InlineBotWebView - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.InlineBotWebView + } + } var _6: [Api.BotInlineResult]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInlineResult.self) @@ -429,46 +521,53 @@ public extension Api.messages { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.messages.BotResults.botResults(flags: _1!, queryId: _2!, nextOffset: _3, switchPm: _4, switchWebview: _5, results: _6!, cacheTime: _7!, users: _8!) + return Api.messages.BotResults.botResults(Cons_botResults(flags: _1!, queryId: _2!, nextOffset: _3, switchPm: _4, switchWebview: _5, results: _6!, cacheTime: _7!, users: _8!)) } else { return nil } } - } } public extension Api.messages { enum ChatAdminsWithInvites: TypeConstructorDescription { - case chatAdminsWithInvites(admins: [Api.ChatAdminWithInvites], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatAdminsWithInvites(let admins, let users): - if boxed { - buffer.appendInt32(-1231326505) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(admins.count)) - for item in admins { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatAdminsWithInvites(let admins, let users): - return ("chatAdminsWithInvites", [("admins", admins as Any), ("users", users as Any)]) - } - } - + public class Cons_chatAdminsWithInvites { + public var admins: [Api.ChatAdminWithInvites] + public var users: [Api.User] + public init(admins: [Api.ChatAdminWithInvites], users: [Api.User]) { + self.admins = admins + self.users = users + } + } + case chatAdminsWithInvites(Cons_chatAdminsWithInvites) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatAdminsWithInvites(let _data): + if boxed { + buffer.appendInt32(-1231326505) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.admins.count)) + for item in _data.admins { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatAdminsWithInvites(let _data): + return ("chatAdminsWithInvites", [("admins", _data.admins as Any), ("users", _data.users as Any)]) + } + } + public static func parse_chatAdminsWithInvites(_ reader: BufferReader) -> ChatAdminsWithInvites? { var _1: [Api.ChatAdminWithInvites]? if let _ = reader.readInt32() { @@ -481,47 +580,56 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.ChatAdminsWithInvites.chatAdminsWithInvites(admins: _1!, users: _2!) + return Api.messages.ChatAdminsWithInvites.chatAdminsWithInvites(Cons_chatAdminsWithInvites(admins: _1!, users: _2!)) } else { return nil } } - } } public extension Api.messages { enum ChatFull: TypeConstructorDescription { - case chatFull(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatFull(let fullChat, let chats, let users): - if boxed { - buffer.appendInt32(-438840932) - } - fullChat.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatFull(let fullChat, let chats, let users): - return ("chatFull", [("fullChat", fullChat as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_chatFull { + public var fullChat: Api.ChatFull + public var chats: [Api.Chat] + public var users: [Api.User] + public init(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User]) { + self.fullChat = fullChat + self.chats = chats + self.users = users + } + } + case chatFull(Cons_chatFull) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatFull(let _data): + if boxed { + buffer.appendInt32(-438840932) + } + _data.fullChat.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatFull(let _data): + return ("chatFull", [("fullChat", _data.fullChat as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_chatFull(_ reader: BufferReader) -> ChatFull? { var _1: Api.ChatFull? if let signature = reader.readInt32() { @@ -539,47 +647,56 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.ChatFull.chatFull(fullChat: _1!, chats: _2!, users: _3!) + return Api.messages.ChatFull.chatFull(Cons_chatFull(fullChat: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { enum ChatInviteImporters: TypeConstructorDescription { - case chatInviteImporters(count: Int32, importers: [Api.ChatInviteImporter], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatInviteImporters(let count, let importers, let users): - if boxed { - buffer.appendInt32(-2118733814) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(importers.count)) - for item in importers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatInviteImporters(let count, let importers, let users): - return ("chatInviteImporters", [("count", count as Any), ("importers", importers as Any), ("users", users as Any)]) - } - } - + public class Cons_chatInviteImporters { + public var count: Int32 + public var importers: [Api.ChatInviteImporter] + public var users: [Api.User] + public init(count: Int32, importers: [Api.ChatInviteImporter], users: [Api.User]) { + self.count = count + self.importers = importers + self.users = users + } + } + case chatInviteImporters(Cons_chatInviteImporters) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatInviteImporters(let _data): + if boxed { + buffer.appendInt32(-2118733814) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.importers.count)) + for item in _data.importers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatInviteImporters(let _data): + return ("chatInviteImporters", [("count", _data.count as Any), ("importers", _data.importers as Any), ("users", _data.users as Any)]) + } + } + public static func parse_chatInviteImporters(_ reader: BufferReader) -> ChatInviteImporters? { var _1: Int32? _1 = reader.readInt32() @@ -595,55 +712,68 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.ChatInviteImporters.chatInviteImporters(count: _1!, importers: _2!, users: _3!) + return Api.messages.ChatInviteImporters.chatInviteImporters(Cons_chatInviteImporters(count: _1!, importers: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { enum Chats: TypeConstructorDescription { - case chats(chats: [Api.Chat]) - case chatsSlice(count: Int32, chats: [Api.Chat]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chats(let chats): - if boxed { - buffer.appendInt32(1694474197) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - break - case .chatsSlice(let count, let chats): - if boxed { - buffer.appendInt32(-1663561404) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chats(let chats): - return ("chats", [("chats", chats as Any)]) - case .chatsSlice(let count, let chats): - return ("chatsSlice", [("count", count as Any), ("chats", chats as Any)]) - } - } - + public class Cons_chats { + public var chats: [Api.Chat] + public init(chats: [Api.Chat]) { + self.chats = chats + } + } + public class Cons_chatsSlice { + public var count: Int32 + public var chats: [Api.Chat] + public init(count: Int32, chats: [Api.Chat]) { + self.count = count + self.chats = chats + } + } + case chats(Cons_chats) + case chatsSlice(Cons_chatsSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chats(let _data): + if boxed { + buffer.appendInt32(1694474197) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + break + case .chatsSlice(let _data): + if boxed { + buffer.appendInt32(-1663561404) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chats(let _data): + return ("chats", [("chats", _data.chats as Any)]) + case .chatsSlice(let _data): + return ("chatsSlice", [("count", _data.count as Any), ("chats", _data.chats as Any)]) + } + } + public static func parse_chats(_ reader: BufferReader) -> Chats? { var _1: [Api.Chat]? if let _ = reader.readInt32() { @@ -651,7 +781,7 @@ public extension Api.messages { } let _c1 = _1 != nil if _c1 { - return Api.messages.Chats.chats(chats: _1!) + return Api.messages.Chats.chats(Cons_chats(chats: _1!)) } else { return nil @@ -667,85 +797,107 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.Chats.chatsSlice(count: _1!, chats: _2!) + return Api.messages.Chats.chatsSlice(Cons_chatsSlice(count: _1!, chats: _2!)) } else { return nil } } - } } public extension Api.messages { enum CheckedHistoryImportPeer: TypeConstructorDescription { - case checkedHistoryImportPeer(confirmText: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .checkedHistoryImportPeer(let confirmText): - if boxed { - buffer.appendInt32(-1571952873) - } - serializeString(confirmText, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .checkedHistoryImportPeer(let confirmText): - return ("checkedHistoryImportPeer", [("confirmText", confirmText as Any)]) - } - } - + public class Cons_checkedHistoryImportPeer { + public var confirmText: String + public init(confirmText: String) { + self.confirmText = confirmText + } + } + case checkedHistoryImportPeer(Cons_checkedHistoryImportPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .checkedHistoryImportPeer(let _data): + if boxed { + buffer.appendInt32(-1571952873) + } + serializeString(_data.confirmText, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .checkedHistoryImportPeer(let _data): + return ("checkedHistoryImportPeer", [("confirmText", _data.confirmText as Any)]) + } + } + public static func parse_checkedHistoryImportPeer(_ reader: BufferReader) -> CheckedHistoryImportPeer? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.messages.CheckedHistoryImportPeer.checkedHistoryImportPeer(confirmText: _1!) + return Api.messages.CheckedHistoryImportPeer.checkedHistoryImportPeer(Cons_checkedHistoryImportPeer(confirmText: _1!)) } else { return nil } } - } } public extension Api.messages { enum DhConfig: TypeConstructorDescription { - case dhConfig(g: Int32, p: Buffer, version: Int32, random: Buffer) - case dhConfigNotModified(random: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dhConfig(let g, let p, let version, let random): - if boxed { - buffer.appendInt32(740433629) - } - serializeInt32(g, buffer: buffer, boxed: false) - serializeBytes(p, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - serializeBytes(random, buffer: buffer, boxed: false) - break - case .dhConfigNotModified(let random): - if boxed { - buffer.appendInt32(-1058912715) - } - serializeBytes(random, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dhConfig(let g, let p, let version, let random): - return ("dhConfig", [("g", g as Any), ("p", p as Any), ("version", version as Any), ("random", random as Any)]) - case .dhConfigNotModified(let random): - return ("dhConfigNotModified", [("random", random as Any)]) - } - } - + public class Cons_dhConfig { + public var g: Int32 + public var p: Buffer + public var version: Int32 + public var random: Buffer + public init(g: Int32, p: Buffer, version: Int32, random: Buffer) { + self.g = g + self.p = p + self.version = version + self.random = random + } + } + public class Cons_dhConfigNotModified { + public var random: Buffer + public init(random: Buffer) { + self.random = random + } + } + case dhConfig(Cons_dhConfig) + case dhConfigNotModified(Cons_dhConfigNotModified) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dhConfig(let _data): + if boxed { + buffer.appendInt32(740433629) + } + serializeInt32(_data.g, buffer: buffer, boxed: false) + serializeBytes(_data.p, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + serializeBytes(_data.random, buffer: buffer, boxed: false) + break + case .dhConfigNotModified(let _data): + if boxed { + buffer.appendInt32(-1058912715) + } + serializeBytes(_data.random, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dhConfig(let _data): + return ("dhConfig", [("g", _data.g as Any), ("p", _data.p as Any), ("version", _data.version as Any), ("random", _data.random as Any)]) + case .dhConfigNotModified(let _data): + return ("dhConfigNotModified", [("random", _data.random as Any)]) + } + } + public static func parse_dhConfig(_ reader: BufferReader) -> DhConfig? { var _1: Int32? _1 = reader.readInt32() @@ -760,7 +912,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.DhConfig.dhConfig(g: _1!, p: _2!, version: _3!, random: _4!) + return Api.messages.DhConfig.dhConfig(Cons_dhConfig(g: _1!, p: _2!, version: _3!, random: _4!)) } else { return nil @@ -771,42 +923,49 @@ public extension Api.messages { _1 = parseBytes(reader) let _c1 = _1 != nil if _c1 { - return Api.messages.DhConfig.dhConfigNotModified(random: _1!) + return Api.messages.DhConfig.dhConfigNotModified(Cons_dhConfigNotModified(random: _1!)) } else { return nil } } - } } public extension Api.messages { enum DialogFilters: TypeConstructorDescription { - case dialogFilters(flags: Int32, filters: [Api.DialogFilter]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialogFilters(let flags, let filters): - if boxed { - buffer.appendInt32(718878489) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(filters.count)) - for item in filters { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialogFilters(let flags, let filters): - return ("dialogFilters", [("flags", flags as Any), ("filters", filters as Any)]) - } - } - + public class Cons_dialogFilters { + public var flags: Int32 + public var filters: [Api.DialogFilter] + public init(flags: Int32, filters: [Api.DialogFilter]) { + self.flags = flags + self.filters = filters + } + } + case dialogFilters(Cons_dialogFilters) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialogFilters(let _data): + if boxed { + buffer.appendInt32(718878489) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.filters.count)) + for item in _data.filters { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialogFilters(let _data): + return ("dialogFilters", [("flags", _data.flags as Any), ("filters", _data.filters as Any)]) + } + } + public static func parse_dialogFilters(_ reader: BufferReader) -> DialogFilters? { var _1: Int32? _1 = reader.readInt32() @@ -817,94 +976,125 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.DialogFilters.dialogFilters(flags: _1!, filters: _2!) + return Api.messages.DialogFilters.dialogFilters(Cons_dialogFilters(flags: _1!, filters: _2!)) } else { return nil } } - } } public extension Api.messages { enum Dialogs: TypeConstructorDescription { - case dialogs(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - case dialogsNotModified(count: Int32) - case dialogsSlice(count: Int32, dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialogs(let dialogs, let messages, let chats, let users): - if boxed { - buffer.appendInt32(364538944) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dialogs.count)) - for item in dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .dialogsNotModified(let count): - if boxed { - buffer.appendInt32(-253500010) - } - serializeInt32(count, buffer: buffer, boxed: false) - break - case .dialogsSlice(let count, let dialogs, let messages, let chats, let users): - if boxed { - buffer.appendInt32(1910543603) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dialogs.count)) - for item in dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialogs(let dialogs, let messages, let chats, let users): - return ("dialogs", [("dialogs", dialogs as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - case .dialogsNotModified(let count): - return ("dialogsNotModified", [("count", count as Any)]) - case .dialogsSlice(let count, let dialogs, let messages, let chats, let users): - return ("dialogsSlice", [("count", count as Any), ("dialogs", dialogs as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_dialogs { + public var dialogs: [Api.Dialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + } + public class Cons_dialogsNotModified { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + } + public class Cons_dialogsSlice { + public var count: Int32 + public var dialogs: [Api.Dialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(count: Int32, dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.count = count + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + } + case dialogs(Cons_dialogs) + case dialogsNotModified(Cons_dialogsNotModified) + case dialogsSlice(Cons_dialogsSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialogs(let _data): + if boxed { + buffer.appendInt32(364538944) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .dialogsNotModified(let _data): + if boxed { + buffer.appendInt32(-253500010) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + case .dialogsSlice(let _data): + if boxed { + buffer.appendInt32(1910543603) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialogs(let _data): + return ("dialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .dialogsNotModified(let _data): + return ("dialogsNotModified", [("count", _data.count as Any)]) + case .dialogsSlice(let _data): + return ("dialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_dialogs(_ reader: BufferReader) -> Dialogs? { var _1: [Api.Dialog]? if let _ = reader.readInt32() { @@ -927,7 +1117,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.Dialogs.dialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!) + return Api.messages.Dialogs.dialogs(Cons_dialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) } else { return nil @@ -938,7 +1128,7 @@ public extension Api.messages { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.Dialogs.dialogsNotModified(count: _1!) + return Api.messages.Dialogs.dialogsNotModified(Cons_dialogsNotModified(count: _1!)) } else { return nil @@ -969,56 +1159,81 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.Dialogs.dialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!) + return Api.messages.Dialogs.dialogsSlice(Cons_dialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) } else { return nil } } - } } public extension Api.messages { enum DiscussionMessage: TypeConstructorDescription { - case discussionMessage(flags: Int32, messages: [Api.Message], maxId: Int32?, readInboxMaxId: Int32?, readOutboxMaxId: Int32?, unreadCount: Int32, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .discussionMessage(let flags, let messages, let maxId, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let chats, let users): - if boxed { - buffer.appendInt32(-1506535550) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(maxId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(readInboxMaxId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(readOutboxMaxId!, buffer: buffer, boxed: false)} - serializeInt32(unreadCount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .discussionMessage(let flags, let messages, let maxId, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let chats, let users): - return ("discussionMessage", [("flags", flags as Any), ("messages", messages as Any), ("maxId", maxId as Any), ("readInboxMaxId", readInboxMaxId as Any), ("readOutboxMaxId", readOutboxMaxId as Any), ("unreadCount", unreadCount as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_discussionMessage { + public var flags: Int32 + public var messages: [Api.Message] + public var maxId: Int32? + public var readInboxMaxId: Int32? + public var readOutboxMaxId: Int32? + public var unreadCount: Int32 + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, messages: [Api.Message], maxId: Int32?, readInboxMaxId: Int32?, readOutboxMaxId: Int32?, unreadCount: Int32, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.messages = messages + self.maxId = maxId + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount + self.chats = chats + self.users = users + } + } + case discussionMessage(Cons_discussionMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .discussionMessage(let _data): + if boxed { + buffer.appendInt32(-1506535550) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.maxId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.readInboxMaxId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.readOutboxMaxId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .discussionMessage(let _data): + return ("discussionMessage", [("flags", _data.flags as Any), ("messages", _data.messages as Any), ("maxId", _data.maxId as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_discussionMessage(_ reader: BufferReader) -> DiscussionMessage? { var _1: Int32? _1 = reader.readInt32() @@ -1027,11 +1242,17 @@ public extension Api.messages { _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } var _6: Int32? _6 = reader.readInt32() var _7: [Api.Chat]? @@ -1051,55 +1272,71 @@ public extension Api.messages { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.messages.DiscussionMessage.discussionMessage(flags: _1!, messages: _2!, maxId: _3, readInboxMaxId: _4, readOutboxMaxId: _5, unreadCount: _6!, chats: _7!, users: _8!) + return Api.messages.DiscussionMessage.discussionMessage(Cons_discussionMessage(flags: _1!, messages: _2!, maxId: _3, readInboxMaxId: _4, readOutboxMaxId: _5, unreadCount: _6!, chats: _7!, users: _8!)) } else { return nil } } - } } public extension Api.messages { enum EmojiGameInfo: TypeConstructorDescription { - case emojiGameDiceInfo(flags: Int32, gameHash: String, prevStake: Int64, currentStreak: Int32, params: [Int32], playsLeft: Int32?) + public class Cons_emojiGameDiceInfo { + public var flags: Int32 + public var gameHash: String + public var prevStake: Int64 + public var currentStreak: Int32 + public var params: [Int32] + public var playsLeft: Int32? + public init(flags: Int32, gameHash: String, prevStake: Int64, currentStreak: Int32, params: [Int32], playsLeft: Int32?) { + self.flags = flags + self.gameHash = gameHash + self.prevStake = prevStake + self.currentStreak = currentStreak + self.params = params + self.playsLeft = playsLeft + } + } + case emojiGameDiceInfo(Cons_emojiGameDiceInfo) case emojiGameUnavailable - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiGameDiceInfo(let flags, let gameHash, let prevStake, let currentStreak, let params, let playsLeft): - if boxed { - buffer.appendInt32(1155883043) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(gameHash, buffer: buffer, boxed: false) - serializeInt64(prevStake, buffer: buffer, boxed: false) - serializeInt32(currentStreak, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(params.count)) - for item in params { - serializeInt32(item, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(playsLeft!, buffer: buffer, boxed: false)} - break - case .emojiGameUnavailable: - if boxed { - buffer.appendInt32(1508266805) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiGameDiceInfo(let flags, let gameHash, let prevStake, let currentStreak, let params, let playsLeft): - return ("emojiGameDiceInfo", [("flags", flags as Any), ("gameHash", gameHash as Any), ("prevStake", prevStake as Any), ("currentStreak", currentStreak as Any), ("params", params as Any), ("playsLeft", playsLeft as Any)]) - case .emojiGameUnavailable: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiGameDiceInfo(let _data): + if boxed { + buffer.appendInt32(1155883043) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.gameHash, buffer: buffer, boxed: false) + serializeInt64(_data.prevStake, buffer: buffer, boxed: false) + serializeInt32(_data.currentStreak, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.params.count)) + for item in _data.params { + serializeInt32(item, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.playsLeft!, buffer: buffer, boxed: false) + } + break + case .emojiGameUnavailable: + if boxed { + buffer.appendInt32(1508266805) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiGameDiceInfo(let _data): + return ("emojiGameDiceInfo", [("flags", _data.flags as Any), ("gameHash", _data.gameHash as Any), ("prevStake", _data.prevStake as Any), ("currentStreak", _data.currentStreak as Any), ("params", _data.params as Any), ("playsLeft", _data.playsLeft as Any)]) + case .emojiGameUnavailable: return ("emojiGameUnavailable", []) - } - } - + } + } + public static func parse_emojiGameDiceInfo(_ reader: BufferReader) -> EmojiGameInfo? { var _1: Int32? _1 = reader.readInt32() @@ -1114,7 +1351,9 @@ public extension Api.messages { _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1122,7 +1361,7 @@ public extension Api.messages { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.messages.EmojiGameInfo.emojiGameDiceInfo(flags: _1!, gameHash: _2!, prevStake: _3!, currentStreak: _4!, params: _5!, playsLeft: _6) + return Api.messages.EmojiGameInfo.emojiGameDiceInfo(Cons_emojiGameDiceInfo(flags: _1!, gameHash: _2!, prevStake: _3!, currentStreak: _4!, params: _5!, playsLeft: _6)) } else { return nil @@ -1131,33 +1370,42 @@ public extension Api.messages { public static func parse_emojiGameUnavailable(_ reader: BufferReader) -> EmojiGameInfo? { return Api.messages.EmojiGameInfo.emojiGameUnavailable } - } } public extension Api.messages { enum EmojiGameOutcome: TypeConstructorDescription { - case emojiGameOutcome(seed: Buffer, stakeTonAmount: Int64, tonAmount: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiGameOutcome(let seed, let stakeTonAmount, let tonAmount): - if boxed { - buffer.appendInt32(-634726841) - } - serializeBytes(seed, buffer: buffer, boxed: false) - serializeInt64(stakeTonAmount, buffer: buffer, boxed: false) - serializeInt64(tonAmount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiGameOutcome(let seed, let stakeTonAmount, let tonAmount): - return ("emojiGameOutcome", [("seed", seed as Any), ("stakeTonAmount", stakeTonAmount as Any), ("tonAmount", tonAmount as Any)]) - } - } - + public class Cons_emojiGameOutcome { + public var seed: Buffer + public var stakeTonAmount: Int64 + public var tonAmount: Int64 + public init(seed: Buffer, stakeTonAmount: Int64, tonAmount: Int64) { + self.seed = seed + self.stakeTonAmount = stakeTonAmount + self.tonAmount = tonAmount + } + } + case emojiGameOutcome(Cons_emojiGameOutcome) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiGameOutcome(let _data): + if boxed { + buffer.appendInt32(-634726841) + } + serializeBytes(_data.seed, buffer: buffer, boxed: false) + serializeInt64(_data.stakeTonAmount, buffer: buffer, boxed: false) + serializeInt64(_data.tonAmount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiGameOutcome(let _data): + return ("emojiGameOutcome", [("seed", _data.seed as Any), ("stakeTonAmount", _data.stakeTonAmount as Any), ("tonAmount", _data.tonAmount as Any)]) + } + } + public static func parse_emojiGameOutcome(_ reader: BufferReader) -> EmojiGameOutcome? { var _1: Buffer? _1 = parseBytes(reader) @@ -1169,51 +1417,57 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.EmojiGameOutcome.emojiGameOutcome(seed: _1!, stakeTonAmount: _2!, tonAmount: _3!) + return Api.messages.EmojiGameOutcome.emojiGameOutcome(Cons_emojiGameOutcome(seed: _1!, stakeTonAmount: _2!, tonAmount: _3!)) } else { return nil } } - } } public extension Api.messages { enum EmojiGroups: TypeConstructorDescription { - case emojiGroups(hash: Int32, groups: [Api.EmojiGroup]) + public class Cons_emojiGroups { + public var hash: Int32 + public var groups: [Api.EmojiGroup] + public init(hash: Int32, groups: [Api.EmojiGroup]) { + self.hash = hash + self.groups = groups + } + } + case emojiGroups(Cons_emojiGroups) case emojiGroupsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiGroups(let hash, let groups): - if boxed { - buffer.appendInt32(-2011186869) - } - serializeInt32(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(groups.count)) - for item in groups { - item.serialize(buffer, true) - } - break - case .emojiGroupsNotModified: - if boxed { - buffer.appendInt32(1874111879) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiGroups(let hash, let groups): - return ("emojiGroups", [("hash", hash as Any), ("groups", groups as Any)]) - case .emojiGroupsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiGroups(let _data): + if boxed { + buffer.appendInt32(-2011186869) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.groups.count)) + for item in _data.groups { + item.serialize(buffer, true) + } + break + case .emojiGroupsNotModified: + if boxed { + buffer.appendInt32(1874111879) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiGroups(let _data): + return ("emojiGroups", [("hash", _data.hash as Any), ("groups", _data.groups as Any)]) + case .emojiGroupsNotModified: return ("emojiGroupsNotModified", []) - } - } - + } + } + public static func parse_emojiGroups(_ reader: BufferReader) -> EmojiGroups? { var _1: Int32? _1 = reader.readInt32() @@ -1224,7 +1478,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.EmojiGroups.emojiGroups(hash: _1!, groups: _2!) + return Api.messages.EmojiGroups.emojiGroups(Cons_emojiGroups(hash: _1!, groups: _2!)) } else { return nil @@ -1233,51 +1487,68 @@ public extension Api.messages { public static func parse_emojiGroupsNotModified(_ reader: BufferReader) -> EmojiGroups? { return Api.messages.EmojiGroups.emojiGroupsNotModified } - } } public extension Api.messages { enum ExportedChatInvite: TypeConstructorDescription { - case exportedChatInvite(invite: Api.ExportedChatInvite, users: [Api.User]) - case exportedChatInviteReplaced(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedChatInvite(let invite, let users): - if boxed { - buffer.appendInt32(410107472) - } - invite.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .exportedChatInviteReplaced(let invite, let newInvite, let users): - if boxed { - buffer.appendInt32(572915951) - } - invite.serialize(buffer, true) - newInvite.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedChatInvite(let invite, let users): - return ("exportedChatInvite", [("invite", invite as Any), ("users", users as Any)]) - case .exportedChatInviteReplaced(let invite, let newInvite, let users): - return ("exportedChatInviteReplaced", [("invite", invite as Any), ("newInvite", newInvite as Any), ("users", users as Any)]) - } - } - + public class Cons_exportedChatInvite { + public var invite: Api.ExportedChatInvite + public var users: [Api.User] + public init(invite: Api.ExportedChatInvite, users: [Api.User]) { + self.invite = invite + self.users = users + } + } + public class Cons_exportedChatInviteReplaced { + public var invite: Api.ExportedChatInvite + public var newInvite: Api.ExportedChatInvite + public var users: [Api.User] + public init(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User]) { + self.invite = invite + self.newInvite = newInvite + self.users = users + } + } + case exportedChatInvite(Cons_exportedChatInvite) + case exportedChatInviteReplaced(Cons_exportedChatInviteReplaced) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedChatInvite(let _data): + if boxed { + buffer.appendInt32(410107472) + } + _data.invite.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .exportedChatInviteReplaced(let _data): + if boxed { + buffer.appendInt32(572915951) + } + _data.invite.serialize(buffer, true) + _data.newInvite.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedChatInvite(let _data): + return ("exportedChatInvite", [("invite", _data.invite as Any), ("users", _data.users as Any)]) + case .exportedChatInviteReplaced(let _data): + return ("exportedChatInviteReplaced", [("invite", _data.invite as Any), ("newInvite", _data.newInvite as Any), ("users", _data.users as Any)]) + } + } + public static func parse_exportedChatInvite(_ reader: BufferReader) -> ExportedChatInvite? { var _1: Api.ExportedChatInvite? if let signature = reader.readInt32() { @@ -1290,7 +1561,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.ExportedChatInvite.exportedChatInvite(invite: _1!, users: _2!) + return Api.messages.ExportedChatInvite.exportedChatInvite(Cons_exportedChatInvite(invite: _1!, users: _2!)) } else { return nil @@ -1313,47 +1584,56 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!) + return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(Cons_exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { enum ExportedChatInvites: TypeConstructorDescription { - case exportedChatInvites(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedChatInvites(let count, let invites, let users): - if boxed { - buffer.appendInt32(-1111085620) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(invites.count)) - for item in invites { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedChatInvites(let count, let invites, let users): - return ("exportedChatInvites", [("count", count as Any), ("invites", invites as Any), ("users", users as Any)]) - } - } - + public class Cons_exportedChatInvites { + public var count: Int32 + public var invites: [Api.ExportedChatInvite] + public var users: [Api.User] + public init(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User]) { + self.count = count + self.invites = invites + self.users = users + } + } + case exportedChatInvites(Cons_exportedChatInvites) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedChatInvites(let _data): + if boxed { + buffer.appendInt32(-1111085620) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.invites.count)) + for item in _data.invites { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedChatInvites(let _data): + return ("exportedChatInvites", [("count", _data.count as Any), ("invites", _data.invites as Any), ("users", _data.users as Any)]) + } + } + public static func parse_exportedChatInvites(_ reader: BufferReader) -> ExportedChatInvites? { var _1: Int32? _1 = reader.readInt32() @@ -1369,12 +1649,11 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.ExportedChatInvites.exportedChatInvites(count: _1!, invites: _2!, users: _3!) + return Api.messages.ExportedChatInvites.exportedChatInvites(Cons_exportedChatInvites(count: _1!, invites: _2!, users: _3!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api35.swift b/submodules/TelegramApi/Sources/Api35.swift index 489cfe7c9d..d45e694a35 100644 --- a/submodules/TelegramApi/Sources/Api35.swift +++ b/submodules/TelegramApi/Sources/Api35.swift @@ -1,44 +1,53 @@ public extension Api.messages { enum FavedStickers: TypeConstructorDescription { - case favedStickers(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document]) + public class Cons_favedStickers { + public var hash: Int64 + public var packs: [Api.StickerPack] + public var stickers: [Api.Document] + public init(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document]) { + self.hash = hash + self.packs = packs + self.stickers = stickers + } + } + case favedStickers(Cons_favedStickers) case favedStickersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .favedStickers(let hash, let packs, let stickers): - if boxed { - buffer.appendInt32(750063767) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(packs.count)) - for item in packs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - break - case .favedStickersNotModified: - if boxed { - buffer.appendInt32(-1634752813) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .favedStickers(let hash, let packs, let stickers): - return ("favedStickers", [("hash", hash as Any), ("packs", packs as Any), ("stickers", stickers as Any)]) - case .favedStickersNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .favedStickers(let _data): + if boxed { + buffer.appendInt32(750063767) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.packs.count)) + for item in _data.packs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { + item.serialize(buffer, true) + } + break + case .favedStickersNotModified: + if boxed { + buffer.appendInt32(-1634752813) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .favedStickers(let _data): + return ("favedStickers", [("hash", _data.hash as Any), ("packs", _data.packs as Any), ("stickers", _data.stickers as Any)]) + case .favedStickersNotModified: return ("favedStickersNotModified", []) - } - } - + } + } + public static func parse_favedStickers(_ reader: BufferReader) -> FavedStickers? { var _1: Int64? _1 = reader.readInt64() @@ -54,7 +63,7 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.FavedStickers.favedStickers(hash: _1!, packs: _2!, stickers: _3!) + return Api.messages.FavedStickers.favedStickers(Cons_favedStickers(hash: _1!, packs: _2!, stickers: _3!)) } else { return nil @@ -63,52 +72,71 @@ public extension Api.messages { public static func parse_favedStickersNotModified(_ reader: BufferReader) -> FavedStickers? { return Api.messages.FavedStickers.favedStickersNotModified } - } } public extension Api.messages { enum FeaturedStickers: TypeConstructorDescription { - case featuredStickers(flags: Int32, hash: Int64, count: Int32, sets: [Api.StickerSetCovered], unread: [Int64]) - case featuredStickersNotModified(count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .featuredStickers(let flags, let hash, let count, let sets, let unread): - if boxed { - buffer.appendInt32(-1103615738) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(unread.count)) - for item in unread { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .featuredStickersNotModified(let count): - if boxed { - buffer.appendInt32(-958657434) - } - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .featuredStickers(let flags, let hash, let count, let sets, let unread): - return ("featuredStickers", [("flags", flags as Any), ("hash", hash as Any), ("count", count as Any), ("sets", sets as Any), ("unread", unread as Any)]) - case .featuredStickersNotModified(let count): - return ("featuredStickersNotModified", [("count", count as Any)]) - } - } - + public class Cons_featuredStickers { + public var flags: Int32 + public var hash: Int64 + public var count: Int32 + public var sets: [Api.StickerSetCovered] + public var unread: [Int64] + public init(flags: Int32, hash: Int64, count: Int32, sets: [Api.StickerSetCovered], unread: [Int64]) { + self.flags = flags + self.hash = hash + self.count = count + self.sets = sets + self.unread = unread + } + } + public class Cons_featuredStickersNotModified { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + } + case featuredStickers(Cons_featuredStickers) + case featuredStickersNotModified(Cons_featuredStickersNotModified) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .featuredStickers(let _data): + if boxed { + buffer.appendInt32(-1103615738) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.unread.count)) + for item in _data.unread { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .featuredStickersNotModified(let _data): + if boxed { + buffer.appendInt32(-958657434) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .featuredStickers(let _data): + return ("featuredStickers", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("count", _data.count as Any), ("sets", _data.sets as Any), ("unread", _data.unread as Any)]) + case .featuredStickersNotModified(let _data): + return ("featuredStickersNotModified", [("count", _data.count as Any)]) + } + } + public static func parse_featuredStickers(_ reader: BufferReader) -> FeaturedStickers? { var _1: Int32? _1 = reader.readInt32() @@ -130,7 +158,7 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.FeaturedStickers.featuredStickers(flags: _1!, hash: _2!, count: _3!, sets: _4!, unread: _5!) + return Api.messages.FeaturedStickers.featuredStickers(Cons_featuredStickers(flags: _1!, hash: _2!, count: _3!, sets: _4!, unread: _5!)) } else { return nil @@ -141,59 +169,76 @@ public extension Api.messages { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.FeaturedStickers.featuredStickersNotModified(count: _1!) + return Api.messages.FeaturedStickers.featuredStickersNotModified(Cons_featuredStickersNotModified(count: _1!)) } else { return nil } } - } } public extension Api.messages { enum ForumTopics: TypeConstructorDescription { - case forumTopics(flags: Int32, count: Int32, topics: [Api.ForumTopic], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], pts: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .forumTopics(let flags, let count, let topics, let messages, let chats, let users, let pts): - if boxed { - buffer.appendInt32(913709011) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topics.count)) - for item in topics { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - serializeInt32(pts, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .forumTopics(let flags, let count, let topics, let messages, let chats, let users, let pts): - return ("forumTopics", [("flags", flags as Any), ("count", count as Any), ("topics", topics as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any), ("pts", pts as Any)]) - } - } - + public class Cons_forumTopics { + public var flags: Int32 + public var count: Int32 + public var topics: [Api.ForumTopic] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public var pts: Int32 + public init(flags: Int32, count: Int32, topics: [Api.ForumTopic], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], pts: Int32) { + self.flags = flags + self.count = count + self.topics = topics + self.messages = messages + self.chats = chats + self.users = users + self.pts = pts + } + } + case forumTopics(Cons_forumTopics) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .forumTopics(let _data): + if boxed { + buffer.appendInt32(913709011) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topics.count)) + for item in _data.topics { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .forumTopics(let _data): + return ("forumTopics", [("flags", _data.flags as Any), ("count", _data.count as Any), ("topics", _data.topics as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("pts", _data.pts as Any)]) + } + } + public static func parse_forumTopics(_ reader: BufferReader) -> ForumTopics? { var _1: Int32? _1 = reader.readInt32() @@ -225,51 +270,57 @@ public extension Api.messages { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.messages.ForumTopics.forumTopics(flags: _1!, count: _2!, topics: _3!, messages: _4!, chats: _5!, users: _6!, pts: _7!) + return Api.messages.ForumTopics.forumTopics(Cons_forumTopics(flags: _1!, count: _2!, topics: _3!, messages: _4!, chats: _5!, users: _6!, pts: _7!)) } else { return nil } } - } } public extension Api.messages { enum FoundStickerSets: TypeConstructorDescription { - case foundStickerSets(hash: Int64, sets: [Api.StickerSetCovered]) + public class Cons_foundStickerSets { + public var hash: Int64 + public var sets: [Api.StickerSetCovered] + public init(hash: Int64, sets: [Api.StickerSetCovered]) { + self.hash = hash + self.sets = sets + } + } + case foundStickerSets(Cons_foundStickerSets) case foundStickerSetsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .foundStickerSets(let hash, let sets): - if boxed { - buffer.appendInt32(-1963942446) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - break - case .foundStickerSetsNotModified: - if boxed { - buffer.appendInt32(223655517) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .foundStickerSets(let hash, let sets): - return ("foundStickerSets", [("hash", hash as Any), ("sets", sets as Any)]) - case .foundStickerSetsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .foundStickerSets(let _data): + if boxed { + buffer.appendInt32(-1963942446) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + break + case .foundStickerSetsNotModified: + if boxed { + buffer.appendInt32(223655517) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .foundStickerSets(let _data): + return ("foundStickerSets", [("hash", _data.hash as Any), ("sets", _data.sets as Any)]) + case .foundStickerSetsNotModified: return ("foundStickerSetsNotModified", []) - } - } - + } + } + public static func parse_foundStickerSets(_ reader: BufferReader) -> FoundStickerSets? { var _1: Int64? _1 = reader.readInt64() @@ -280,7 +331,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.FoundStickerSets.foundStickerSets(hash: _1!, sets: _2!) + return Api.messages.FoundStickerSets.foundStickerSets(Cons_foundStickerSets(hash: _1!, sets: _2!)) } else { return nil @@ -289,53 +340,78 @@ public extension Api.messages { public static func parse_foundStickerSetsNotModified(_ reader: BufferReader) -> FoundStickerSets? { return Api.messages.FoundStickerSets.foundStickerSetsNotModified } - } } public extension Api.messages { enum FoundStickers: TypeConstructorDescription { - case foundStickers(flags: Int32, nextOffset: Int32?, hash: Int64, stickers: [Api.Document]) - case foundStickersNotModified(flags: Int32, nextOffset: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .foundStickers(let flags, let nextOffset, let hash, let stickers): - if boxed { - buffer.appendInt32(-2100698480) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(nextOffset!, buffer: buffer, boxed: false)} - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - break - case .foundStickersNotModified(let flags, let nextOffset): - if boxed { - buffer.appendInt32(1611711796) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .foundStickers(let flags, let nextOffset, let hash, let stickers): - return ("foundStickers", [("flags", flags as Any), ("nextOffset", nextOffset as Any), ("hash", hash as Any), ("stickers", stickers as Any)]) - case .foundStickersNotModified(let flags, let nextOffset): - return ("foundStickersNotModified", [("flags", flags as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_foundStickers { + public var flags: Int32 + public var nextOffset: Int32? + public var hash: Int64 + public var stickers: [Api.Document] + public init(flags: Int32, nextOffset: Int32?, hash: Int64, stickers: [Api.Document]) { + self.flags = flags + self.nextOffset = nextOffset + self.hash = hash + self.stickers = stickers + } + } + public class Cons_foundStickersNotModified { + public var flags: Int32 + public var nextOffset: Int32? + public init(flags: Int32, nextOffset: Int32?) { + self.flags = flags + self.nextOffset = nextOffset + } + } + case foundStickers(Cons_foundStickers) + case foundStickersNotModified(Cons_foundStickersNotModified) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .foundStickers(let _data): + if boxed { + buffer.appendInt32(-2100698480) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.nextOffset!, buffer: buffer, boxed: false) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { + item.serialize(buffer, true) + } + break + case .foundStickersNotModified(let _data): + if boxed { + buffer.appendInt32(1611711796) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .foundStickers(let _data): + return ("foundStickers", [("flags", _data.flags as Any), ("nextOffset", _data.nextOffset as Any), ("hash", _data.hash as Any), ("stickers", _data.stickers as Any)]) + case .foundStickersNotModified(let _data): + return ("foundStickersNotModified", [("flags", _data.flags as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_foundStickers(_ reader: BufferReader) -> FoundStickers? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int64? _3 = reader.readInt64() var _4: [Api.Document]? @@ -347,7 +423,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.FoundStickers.foundStickers(flags: _1!, nextOffset: _2, hash: _3!, stickers: _4!) + return Api.messages.FoundStickers.foundStickers(Cons_foundStickers(flags: _1!, nextOffset: _2, hash: _3!, stickers: _4!)) } else { return nil @@ -357,50 +433,59 @@ public extension Api.messages { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.messages.FoundStickers.foundStickersNotModified(flags: _1!, nextOffset: _2) + return Api.messages.FoundStickers.foundStickersNotModified(Cons_foundStickersNotModified(flags: _1!, nextOffset: _2)) } else { return nil } } - } } public extension Api.messages { enum HighScores: TypeConstructorDescription { - case highScores(scores: [Api.HighScore], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .highScores(let scores, let users): - if boxed { - buffer.appendInt32(-1707344487) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(scores.count)) - for item in scores { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .highScores(let scores, let users): - return ("highScores", [("scores", scores as Any), ("users", users as Any)]) - } - } - + public class Cons_highScores { + public var scores: [Api.HighScore] + public var users: [Api.User] + public init(scores: [Api.HighScore], users: [Api.User]) { + self.scores = scores + self.users = users + } + } + case highScores(Cons_highScores) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .highScores(let _data): + if boxed { + buffer.appendInt32(-1707344487) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.scores.count)) + for item in _data.scores { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .highScores(let _data): + return ("highScores", [("scores", _data.scores as Any), ("users", _data.users as Any)]) + } + } + public static func parse_highScores(_ reader: BufferReader) -> HighScores? { var _1: [Api.HighScore]? if let _ = reader.readInt32() { @@ -413,127 +498,152 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.HighScores.highScores(scores: _1!, users: _2!) + return Api.messages.HighScores.highScores(Cons_highScores(scores: _1!, users: _2!)) } else { return nil } } - } } public extension Api.messages { enum HistoryImport: TypeConstructorDescription { - case historyImport(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .historyImport(let id): - if boxed { - buffer.appendInt32(375566091) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .historyImport(let id): - return ("historyImport", [("id", id as Any)]) - } - } - + public class Cons_historyImport { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + case historyImport(Cons_historyImport) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .historyImport(let _data): + if boxed { + buffer.appendInt32(375566091) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .historyImport(let _data): + return ("historyImport", [("id", _data.id as Any)]) + } + } + public static func parse_historyImport(_ reader: BufferReader) -> HistoryImport? { var _1: Int64? _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.messages.HistoryImport.historyImport(id: _1!) + return Api.messages.HistoryImport.historyImport(Cons_historyImport(id: _1!)) } else { return nil } } - } } public extension Api.messages { enum HistoryImportParsed: TypeConstructorDescription { - case historyImportParsed(flags: Int32, title: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .historyImportParsed(let flags, let title): - if boxed { - buffer.appendInt32(1578088377) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .historyImportParsed(let flags, let title): - return ("historyImportParsed", [("flags", flags as Any), ("title", title as Any)]) - } - } - + public class Cons_historyImportParsed { + public var flags: Int32 + public var title: String? + public init(flags: Int32, title: String?) { + self.flags = flags + self.title = title + } + } + case historyImportParsed(Cons_historyImportParsed) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .historyImportParsed(let _data): + if boxed { + buffer.appendInt32(1578088377) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .historyImportParsed(let _data): + return ("historyImportParsed", [("flags", _data.flags as Any), ("title", _data.title as Any)]) + } + } + public static func parse_historyImportParsed(_ reader: BufferReader) -> HistoryImportParsed? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 2) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _2 = parseString(reader) + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil if _c1 && _c2 { - return Api.messages.HistoryImportParsed.historyImportParsed(flags: _1!, title: _2) + return Api.messages.HistoryImportParsed.historyImportParsed(Cons_historyImportParsed(flags: _1!, title: _2)) } else { return nil } } - } } public extension Api.messages { enum InactiveChats: TypeConstructorDescription { - case inactiveChats(dates: [Int32], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inactiveChats(let dates, let chats, let users): - if boxed { - buffer.appendInt32(-1456996667) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dates.count)) - for item in dates { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inactiveChats(let dates, let chats, let users): - return ("inactiveChats", [("dates", dates as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_inactiveChats { + public var dates: [Int32] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(dates: [Int32], chats: [Api.Chat], users: [Api.User]) { + self.dates = dates + self.chats = chats + self.users = users + } + } + case inactiveChats(Cons_inactiveChats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inactiveChats(let _data): + if boxed { + buffer.appendInt32(-1456996667) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dates.count)) + for item in _data.dates { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inactiveChats(let _data): + return ("inactiveChats", [("dates", _data.dates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_inactiveChats(_ reader: BufferReader) -> InactiveChats? { var _1: [Int32]? if let _ = reader.readInt32() { @@ -551,42 +661,49 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.InactiveChats.inactiveChats(dates: _1!, chats: _2!, users: _3!) + return Api.messages.InactiveChats.inactiveChats(Cons_inactiveChats(dates: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { indirect enum InvitedUsers: TypeConstructorDescription { - case invitedUsers(updates: Api.Updates, missingInvitees: [Api.MissingInvitee]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .invitedUsers(let updates, let missingInvitees): - if boxed { - buffer.appendInt32(2136862630) - } - updates.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(missingInvitees.count)) - for item in missingInvitees { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .invitedUsers(let updates, let missingInvitees): - return ("invitedUsers", [("updates", updates as Any), ("missingInvitees", missingInvitees as Any)]) - } - } - + public class Cons_invitedUsers { + public var updates: Api.Updates + public var missingInvitees: [Api.MissingInvitee] + public init(updates: Api.Updates, missingInvitees: [Api.MissingInvitee]) { + self.updates = updates + self.missingInvitees = missingInvitees + } + } + case invitedUsers(Cons_invitedUsers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .invitedUsers(let _data): + if boxed { + buffer.appendInt32(2136862630) + } + _data.updates.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.missingInvitees.count)) + for item in _data.missingInvitees { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .invitedUsers(let _data): + return ("invitedUsers", [("updates", _data.updates as Any), ("missingInvitees", _data.missingInvitees as Any)]) + } + } + public static func parse_invitedUsers(_ reader: BufferReader) -> InvitedUsers? { var _1: Api.Updates? if let signature = reader.readInt32() { @@ -599,90 +716,112 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.InvitedUsers.invitedUsers(updates: _1!, missingInvitees: _2!) + return Api.messages.InvitedUsers.invitedUsers(Cons_invitedUsers(updates: _1!, missingInvitees: _2!)) } else { return nil } } - } } public extension Api.messages { enum MessageEditData: TypeConstructorDescription { - case messageEditData(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageEditData(let flags): - if boxed { - buffer.appendInt32(649453030) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageEditData(let flags): - return ("messageEditData", [("flags", flags as Any)]) - } - } - + public class Cons_messageEditData { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case messageEditData(Cons_messageEditData) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageEditData(let _data): + if boxed { + buffer.appendInt32(649453030) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageEditData(let _data): + return ("messageEditData", [("flags", _data.flags as Any)]) + } + } + public static func parse_messageEditData(_ reader: BufferReader) -> MessageEditData? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.MessageEditData.messageEditData(flags: _1!) + return Api.messages.MessageEditData.messageEditData(Cons_messageEditData(flags: _1!)) } else { return nil } } - } } public extension Api.messages { enum MessageReactionsList: TypeConstructorDescription { - case messageReactionsList(flags: Int32, count: Int32, reactions: [Api.MessagePeerReaction], chats: [Api.Chat], users: [Api.User], nextOffset: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageReactionsList(let flags, let count, let reactions, let chats, let users, let nextOffset): - if boxed { - buffer.appendInt32(834488621) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageReactionsList(let flags, let count, let reactions, let chats, let users, let nextOffset): - return ("messageReactionsList", [("flags", flags as Any), ("count", count as Any), ("reactions", reactions as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_messageReactionsList { + public var flags: Int32 + public var count: Int32 + public var reactions: [Api.MessagePeerReaction] + public var chats: [Api.Chat] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, count: Int32, reactions: [Api.MessagePeerReaction], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.count = count + self.reactions = reactions + self.chats = chats + self.users = users + self.nextOffset = nextOffset + } + } + case messageReactionsList(Cons_messageReactionsList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageReactionsList(let _data): + if boxed { + buffer.appendInt32(834488621) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageReactionsList(let _data): + return ("messageReactionsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("reactions", _data.reactions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_messageReactionsList(_ reader: BufferReader) -> MessageReactionsList? { var _1: Int32? _1 = reader.readInt32() @@ -701,7 +840,9 @@ public extension Api.messages { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -709,51 +850,60 @@ public extension Api.messages { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.messages.MessageReactionsList.messageReactionsList(flags: _1!, count: _2!, reactions: _3!, chats: _4!, users: _5!, nextOffset: _6) + return Api.messages.MessageReactionsList.messageReactionsList(Cons_messageReactionsList(flags: _1!, count: _2!, reactions: _3!, chats: _4!, users: _5!, nextOffset: _6)) } else { return nil } } - } } public extension Api.messages { enum MessageViews: TypeConstructorDescription { - case messageViews(views: [Api.MessageViews], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageViews(let views, let chats, let users): - if boxed { - buffer.appendInt32(-1228606141) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(views.count)) - for item in views { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageViews(let views, let chats, let users): - return ("messageViews", [("views", views as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_messageViews { + public var views: [Api.MessageViews] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(views: [Api.MessageViews], chats: [Api.Chat], users: [Api.User]) { + self.views = views + self.chats = chats + self.users = users + } + } + case messageViews(Cons_messageViews) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageViews(let _data): + if boxed { + buffer.appendInt32(-1228606141) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.views.count)) + for item in _data.views { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageViews(let _data): + return ("messageViews", [("views", _data.views as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { var _1: [Api.MessageViews]? if let _ = reader.readInt32() { @@ -771,130 +921,197 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.MessageViews.messageViews(views: _1!, chats: _2!, users: _3!) + return Api.messages.MessageViews.messageViews(Cons_messageViews(views: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { enum Messages: TypeConstructorDescription { - case channelMessages(flags: Int32, pts: Int32, count: Int32, offsetIdOffset: Int32?, messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) - case messages(messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) - case messagesNotModified(count: Int32) - case messagesSlice(flags: Int32, count: Int32, nextRate: Int32?, offsetIdOffset: Int32?, searchFlood: Api.SearchPostsFlood?, messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelMessages(let flags, let pts, let count, let offsetIdOffset, let messages, let topics, let chats, let users): - if boxed { - buffer.appendInt32(-948520370) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(offsetIdOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topics.count)) - for item in topics { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .messages(let messages, let topics, let chats, let users): - if boxed { - buffer.appendInt32(494135274) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topics.count)) - for item in topics { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .messagesNotModified(let count): - if boxed { - buffer.appendInt32(1951620897) - } - serializeInt32(count, buffer: buffer, boxed: false) - break - case .messagesSlice(let flags, let count, let nextRate, let offsetIdOffset, let searchFlood, let messages, let topics, let chats, let users): - if boxed { - buffer.appendInt32(1595959062) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(nextRate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(offsetIdOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {searchFlood!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topics.count)) - for item in topics { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelMessages(let flags, let pts, let count, let offsetIdOffset, let messages, let topics, let chats, let users): - return ("channelMessages", [("flags", flags as Any), ("pts", pts as Any), ("count", count as Any), ("offsetIdOffset", offsetIdOffset as Any), ("messages", messages as Any), ("topics", topics as Any), ("chats", chats as Any), ("users", users as Any)]) - case .messages(let messages, let topics, let chats, let users): - return ("messages", [("messages", messages as Any), ("topics", topics as Any), ("chats", chats as Any), ("users", users as Any)]) - case .messagesNotModified(let count): - return ("messagesNotModified", [("count", count as Any)]) - case .messagesSlice(let flags, let count, let nextRate, let offsetIdOffset, let searchFlood, let messages, let topics, let chats, let users): - return ("messagesSlice", [("flags", flags as Any), ("count", count as Any), ("nextRate", nextRate as Any), ("offsetIdOffset", offsetIdOffset as Any), ("searchFlood", searchFlood as Any), ("messages", messages as Any), ("topics", topics as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_channelMessages { + public var flags: Int32 + public var pts: Int32 + public var count: Int32 + public var offsetIdOffset: Int32? + public var messages: [Api.Message] + public var topics: [Api.ForumTopic] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, pts: Int32, count: Int32, offsetIdOffset: Int32?, messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.pts = pts + self.count = count + self.offsetIdOffset = offsetIdOffset + self.messages = messages + self.topics = topics + self.chats = chats + self.users = users + } + } + public class Cons_messages { + public var messages: [Api.Message] + public var topics: [Api.ForumTopic] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) { + self.messages = messages + self.topics = topics + self.chats = chats + self.users = users + } + } + public class Cons_messagesNotModified { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + } + public class Cons_messagesSlice { + public var flags: Int32 + public var count: Int32 + public var nextRate: Int32? + public var offsetIdOffset: Int32? + public var searchFlood: Api.SearchPostsFlood? + public var messages: [Api.Message] + public var topics: [Api.ForumTopic] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, nextRate: Int32?, offsetIdOffset: Int32?, searchFlood: Api.SearchPostsFlood?, messages: [Api.Message], topics: [Api.ForumTopic], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.nextRate = nextRate + self.offsetIdOffset = offsetIdOffset + self.searchFlood = searchFlood + self.messages = messages + self.topics = topics + self.chats = chats + self.users = users + } + } + case channelMessages(Cons_channelMessages) + case messages(Cons_messages) + case messagesNotModified(Cons_messagesNotModified) + case messagesSlice(Cons_messagesSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelMessages(let _data): + if boxed { + buffer.appendInt32(-948520370) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.offsetIdOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topics.count)) + for item in _data.topics { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .messages(let _data): + if boxed { + buffer.appendInt32(494135274) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topics.count)) + for item in _data.topics { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .messagesNotModified(let _data): + if boxed { + buffer.appendInt32(1951620897) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + case .messagesSlice(let _data): + if boxed { + buffer.appendInt32(1595959062) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.nextRate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.offsetIdOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.searchFlood!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topics.count)) + for item in _data.topics { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelMessages(let _data): + return ("channelMessages", [("flags", _data.flags as Any), ("pts", _data.pts as Any), ("count", _data.count as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("messages", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .messages(let _data): + return ("messages", [("messages", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .messagesNotModified(let _data): + return ("messagesNotModified", [("count", _data.count as Any)]) + case .messagesSlice(let _data): + return ("messagesSlice", [("flags", _data.flags as Any), ("count", _data.count as Any), ("nextRate", _data.nextRate as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("searchFlood", _data.searchFlood as Any), ("messages", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_channelMessages(_ reader: BufferReader) -> Messages? { var _1: Int32? _1 = reader.readInt32() @@ -903,7 +1120,9 @@ public extension Api.messages { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: [Api.Message]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) @@ -929,7 +1148,7 @@ public extension Api.messages { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.messages.Messages.channelMessages(flags: _1!, pts: _2!, count: _3!, offsetIdOffset: _4, messages: _5!, topics: _6!, chats: _7!, users: _8!) + return Api.messages.Messages.channelMessages(Cons_channelMessages(flags: _1!, pts: _2!, count: _3!, offsetIdOffset: _4, messages: _5!, topics: _6!, chats: _7!, users: _8!)) } else { return nil @@ -957,7 +1176,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.Messages.messages(messages: _1!, topics: _2!, chats: _3!, users: _4!) + return Api.messages.Messages.messages(Cons_messages(messages: _1!, topics: _2!, chats: _3!, users: _4!)) } else { return nil @@ -968,7 +1187,7 @@ public extension Api.messages { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.Messages.messagesNotModified(count: _1!) + return Api.messages.Messages.messagesNotModified(Cons_messagesNotModified(count: _1!)) } else { return nil @@ -980,13 +1199,19 @@ public extension Api.messages { var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: Api.SearchPostsFlood? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.SearchPostsFlood - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.SearchPostsFlood + } + } var _6: [Api.Message]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) @@ -1013,42 +1238,49 @@ public extension Api.messages { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.messages.Messages.messagesSlice(flags: _1!, count: _2!, nextRate: _3, offsetIdOffset: _4, searchFlood: _5, messages: _6!, topics: _7!, chats: _8!, users: _9!) + return Api.messages.Messages.messagesSlice(Cons_messagesSlice(flags: _1!, count: _2!, nextRate: _3, offsetIdOffset: _4, searchFlood: _5, messages: _6!, topics: _7!, chats: _8!, users: _9!)) } else { return nil } } - } } public extension Api.messages { enum MyStickers: TypeConstructorDescription { - case myStickers(count: Int32, sets: [Api.StickerSetCovered]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .myStickers(let count, let sets): - if boxed { - buffer.appendInt32(-83926371) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .myStickers(let count, let sets): - return ("myStickers", [("count", count as Any), ("sets", sets as Any)]) - } - } - + public class Cons_myStickers { + public var count: Int32 + public var sets: [Api.StickerSetCovered] + public init(count: Int32, sets: [Api.StickerSetCovered]) { + self.count = count + self.sets = sets + } + } + case myStickers(Cons_myStickers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .myStickers(let _data): + if boxed { + buffer.appendInt32(-83926371) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .myStickers(let _data): + return ("myStickers", [("count", _data.count as Any), ("sets", _data.sets as Any)]) + } + } + public static func parse_myStickers(_ reader: BufferReader) -> MyStickers? { var _1: Int32? _1 = reader.readInt32() @@ -1059,57 +1291,70 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.MyStickers.myStickers(count: _1!, sets: _2!) + return Api.messages.MyStickers.myStickers(Cons_myStickers(count: _1!, sets: _2!)) } else { return nil } } - } } public extension Api.messages { enum PeerDialogs: TypeConstructorDescription { - case peerDialogs(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerDialogs(let dialogs, let messages, let chats, let users, let state): - if boxed { - buffer.appendInt32(863093588) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dialogs.count)) - for item in dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - state.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerDialogs(let dialogs, let messages, let chats, let users, let state): - return ("peerDialogs", [("dialogs", dialogs as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any), ("state", state as Any)]) - } - } - + public class Cons_peerDialogs { + public var dialogs: [Api.Dialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public var state: Api.updates.State + public init(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) { + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + self.state = state + } + } + case peerDialogs(Cons_peerDialogs) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerDialogs(let _data): + if boxed { + buffer.appendInt32(863093588) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + _data.state.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerDialogs(let _data): + return ("peerDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("state", _data.state as Any)]) + } + } + public static func parse_peerDialogs(_ reader: BufferReader) -> PeerDialogs? { var _1: [Api.Dialog]? if let _ = reader.readInt32() { @@ -1137,47 +1382,56 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.PeerDialogs.peerDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!, state: _5!) + return Api.messages.PeerDialogs.peerDialogs(Cons_peerDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!, state: _5!)) } else { return nil } } - } } public extension Api.messages { enum PeerSettings: TypeConstructorDescription { - case peerSettings(settings: Api.PeerSettings, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerSettings(let settings, let chats, let users): - if boxed { - buffer.appendInt32(1753266509) - } - settings.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerSettings(let settings, let chats, let users): - return ("peerSettings", [("settings", settings as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_peerSettings { + public var settings: Api.PeerSettings + public var chats: [Api.Chat] + public var users: [Api.User] + public init(settings: Api.PeerSettings, chats: [Api.Chat], users: [Api.User]) { + self.settings = settings + self.chats = chats + self.users = users + } + } + case peerSettings(Cons_peerSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerSettings(let _data): + if boxed { + buffer.appendInt32(1753266509) + } + _data.settings.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerSettings(let _data): + return ("peerSettings", [("settings", _data.settings as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { var _1: Api.PeerSettings? if let signature = reader.readInt32() { @@ -1195,49 +1449,62 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.PeerSettings.peerSettings(settings: _1!, chats: _2!, users: _3!) + return Api.messages.PeerSettings.peerSettings(Cons_peerSettings(settings: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { enum PreparedInlineMessage: TypeConstructorDescription { - case preparedInlineMessage(queryId: Int64, result: Api.BotInlineResult, peerTypes: [Api.InlineQueryPeerType], cacheTime: Int32, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .preparedInlineMessage(let queryId, let result, let peerTypes, let cacheTime, let users): - if boxed { - buffer.appendInt32(-11046771) - } - serializeInt64(queryId, buffer: buffer, boxed: false) - result.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peerTypes.count)) - for item in peerTypes { - item.serialize(buffer, true) - } - serializeInt32(cacheTime, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .preparedInlineMessage(let queryId, let result, let peerTypes, let cacheTime, let users): - return ("preparedInlineMessage", [("queryId", queryId as Any), ("result", result as Any), ("peerTypes", peerTypes as Any), ("cacheTime", cacheTime as Any), ("users", users as Any)]) - } - } - + public class Cons_preparedInlineMessage { + public var queryId: Int64 + public var result: Api.BotInlineResult + public var peerTypes: [Api.InlineQueryPeerType] + public var cacheTime: Int32 + public var users: [Api.User] + public init(queryId: Int64, result: Api.BotInlineResult, peerTypes: [Api.InlineQueryPeerType], cacheTime: Int32, users: [Api.User]) { + self.queryId = queryId + self.result = result + self.peerTypes = peerTypes + self.cacheTime = cacheTime + self.users = users + } + } + case preparedInlineMessage(Cons_preparedInlineMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .preparedInlineMessage(let _data): + if boxed { + buffer.appendInt32(-11046771) + } + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + _data.result.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peerTypes.count)) + for item in _data.peerTypes { + item.serialize(buffer, true) + } + serializeInt32(_data.cacheTime, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .preparedInlineMessage(let _data): + return ("preparedInlineMessage", [("queryId", _data.queryId as Any), ("result", _data.result as Any), ("peerTypes", _data.peerTypes as Any), ("cacheTime", _data.cacheTime as Any), ("users", _data.users as Any)]) + } + } + public static func parse_preparedInlineMessage(_ reader: BufferReader) -> PreparedInlineMessage? { var _1: Int64? _1 = reader.readInt64() @@ -1261,65 +1528,75 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.PreparedInlineMessage.preparedInlineMessage(queryId: _1!, result: _2!, peerTypes: _3!, cacheTime: _4!, users: _5!) + return Api.messages.PreparedInlineMessage.preparedInlineMessage(Cons_preparedInlineMessage(queryId: _1!, result: _2!, peerTypes: _3!, cacheTime: _4!, users: _5!)) } else { return nil } } - } } public extension Api.messages { enum QuickReplies: TypeConstructorDescription { - case quickReplies(quickReplies: [Api.QuickReply], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) + public class Cons_quickReplies { + public var quickReplies: [Api.QuickReply] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(quickReplies: [Api.QuickReply], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.quickReplies = quickReplies + self.messages = messages + self.chats = chats + self.users = users + } + } + case quickReplies(Cons_quickReplies) case quickRepliesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .quickReplies(let quickReplies, let messages, let chats, let users): - if boxed { - buffer.appendInt32(-963811691) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(quickReplies.count)) - for item in quickReplies { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .quickRepliesNotModified: - if boxed { - buffer.appendInt32(1603398491) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .quickReplies(let quickReplies, let messages, let chats, let users): - return ("quickReplies", [("quickReplies", quickReplies as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - case .quickRepliesNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .quickReplies(let _data): + if boxed { + buffer.appendInt32(-963811691) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.quickReplies.count)) + for item in _data.quickReplies { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .quickRepliesNotModified: + if boxed { + buffer.appendInt32(1603398491) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .quickReplies(let _data): + return ("quickReplies", [("quickReplies", _data.quickReplies as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .quickRepliesNotModified: return ("quickRepliesNotModified", []) - } - } - + } + } + public static func parse_quickReplies(_ reader: BufferReader) -> QuickReplies? { var _1: [Api.QuickReply]? if let _ = reader.readInt32() { @@ -1342,7 +1619,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.QuickReplies.quickReplies(quickReplies: _1!, messages: _2!, chats: _3!, users: _4!) + return Api.messages.QuickReplies.quickReplies(Cons_quickReplies(quickReplies: _1!, messages: _2!, chats: _3!, users: _4!)) } else { return nil @@ -1351,45 +1628,51 @@ public extension Api.messages { public static func parse_quickRepliesNotModified(_ reader: BufferReader) -> QuickReplies? { return Api.messages.QuickReplies.quickRepliesNotModified } - } } public extension Api.messages { enum Reactions: TypeConstructorDescription { - case reactions(hash: Int64, reactions: [Api.Reaction]) + public class Cons_reactions { + public var hash: Int64 + public var reactions: [Api.Reaction] + public init(hash: Int64, reactions: [Api.Reaction]) { + self.hash = hash + self.reactions = reactions + } + } + case reactions(Cons_reactions) case reactionsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactions(let hash, let reactions): - if boxed { - buffer.appendInt32(-352454890) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - break - case .reactionsNotModified: - if boxed { - buffer.appendInt32(-1334846497) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactions(let hash, let reactions): - return ("reactions", [("hash", hash as Any), ("reactions", reactions as Any)]) - case .reactionsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactions(let _data): + if boxed { + buffer.appendInt32(-352454890) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + break + case .reactionsNotModified: + if boxed { + buffer.appendInt32(-1334846497) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .reactions(let _data): + return ("reactions", [("hash", _data.hash as Any), ("reactions", _data.reactions as Any)]) + case .reactionsNotModified: return ("reactionsNotModified", []) - } - } - + } + } + public static func parse_reactions(_ reader: BufferReader) -> Reactions? { var _1: Int64? _1 = reader.readInt64() @@ -1400,7 +1683,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.Reactions.reactions(hash: _1!, reactions: _2!) + return Api.messages.Reactions.reactions(Cons_reactions(hash: _1!, reactions: _2!)) } else { return nil @@ -1409,55 +1692,65 @@ public extension Api.messages { public static func parse_reactionsNotModified(_ reader: BufferReader) -> Reactions? { return Api.messages.Reactions.reactionsNotModified } - } } public extension Api.messages { enum RecentStickers: TypeConstructorDescription { - case recentStickers(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document], dates: [Int32]) + public class Cons_recentStickers { + public var hash: Int64 + public var packs: [Api.StickerPack] + public var stickers: [Api.Document] + public var dates: [Int32] + public init(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document], dates: [Int32]) { + self.hash = hash + self.packs = packs + self.stickers = stickers + self.dates = dates + } + } + case recentStickers(Cons_recentStickers) case recentStickersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .recentStickers(let hash, let packs, let stickers, let dates): - if boxed { - buffer.appendInt32(-1999405994) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(packs.count)) - for item in packs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dates.count)) - for item in dates { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - case .recentStickersNotModified: - if boxed { - buffer.appendInt32(186120336) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .recentStickers(let hash, let packs, let stickers, let dates): - return ("recentStickers", [("hash", hash as Any), ("packs", packs as Any), ("stickers", stickers as Any), ("dates", dates as Any)]) - case .recentStickersNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .recentStickers(let _data): + if boxed { + buffer.appendInt32(-1999405994) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.packs.count)) + for item in _data.packs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dates.count)) + for item in _data.dates { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + case .recentStickersNotModified: + if boxed { + buffer.appendInt32(186120336) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .recentStickers(let _data): + return ("recentStickers", [("hash", _data.hash as Any), ("packs", _data.packs as Any), ("stickers", _data.stickers as Any), ("dates", _data.dates as Any)]) + case .recentStickersNotModified: return ("recentStickersNotModified", []) - } - } - + } + } + public static func parse_recentStickers(_ reader: BufferReader) -> RecentStickers? { var _1: Int64? _1 = reader.readInt64() @@ -1478,7 +1771,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.RecentStickers.recentStickers(hash: _1!, packs: _2!, stickers: _3!, dates: _4!) + return Api.messages.RecentStickers.recentStickers(Cons_recentStickers(hash: _1!, packs: _2!, stickers: _3!, dates: _4!)) } else { return nil @@ -1487,88 +1780,119 @@ public extension Api.messages { public static func parse_recentStickersNotModified(_ reader: BufferReader) -> RecentStickers? { return Api.messages.RecentStickers.recentStickersNotModified } - } } public extension Api.messages { enum SavedDialogs: TypeConstructorDescription { - case savedDialogs(dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - case savedDialogsNotModified(count: Int32) - case savedDialogsSlice(count: Int32, dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedDialogs(let dialogs, let messages, let chats, let users): - if boxed { - buffer.appendInt32(-130358751) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dialogs.count)) - for item in dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .savedDialogsNotModified(let count): - if boxed { - buffer.appendInt32(-1071681560) - } - serializeInt32(count, buffer: buffer, boxed: false) - break - case .savedDialogsSlice(let count, let dialogs, let messages, let chats, let users): - if boxed { - buffer.appendInt32(1153080793) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dialogs.count)) - for item in dialogs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedDialogs(let dialogs, let messages, let chats, let users): - return ("savedDialogs", [("dialogs", dialogs as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - case .savedDialogsNotModified(let count): - return ("savedDialogsNotModified", [("count", count as Any)]) - case .savedDialogsSlice(let count, let dialogs, let messages, let chats, let users): - return ("savedDialogsSlice", [("count", count as Any), ("dialogs", dialogs as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_savedDialogs { + public var dialogs: [Api.SavedDialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + } + public class Cons_savedDialogsNotModified { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + } + public class Cons_savedDialogsSlice { + public var count: Int32 + public var dialogs: [Api.SavedDialog] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(count: Int32, dialogs: [Api.SavedDialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.count = count + self.dialogs = dialogs + self.messages = messages + self.chats = chats + self.users = users + } + } + case savedDialogs(Cons_savedDialogs) + case savedDialogsNotModified(Cons_savedDialogsNotModified) + case savedDialogsSlice(Cons_savedDialogsSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedDialogs(let _data): + if boxed { + buffer.appendInt32(-130358751) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .savedDialogsNotModified(let _data): + if boxed { + buffer.appendInt32(-1071681560) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + case .savedDialogsSlice(let _data): + if boxed { + buffer.appendInt32(1153080793) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dialogs.count)) + for item in _data.dialogs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedDialogs(let _data): + return ("savedDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .savedDialogsNotModified(let _data): + return ("savedDialogsNotModified", [("count", _data.count as Any)]) + case .savedDialogsSlice(let _data): + return ("savedDialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_savedDialogs(_ reader: BufferReader) -> SavedDialogs? { var _1: [Api.SavedDialog]? if let _ = reader.readInt32() { @@ -1591,7 +1915,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.SavedDialogs.savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!) + return Api.messages.SavedDialogs.savedDialogs(Cons_savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) } else { return nil @@ -1602,7 +1926,7 @@ public extension Api.messages { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.SavedDialogs.savedDialogsNotModified(count: _1!) + return Api.messages.SavedDialogs.savedDialogsNotModified(Cons_savedDialogsNotModified(count: _1!)) } else { return nil @@ -1633,12 +1957,11 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.SavedDialogs.savedDialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!) + return Api.messages.SavedDialogs.savedDialogsSlice(Cons_savedDialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api36.swift b/submodules/TelegramApi/Sources/Api36.swift index bbd86ee717..21d07ed3f7 100644 --- a/submodules/TelegramApi/Sources/Api36.swift +++ b/submodules/TelegramApi/Sources/Api36.swift @@ -1,39 +1,46 @@ public extension Api.messages { enum SavedGifs: TypeConstructorDescription { - case savedGifs(hash: Int64, gifs: [Api.Document]) + public class Cons_savedGifs { + public var hash: Int64 + public var gifs: [Api.Document] + public init(hash: Int64, gifs: [Api.Document]) { + self.hash = hash + self.gifs = gifs + } + } + case savedGifs(Cons_savedGifs) case savedGifsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedGifs(let hash, let gifs): - if boxed { - buffer.appendInt32(-2069878259) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(gifs.count)) - for item in gifs { - item.serialize(buffer, true) - } - break - case .savedGifsNotModified: - if boxed { - buffer.appendInt32(-402498398) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedGifs(let hash, let gifs): - return ("savedGifs", [("hash", hash as Any), ("gifs", gifs as Any)]) - case .savedGifsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedGifs(let _data): + if boxed { + buffer.appendInt32(-2069878259) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.gifs.count)) + for item in _data.gifs { + item.serialize(buffer, true) + } + break + case .savedGifsNotModified: + if boxed { + buffer.appendInt32(-402498398) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedGifs(let _data): + return ("savedGifs", [("hash", _data.hash as Any), ("gifs", _data.gifs as Any)]) + case .savedGifsNotModified: return ("savedGifsNotModified", []) - } - } - + } + } + public static func parse_savedGifs(_ reader: BufferReader) -> SavedGifs? { var _1: Int64? _1 = reader.readInt64() @@ -44,7 +51,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.SavedGifs.savedGifs(hash: _1!, gifs: _2!) + return Api.messages.SavedGifs.savedGifs(Cons_savedGifs(hash: _1!, gifs: _2!)) } else { return nil @@ -53,45 +60,51 @@ public extension Api.messages { public static func parse_savedGifsNotModified(_ reader: BufferReader) -> SavedGifs? { return Api.messages.SavedGifs.savedGifsNotModified } - } } public extension Api.messages { enum SavedReactionTags: TypeConstructorDescription { - case savedReactionTags(tags: [Api.SavedReactionTag], hash: Int64) + public class Cons_savedReactionTags { + public var tags: [Api.SavedReactionTag] + public var hash: Int64 + public init(tags: [Api.SavedReactionTag], hash: Int64) { + self.tags = tags + self.hash = hash + } + } + case savedReactionTags(Cons_savedReactionTags) case savedReactionTagsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedReactionTags(let tags, let hash): - if boxed { - buffer.appendInt32(844731658) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(tags.count)) - for item in tags { - item.serialize(buffer, true) - } - serializeInt64(hash, buffer: buffer, boxed: false) - break - case .savedReactionTagsNotModified: - if boxed { - buffer.appendInt32(-2003084817) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedReactionTags(let tags, let hash): - return ("savedReactionTags", [("tags", tags as Any), ("hash", hash as Any)]) - case .savedReactionTagsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedReactionTags(let _data): + if boxed { + buffer.appendInt32(844731658) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.tags.count)) + for item in _data.tags { + item.serialize(buffer, true) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + break + case .savedReactionTagsNotModified: + if boxed { + buffer.appendInt32(-2003084817) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedReactionTags(let _data): + return ("savedReactionTags", [("tags", _data.tags as Any), ("hash", _data.hash as Any)]) + case .savedReactionTagsNotModified: return ("savedReactionTagsNotModified", []) - } - } - + } + } + public static func parse_savedReactionTags(_ reader: BufferReader) -> SavedReactionTags? { var _1: [Api.SavedReactionTag]? if let _ = reader.readInt32() { @@ -102,7 +115,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.SavedReactionTags.savedReactionTags(tags: _1!, hash: _2!) + return Api.messages.SavedReactionTags.savedReactionTags(Cons_savedReactionTags(tags: _1!, hash: _2!)) } else { return nil @@ -111,33 +124,42 @@ public extension Api.messages { public static func parse_savedReactionTagsNotModified(_ reader: BufferReader) -> SavedReactionTags? { return Api.messages.SavedReactionTags.savedReactionTagsNotModified } - } } public extension Api.messages { enum SearchCounter: TypeConstructorDescription { - case searchCounter(flags: Int32, filter: Api.MessagesFilter, count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchCounter(let flags, let filter, let count): - if boxed { - buffer.appendInt32(-398136321) - } - serializeInt32(flags, buffer: buffer, boxed: false) - filter.serialize(buffer, true) - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchCounter(let flags, let filter, let count): - return ("searchCounter", [("flags", flags as Any), ("filter", filter as Any), ("count", count as Any)]) - } - } - + public class Cons_searchCounter { + public var flags: Int32 + public var filter: Api.MessagesFilter + public var count: Int32 + public init(flags: Int32, filter: Api.MessagesFilter, count: Int32) { + self.flags = flags + self.filter = filter + self.count = count + } + } + case searchCounter(Cons_searchCounter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchCounter(let _data): + if boxed { + buffer.appendInt32(-398136321) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.filter.serialize(buffer, true) + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchCounter(let _data): + return ("searchCounter", [("flags", _data.flags as Any), ("filter", _data.filter as Any), ("count", _data.count as Any)]) + } + } + public static func parse_searchCounter(_ reader: BufferReader) -> SearchCounter? { var _1: Int32? _1 = reader.readInt32() @@ -151,61 +173,84 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.SearchCounter.searchCounter(flags: _1!, filter: _2!, count: _3!) + return Api.messages.SearchCounter.searchCounter(Cons_searchCounter(flags: _1!, filter: _2!, count: _3!)) } else { return nil } } - } } public extension Api.messages { enum SearchResultsCalendar: TypeConstructorDescription { - case searchResultsCalendar(flags: Int32, count: Int32, minDate: Int32, minMsgId: Int32, offsetIdOffset: Int32?, periods: [Api.SearchResultsCalendarPeriod], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultsCalendar(let flags, let count, let minDate, let minMsgId, let offsetIdOffset, let periods, let messages, let chats, let users): - if boxed { - buffer.appendInt32(343859772) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - serializeInt32(minDate, buffer: buffer, boxed: false) - serializeInt32(minMsgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(offsetIdOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(periods.count)) - for item in periods { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultsCalendar(let flags, let count, let minDate, let minMsgId, let offsetIdOffset, let periods, let messages, let chats, let users): - return ("searchResultsCalendar", [("flags", flags as Any), ("count", count as Any), ("minDate", minDate as Any), ("minMsgId", minMsgId as Any), ("offsetIdOffset", offsetIdOffset as Any), ("periods", periods as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_searchResultsCalendar { + public var flags: Int32 + public var count: Int32 + public var minDate: Int32 + public var minMsgId: Int32 + public var offsetIdOffset: Int32? + public var periods: [Api.SearchResultsCalendarPeriod] + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, minDate: Int32, minMsgId: Int32, offsetIdOffset: Int32?, periods: [Api.SearchResultsCalendarPeriod], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.minDate = minDate + self.minMsgId = minMsgId + self.offsetIdOffset = offsetIdOffset + self.periods = periods + self.messages = messages + self.chats = chats + self.users = users + } + } + case searchResultsCalendar(Cons_searchResultsCalendar) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchResultsCalendar(let _data): + if boxed { + buffer.appendInt32(343859772) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt32(_data.minDate, buffer: buffer, boxed: false) + serializeInt32(_data.minMsgId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.offsetIdOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.periods.count)) + for item in _data.periods { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchResultsCalendar(let _data): + return ("searchResultsCalendar", [("flags", _data.flags as Any), ("count", _data.count as Any), ("minDate", _data.minDate as Any), ("minMsgId", _data.minMsgId as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("periods", _data.periods as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_searchResultsCalendar(_ reader: BufferReader) -> SearchResultsCalendar? { var _1: Int32? _1 = reader.readInt32() @@ -216,7 +261,9 @@ public extension Api.messages { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } var _6: [Api.SearchResultsCalendarPeriod]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SearchResultsCalendarPeriod.self) @@ -243,42 +290,49 @@ public extension Api.messages { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.messages.SearchResultsCalendar.searchResultsCalendar(flags: _1!, count: _2!, minDate: _3!, minMsgId: _4!, offsetIdOffset: _5, periods: _6!, messages: _7!, chats: _8!, users: _9!) + return Api.messages.SearchResultsCalendar.searchResultsCalendar(Cons_searchResultsCalendar(flags: _1!, count: _2!, minDate: _3!, minMsgId: _4!, offsetIdOffset: _5, periods: _6!, messages: _7!, chats: _8!, users: _9!)) } else { return nil } } - } } public extension Api.messages { enum SearchResultsPositions: TypeConstructorDescription { - case searchResultsPositions(count: Int32, positions: [Api.SearchResultsPosition]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultsPositions(let count, let positions): - if boxed { - buffer.appendInt32(1404185519) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(positions.count)) - for item in positions { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultsPositions(let count, let positions): - return ("searchResultsPositions", [("count", count as Any), ("positions", positions as Any)]) - } - } - + public class Cons_searchResultsPositions { + public var count: Int32 + public var positions: [Api.SearchResultsPosition] + public init(count: Int32, positions: [Api.SearchResultsPosition]) { + self.count = count + self.positions = positions + } + } + case searchResultsPositions(Cons_searchResultsPositions) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchResultsPositions(let _data): + if boxed { + buffer.appendInt32(1404185519) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.positions.count)) + for item in _data.positions { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .searchResultsPositions(let _data): + return ("searchResultsPositions", [("count", _data.count as Any), ("positions", _data.positions as Any)]) + } + } + public static func parse_searchResultsPositions(_ reader: BufferReader) -> SearchResultsPositions? { var _1: Int32? _1 = reader.readInt32() @@ -289,47 +343,60 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.SearchResultsPositions.searchResultsPositions(count: _1!, positions: _2!) + return Api.messages.SearchResultsPositions.searchResultsPositions(Cons_searchResultsPositions(count: _1!, positions: _2!)) } else { return nil } } - } } public extension Api.messages { enum SentEncryptedMessage: TypeConstructorDescription { - case sentEncryptedFile(date: Int32, file: Api.EncryptedFile) - case sentEncryptedMessage(date: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sentEncryptedFile(let date, let file): - if boxed { - buffer.appendInt32(-1802240206) - } - serializeInt32(date, buffer: buffer, boxed: false) - file.serialize(buffer, true) - break - case .sentEncryptedMessage(let date): - if boxed { - buffer.appendInt32(1443858741) - } - serializeInt32(date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sentEncryptedFile(let date, let file): - return ("sentEncryptedFile", [("date", date as Any), ("file", file as Any)]) - case .sentEncryptedMessage(let date): - return ("sentEncryptedMessage", [("date", date as Any)]) - } - } - + public class Cons_sentEncryptedFile { + public var date: Int32 + public var file: Api.EncryptedFile + public init(date: Int32, file: Api.EncryptedFile) { + self.date = date + self.file = file + } + } + public class Cons_sentEncryptedMessage { + public var date: Int32 + public init(date: Int32) { + self.date = date + } + } + case sentEncryptedFile(Cons_sentEncryptedFile) + case sentEncryptedMessage(Cons_sentEncryptedMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sentEncryptedFile(let _data): + if boxed { + buffer.appendInt32(-1802240206) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.file.serialize(buffer, true) + break + case .sentEncryptedMessage(let _data): + if boxed { + buffer.appendInt32(1443858741) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sentEncryptedFile(let _data): + return ("sentEncryptedFile", [("date", _data.date as Any), ("file", _data.file as Any)]) + case .sentEncryptedMessage(let _data): + return ("sentEncryptedMessage", [("date", _data.date as Any)]) + } + } + public static func parse_sentEncryptedFile(_ reader: BufferReader) -> SentEncryptedMessage? { var _1: Int32? _1 = reader.readInt32() @@ -340,7 +407,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.SentEncryptedMessage.sentEncryptedFile(date: _1!, file: _2!) + return Api.messages.SentEncryptedMessage.sentEncryptedFile(Cons_sentEncryptedFile(date: _1!, file: _2!)) } else { return nil @@ -351,73 +418,101 @@ public extension Api.messages { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.SentEncryptedMessage.sentEncryptedMessage(date: _1!) + return Api.messages.SentEncryptedMessage.sentEncryptedMessage(Cons_sentEncryptedMessage(date: _1!)) } else { return nil } } - } } public extension Api.messages { enum SponsoredMessages: TypeConstructorDescription { - case sponsoredMessages(flags: Int32, postsBetween: Int32?, startDelay: Int32?, betweenDelay: Int32?, messages: [Api.SponsoredMessage], chats: [Api.Chat], users: [Api.User]) + public class Cons_sponsoredMessages { + public var flags: Int32 + public var postsBetween: Int32? + public var startDelay: Int32? + public var betweenDelay: Int32? + public var messages: [Api.SponsoredMessage] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, postsBetween: Int32?, startDelay: Int32?, betweenDelay: Int32?, messages: [Api.SponsoredMessage], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.postsBetween = postsBetween + self.startDelay = startDelay + self.betweenDelay = betweenDelay + self.messages = messages + self.chats = chats + self.users = users + } + } + case sponsoredMessages(Cons_sponsoredMessages) case sponsoredMessagesEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sponsoredMessages(let flags, let postsBetween, let startDelay, let betweenDelay, let messages, let chats, let users): - if boxed { - buffer.appendInt32(-2464403) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(postsBetween!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(startDelay!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(betweenDelay!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .sponsoredMessagesEmpty: - if boxed { - buffer.appendInt32(406407439) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sponsoredMessages(let flags, let postsBetween, let startDelay, let betweenDelay, let messages, let chats, let users): - return ("sponsoredMessages", [("flags", flags as Any), ("postsBetween", postsBetween as Any), ("startDelay", startDelay as Any), ("betweenDelay", betweenDelay as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - case .sponsoredMessagesEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sponsoredMessages(let _data): + if boxed { + buffer.appendInt32(-2464403) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.postsBetween!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.startDelay!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.betweenDelay!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .sponsoredMessagesEmpty: + if boxed { + buffer.appendInt32(406407439) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .sponsoredMessages(let _data): + return ("sponsoredMessages", [("flags", _data.flags as Any), ("postsBetween", _data.postsBetween as Any), ("startDelay", _data.startDelay as Any), ("betweenDelay", _data.betweenDelay as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .sponsoredMessagesEmpty: return ("sponsoredMessagesEmpty", []) - } - } - + } + } + public static func parse_sponsoredMessages(_ reader: BufferReader) -> SponsoredMessages? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } var _5: [Api.SponsoredMessage]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredMessage.self) @@ -438,7 +533,7 @@ public extension Api.messages { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.messages.SponsoredMessages.sponsoredMessages(flags: _1!, postsBetween: _2, startDelay: _3, betweenDelay: _4, messages: _5!, chats: _6!, users: _7!) + return Api.messages.SponsoredMessages.sponsoredMessages(Cons_sponsoredMessages(flags: _1!, postsBetween: _2, startDelay: _3, betweenDelay: _4, messages: _5!, chats: _6!, users: _7!)) } else { return nil @@ -447,55 +542,65 @@ public extension Api.messages { public static func parse_sponsoredMessagesEmpty(_ reader: BufferReader) -> SponsoredMessages? { return Api.messages.SponsoredMessages.sponsoredMessagesEmpty } - } } public extension Api.messages { enum StickerSet: TypeConstructorDescription { - case stickerSet(set: Api.StickerSet, packs: [Api.StickerPack], keywords: [Api.StickerKeyword], documents: [Api.Document]) + public class Cons_stickerSet { + public var set: Api.StickerSet + public var packs: [Api.StickerPack] + public var keywords: [Api.StickerKeyword] + public var documents: [Api.Document] + public init(set: Api.StickerSet, packs: [Api.StickerPack], keywords: [Api.StickerKeyword], documents: [Api.Document]) { + self.set = set + self.packs = packs + self.keywords = keywords + self.documents = documents + } + } + case stickerSet(Cons_stickerSet) case stickerSetNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerSet(let set, let packs, let keywords, let documents): - if boxed { - buffer.appendInt32(1846886166) - } - set.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(packs.count)) - for item in packs { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(keywords.count)) - for item in keywords { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - break - case .stickerSetNotModified: - if boxed { - buffer.appendInt32(-738646805) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerSet(let set, let packs, let keywords, let documents): - return ("stickerSet", [("set", set as Any), ("packs", packs as Any), ("keywords", keywords as Any), ("documents", documents as Any)]) - case .stickerSetNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerSet(let _data): + if boxed { + buffer.appendInt32(1846886166) + } + _data.set.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.packs.count)) + for item in _data.packs { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.keywords.count)) + for item in _data.keywords { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + item.serialize(buffer, true) + } + break + case .stickerSetNotModified: + if boxed { + buffer.appendInt32(-738646805) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerSet(let _data): + return ("stickerSet", [("set", _data.set as Any), ("packs", _data.packs as Any), ("keywords", _data.keywords as Any), ("documents", _data.documents as Any)]) + case .stickerSetNotModified: return ("stickerSetNotModified", []) - } - } - + } + } + public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { var _1: Api.StickerSet? if let signature = reader.readInt32() { @@ -518,7 +623,7 @@ public extension Api.messages { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.StickerSet.stickerSet(set: _1!, packs: _2!, keywords: _3!, documents: _4!) + return Api.messages.StickerSet.stickerSet(Cons_stickerSet(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) } else { return nil @@ -527,44 +632,48 @@ public extension Api.messages { public static func parse_stickerSetNotModified(_ reader: BufferReader) -> StickerSet? { return Api.messages.StickerSet.stickerSetNotModified } - } } public extension Api.messages { enum StickerSetInstallResult: TypeConstructorDescription { - case stickerSetInstallResultArchive(sets: [Api.StickerSetCovered]) + public class Cons_stickerSetInstallResultArchive { + public var sets: [Api.StickerSetCovered] + public init(sets: [Api.StickerSetCovered]) { + self.sets = sets + } + } + case stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive) case stickerSetInstallResultSuccess - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerSetInstallResultArchive(let sets): - if boxed { - buffer.appendInt32(904138920) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sets.count)) - for item in sets { - item.serialize(buffer, true) - } - break - case .stickerSetInstallResultSuccess: - if boxed { - buffer.appendInt32(946083368) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerSetInstallResultArchive(let sets): - return ("stickerSetInstallResultArchive", [("sets", sets as Any)]) - case .stickerSetInstallResultSuccess: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickerSetInstallResultArchive(let _data): + if boxed { + buffer.appendInt32(904138920) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { + item.serialize(buffer, true) + } + break + case .stickerSetInstallResultSuccess: + if boxed { + buffer.appendInt32(946083368) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickerSetInstallResultArchive(let _data): + return ("stickerSetInstallResultArchive", [("sets", _data.sets as Any)]) + case .stickerSetInstallResultSuccess: return ("stickerSetInstallResultSuccess", []) - } - } - + } + } + public static func parse_stickerSetInstallResultArchive(_ reader: BufferReader) -> StickerSetInstallResult? { var _1: [Api.StickerSetCovered]? if let _ = reader.readInt32() { @@ -572,7 +681,7 @@ public extension Api.messages { } let _c1 = _1 != nil if _c1 { - return Api.messages.StickerSetInstallResult.stickerSetInstallResultArchive(sets: _1!) + return Api.messages.StickerSetInstallResult.stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive(sets: _1!)) } else { return nil @@ -581,45 +690,51 @@ public extension Api.messages { public static func parse_stickerSetInstallResultSuccess(_ reader: BufferReader) -> StickerSetInstallResult? { return Api.messages.StickerSetInstallResult.stickerSetInstallResultSuccess } - } } public extension Api.messages { enum Stickers: TypeConstructorDescription { - case stickers(hash: Int64, stickers: [Api.Document]) + public class Cons_stickers { + public var hash: Int64 + public var stickers: [Api.Document] + public init(hash: Int64, stickers: [Api.Document]) { + self.hash = hash + self.stickers = stickers + } + } + case stickers(Cons_stickers) case stickersNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickers(let hash, let stickers): - if boxed { - buffer.appendInt32(816245886) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - break - case .stickersNotModified: - if boxed { - buffer.appendInt32(-244016606) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickers(let hash, let stickers): - return ("stickers", [("hash", hash as Any), ("stickers", stickers as Any)]) - case .stickersNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stickers(let _data): + if boxed { + buffer.appendInt32(816245886) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { + item.serialize(buffer, true) + } + break + case .stickersNotModified: + if boxed { + buffer.appendInt32(-244016606) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stickers(let _data): + return ("stickers", [("hash", _data.hash as Any), ("stickers", _data.stickers as Any)]) + case .stickersNotModified: return ("stickersNotModified", []) - } - } - + } + } + public static func parse_stickers(_ reader: BufferReader) -> Stickers? { var _1: Int64? _1 = reader.readInt64() @@ -630,7 +745,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.Stickers.stickers(hash: _1!, stickers: _2!) + return Api.messages.Stickers.stickers(Cons_stickers(hash: _1!, stickers: _2!)) } else { return nil @@ -639,35 +754,52 @@ public extension Api.messages { public static func parse_stickersNotModified(_ reader: BufferReader) -> Stickers? { return Api.messages.Stickers.stickersNotModified } - } } public extension Api.messages { enum TranscribedAudio: TypeConstructorDescription { - case transcribedAudio(flags: Int32, transcriptionId: Int64, text: String, trialRemainsNum: Int32?, trialRemainsUntilDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .transcribedAudio(let flags, let transcriptionId, let text, let trialRemainsNum, let trialRemainsUntilDate): - if boxed { - buffer.appendInt32(-809903785) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(transcriptionId, buffer: buffer, boxed: false) - serializeString(text, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(trialRemainsNum!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(trialRemainsUntilDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .transcribedAudio(let flags, let transcriptionId, let text, let trialRemainsNum, let trialRemainsUntilDate): - return ("transcribedAudio", [("flags", flags as Any), ("transcriptionId", transcriptionId as Any), ("text", text as Any), ("trialRemainsNum", trialRemainsNum as Any), ("trialRemainsUntilDate", trialRemainsUntilDate as Any)]) - } - } - + public class Cons_transcribedAudio { + public var flags: Int32 + public var transcriptionId: Int64 + public var text: String + public var trialRemainsNum: Int32? + public var trialRemainsUntilDate: Int32? + public init(flags: Int32, transcriptionId: Int64, text: String, trialRemainsNum: Int32?, trialRemainsUntilDate: Int32?) { + self.flags = flags + self.transcriptionId = transcriptionId + self.text = text + self.trialRemainsNum = trialRemainsNum + self.trialRemainsUntilDate = trialRemainsUntilDate + } + } + case transcribedAudio(Cons_transcribedAudio) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .transcribedAudio(let _data): + if boxed { + buffer.appendInt32(-809903785) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.transcriptionId, buffer: buffer, boxed: false) + serializeString(_data.text, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.trialRemainsNum!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.trialRemainsUntilDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .transcribedAudio(let _data): + return ("transcribedAudio", [("flags", _data.flags as Any), ("transcriptionId", _data.transcriptionId as Any), ("text", _data.text as Any), ("trialRemainsNum", _data.trialRemainsNum as Any), ("trialRemainsUntilDate", _data.trialRemainsUntilDate as Any)]) + } + } + public static func parse_transcribedAudio(_ reader: BufferReader) -> TranscribedAudio? { var _1: Int32? _1 = reader.readInt32() @@ -676,50 +808,59 @@ public extension Api.messages { var _3: String? _3 = parseString(reader) var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.TranscribedAudio.transcribedAudio(flags: _1!, transcriptionId: _2!, text: _3!, trialRemainsNum: _4, trialRemainsUntilDate: _5) + return Api.messages.TranscribedAudio.transcribedAudio(Cons_transcribedAudio(flags: _1!, transcriptionId: _2!, text: _3!, trialRemainsNum: _4, trialRemainsUntilDate: _5)) } else { return nil } } - } } public extension Api.messages { enum TranslatedText: TypeConstructorDescription { - case translateResult(result: [Api.TextWithEntities]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .translateResult(let result): - if boxed { - buffer.appendInt32(870003448) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(result.count)) - for item in result { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .translateResult(let result): - return ("translateResult", [("result", result as Any)]) - } - } - + public class Cons_translateResult { + public var result: [Api.TextWithEntities] + public init(result: [Api.TextWithEntities]) { + self.result = result + } + } + case translateResult(Cons_translateResult) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .translateResult(let _data): + if boxed { + buffer.appendInt32(870003448) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.result.count)) + for item in _data.result { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .translateResult(let _data): + return ("translateResult", [("result", _data.result as Any)]) + } + } + public static func parse_translateResult(_ reader: BufferReader) -> TranslatedText? { var _1: [Api.TextWithEntities]? if let _ = reader.readInt32() { @@ -727,54 +868,71 @@ public extension Api.messages { } let _c1 = _1 != nil if _c1 { - return Api.messages.TranslatedText.translateResult(result: _1!) + return Api.messages.TranslatedText.translateResult(Cons_translateResult(result: _1!)) } else { return nil } } - } } public extension Api.messages { enum VotesList: TypeConstructorDescription { - case votesList(flags: Int32, count: Int32, votes: [Api.MessagePeerVote], chats: [Api.Chat], users: [Api.User], nextOffset: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .votesList(let flags, let count, let votes, let chats, let users, let nextOffset): - if boxed { - buffer.appendInt32(1218005070) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(votes.count)) - for item in votes { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .votesList(let flags, let count, let votes, let chats, let users, let nextOffset): - return ("votesList", [("flags", flags as Any), ("count", count as Any), ("votes", votes as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_votesList { + public var flags: Int32 + public var count: Int32 + public var votes: [Api.MessagePeerVote] + public var chats: [Api.Chat] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, count: Int32, votes: [Api.MessagePeerVote], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.count = count + self.votes = votes + self.chats = chats + self.users = users + self.nextOffset = nextOffset + } + } + case votesList(Cons_votesList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .votesList(let _data): + if boxed { + buffer.appendInt32(1218005070) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.votes.count)) + for item in _data.votes { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .votesList(let _data): + return ("votesList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("votes", _data.votes as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_votesList(_ reader: BufferReader) -> VotesList? { var _1: Int32? _1 = reader.readInt32() @@ -793,7 +951,9 @@ public extension Api.messages { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -801,47 +961,56 @@ public extension Api.messages { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.messages.VotesList.votesList(flags: _1!, count: _2!, votes: _3!, chats: _4!, users: _5!, nextOffset: _6) + return Api.messages.VotesList.votesList(Cons_votesList(flags: _1!, count: _2!, votes: _3!, chats: _4!, users: _5!, nextOffset: _6)) } else { return nil } } - } } public extension Api.messages { enum WebPage: TypeConstructorDescription { - case webPage(webpage: Api.WebPage, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webPage(let webpage, let chats, let users): - if boxed { - buffer.appendInt32(-44166467) - } - webpage.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webPage(let webpage, let chats, let users): - return ("webPage", [("webpage", webpage as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_webPage { + public var webpage: Api.WebPage + public var chats: [Api.Chat] + public var users: [Api.User] + public init(webpage: Api.WebPage, chats: [Api.Chat], users: [Api.User]) { + self.webpage = webpage + self.chats = chats + self.users = users + } + } + case webPage(Cons_webPage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webPage(let _data): + if boxed { + buffer.appendInt32(-44166467) + } + _data.webpage.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webPage(let _data): + return ("webPage", [("webpage", _data.webpage as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_webPage(_ reader: BufferReader) -> WebPage? { var _1: Api.WebPage? if let signature = reader.readInt32() { @@ -859,47 +1028,56 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.WebPage.webPage(webpage: _1!, chats: _2!, users: _3!) + return Api.messages.WebPage.webPage(Cons_webPage(webpage: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.messages { indirect enum WebPagePreview: TypeConstructorDescription { - case webPagePreview(media: Api.MessageMedia, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webPagePreview(let media, let chats, let users): - if boxed { - buffer.appendInt32(-1936029524) - } - media.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webPagePreview(let media, let chats, let users): - return ("webPagePreview", [("media", media as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_webPagePreview { + public var media: Api.MessageMedia + public var chats: [Api.Chat] + public var users: [Api.User] + public init(media: Api.MessageMedia, chats: [Api.Chat], users: [Api.User]) { + self.media = media + self.chats = chats + self.users = users + } + } + case webPagePreview(Cons_webPagePreview) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webPagePreview(let _data): + if boxed { + buffer.appendInt32(-1936029524) + } + _data.media.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webPagePreview(let _data): + return ("webPagePreview", [("media", _data.media as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_webPagePreview(_ reader: BufferReader) -> WebPagePreview? { var _1: Api.MessageMedia? if let signature = reader.readInt32() { @@ -917,42 +1095,49 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.WebPagePreview.webPagePreview(media: _1!, chats: _2!, users: _3!) + return Api.messages.WebPagePreview.webPagePreview(Cons_webPagePreview(media: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.payments { enum BankCardData: TypeConstructorDescription { - case bankCardData(title: String, openUrls: [Api.BankCardOpenUrl]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .bankCardData(let title, let openUrls): - if boxed { - buffer.appendInt32(1042605427) - } - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(openUrls.count)) - for item in openUrls { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .bankCardData(let title, let openUrls): - return ("bankCardData", [("title", title as Any), ("openUrls", openUrls as Any)]) - } - } - + public class Cons_bankCardData { + public var title: String + public var openUrls: [Api.BankCardOpenUrl] + public init(title: String, openUrls: [Api.BankCardOpenUrl]) { + self.title = title + self.openUrls = openUrls + } + } + case bankCardData(Cons_bankCardData) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .bankCardData(let _data): + if boxed { + buffer.appendInt32(1042605427) + } + serializeString(_data.title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.openUrls.count)) + for item in _data.openUrls { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .bankCardData(let _data): + return ("bankCardData", [("title", _data.title as Any), ("openUrls", _data.openUrls as Any)]) + } + } + public static func parse_bankCardData(_ reader: BufferReader) -> BankCardData? { var _1: String? _1 = parseString(reader) @@ -963,46 +1148,50 @@ public extension Api.payments { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.payments.BankCardData.bankCardData(title: _1!, openUrls: _2!) + return Api.payments.BankCardData.bankCardData(Cons_bankCardData(title: _1!, openUrls: _2!)) } else { return nil } } - } } public extension Api.payments { enum CheckCanSendGiftResult: TypeConstructorDescription { - case checkCanSendGiftResultFail(reason: Api.TextWithEntities) + public class Cons_checkCanSendGiftResultFail { + public var reason: Api.TextWithEntities + public init(reason: Api.TextWithEntities) { + self.reason = reason + } + } + case checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail) case checkCanSendGiftResultOk - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .checkCanSendGiftResultFail(let reason): - if boxed { - buffer.appendInt32(-706379148) - } - reason.serialize(buffer, true) - break - case .checkCanSendGiftResultOk: - if boxed { - buffer.appendInt32(927967149) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .checkCanSendGiftResultFail(let reason): - return ("checkCanSendGiftResultFail", [("reason", reason as Any)]) - case .checkCanSendGiftResultOk: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .checkCanSendGiftResultFail(let _data): + if boxed { + buffer.appendInt32(-706379148) + } + _data.reason.serialize(buffer, true) + break + case .checkCanSendGiftResultOk: + if boxed { + buffer.appendInt32(927967149) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .checkCanSendGiftResultFail(let _data): + return ("checkCanSendGiftResultFail", [("reason", _data.reason as Any)]) + case .checkCanSendGiftResultOk: return ("checkCanSendGiftResultOk", []) - } - } - + } + } + public static func parse_checkCanSendGiftResultFail(_ reader: BufferReader) -> CheckCanSendGiftResult? { var _1: Api.TextWithEntities? if let signature = reader.readInt32() { @@ -1010,7 +1199,7 @@ public extension Api.payments { } let _c1 = _1 != nil if _c1 { - return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultFail(reason: _1!) + return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail(reason: _1!)) } else { return nil @@ -1019,64 +1208,101 @@ public extension Api.payments { public static func parse_checkCanSendGiftResultOk(_ reader: BufferReader) -> CheckCanSendGiftResult? { return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultOk } - } } public extension Api.payments { enum CheckedGiftCode: TypeConstructorDescription { - case checkedGiftCode(flags: Int32, fromId: Api.Peer?, giveawayMsgId: Int32?, toId: Int64?, date: Int32, days: Int32, usedDate: Int32?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .checkedGiftCode(let flags, let fromId, let giveawayMsgId, let toId, let date, let days, let usedDate, let chats, let users): - if boxed { - buffer.appendInt32(-342343793) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(giveawayMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(toId!, buffer: buffer, boxed: false)} - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(days, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(usedDate!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .checkedGiftCode(let flags, let fromId, let giveawayMsgId, let toId, let date, let days, let usedDate, let chats, let users): - return ("checkedGiftCode", [("flags", flags as Any), ("fromId", fromId as Any), ("giveawayMsgId", giveawayMsgId as Any), ("toId", toId as Any), ("date", date as Any), ("days", days as Any), ("usedDate", usedDate as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_checkedGiftCode { + public var flags: Int32 + public var fromId: Api.Peer? + public var giveawayMsgId: Int32? + public var toId: Int64? + public var date: Int32 + public var days: Int32 + public var usedDate: Int32? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, fromId: Api.Peer?, giveawayMsgId: Int32?, toId: Int64?, date: Int32, days: Int32, usedDate: Int32?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.fromId = fromId + self.giveawayMsgId = giveawayMsgId + self.toId = toId + self.date = date + self.days = days + self.usedDate = usedDate + self.chats = chats + self.users = users + } + } + case checkedGiftCode(Cons_checkedGiftCode) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .checkedGiftCode(let _data): + if boxed { + buffer.appendInt32(-342343793) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.fromId!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.giveawayMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.toId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.days, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.usedDate!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .checkedGiftCode(let _data): + return ("checkedGiftCode", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("giveawayMsgId", _data.giveawayMsgId as Any), ("toId", _data.toId as Any), ("date", _data.date as Any), ("days", _data.days as Any), ("usedDate", _data.usedDate as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_checkedGiftCode(_ reader: BufferReader) -> CheckedGiftCode? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? _6 = reader.readInt32() var _7: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = reader.readInt32() + } var _8: [Api.Chat]? if let _ = reader.readInt32() { _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -1095,47 +1321,56 @@ public extension Api.payments { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.payments.CheckedGiftCode.checkedGiftCode(flags: _1!, fromId: _2, giveawayMsgId: _3, toId: _4, date: _5!, days: _6!, usedDate: _7, chats: _8!, users: _9!) + return Api.payments.CheckedGiftCode.checkedGiftCode(Cons_checkedGiftCode(flags: _1!, fromId: _2, giveawayMsgId: _3, toId: _4, date: _5!, days: _6!, usedDate: _7, chats: _8!, users: _9!)) } else { return nil } } - } } public extension Api.payments { enum ConnectedStarRefBots: TypeConstructorDescription { - case connectedStarRefBots(count: Int32, connectedBots: [Api.ConnectedBotStarRef], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .connectedStarRefBots(let count, let connectedBots, let users): - if boxed { - buffer.appendInt32(-1730811363) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(connectedBots.count)) - for item in connectedBots { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .connectedStarRefBots(let count, let connectedBots, let users): - return ("connectedStarRefBots", [("count", count as Any), ("connectedBots", connectedBots as Any), ("users", users as Any)]) - } - } - + public class Cons_connectedStarRefBots { + public var count: Int32 + public var connectedBots: [Api.ConnectedBotStarRef] + public var users: [Api.User] + public init(count: Int32, connectedBots: [Api.ConnectedBotStarRef], users: [Api.User]) { + self.count = count + self.connectedBots = connectedBots + self.users = users + } + } + case connectedStarRefBots(Cons_connectedStarRefBots) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .connectedStarRefBots(let _data): + if boxed { + buffer.appendInt32(-1730811363) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.connectedBots.count)) + for item in _data.connectedBots { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .connectedStarRefBots(let _data): + return ("connectedStarRefBots", [("count", _data.count as Any), ("connectedBots", _data.connectedBots as Any), ("users", _data.users as Any)]) + } + } + public static func parse_connectedStarRefBots(_ reader: BufferReader) -> ConnectedStarRefBots? { var _1: Int32? _1 = reader.readInt32() @@ -1151,110 +1386,164 @@ public extension Api.payments { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.ConnectedStarRefBots.connectedStarRefBots(count: _1!, connectedBots: _2!, users: _3!) + return Api.payments.ConnectedStarRefBots.connectedStarRefBots(Cons_connectedStarRefBots(count: _1!, connectedBots: _2!, users: _3!)) } else { return nil } } - } } public extension Api.payments { enum ExportedInvoice: TypeConstructorDescription { - case exportedInvoice(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedInvoice(let url): - if boxed { - buffer.appendInt32(-1362048039) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedInvoice(let url): - return ("exportedInvoice", [("url", url as Any)]) - } - } - + public class Cons_exportedInvoice { + public var url: String + public init(url: String) { + self.url = url + } + } + case exportedInvoice(Cons_exportedInvoice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedInvoice(let _data): + if boxed { + buffer.appendInt32(-1362048039) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedInvoice(let _data): + return ("exportedInvoice", [("url", _data.url as Any)]) + } + } + public static func parse_exportedInvoice(_ reader: BufferReader) -> ExportedInvoice? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.payments.ExportedInvoice.exportedInvoice(url: _1!) + return Api.payments.ExportedInvoice.exportedInvoice(Cons_exportedInvoice(url: _1!)) } else { return nil } } - } } public extension Api.payments { enum GiveawayInfo: TypeConstructorDescription { - case giveawayInfo(flags: Int32, startDate: Int32, joinedTooEarlyDate: Int32?, adminDisallowedChatId: Int64?, disallowedCountry: String?) - case giveawayInfoResults(flags: Int32, startDate: Int32, giftCodeSlug: String?, starsPrize: Int64?, finishDate: Int32, winnersCount: Int32, activatedCount: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .giveawayInfo(let flags, let startDate, let joinedTooEarlyDate, let adminDisallowedChatId, let disallowedCountry): - if boxed { - buffer.appendInt32(1130879648) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(startDate, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(joinedTooEarlyDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(adminDisallowedChatId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(disallowedCountry!, buffer: buffer, boxed: false)} - break - case .giveawayInfoResults(let flags, let startDate, let giftCodeSlug, let starsPrize, let finishDate, let winnersCount, let activatedCount): - if boxed { - buffer.appendInt32(-512366993) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(startDate, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(giftCodeSlug!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(starsPrize!, buffer: buffer, boxed: false)} - serializeInt32(finishDate, buffer: buffer, boxed: false) - serializeInt32(winnersCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(activatedCount!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .giveawayInfo(let flags, let startDate, let joinedTooEarlyDate, let adminDisallowedChatId, let disallowedCountry): - return ("giveawayInfo", [("flags", flags as Any), ("startDate", startDate as Any), ("joinedTooEarlyDate", joinedTooEarlyDate as Any), ("adminDisallowedChatId", adminDisallowedChatId as Any), ("disallowedCountry", disallowedCountry as Any)]) - case .giveawayInfoResults(let flags, let startDate, let giftCodeSlug, let starsPrize, let finishDate, let winnersCount, let activatedCount): - return ("giveawayInfoResults", [("flags", flags as Any), ("startDate", startDate as Any), ("giftCodeSlug", giftCodeSlug as Any), ("starsPrize", starsPrize as Any), ("finishDate", finishDate as Any), ("winnersCount", winnersCount as Any), ("activatedCount", activatedCount as Any)]) - } - } - + public class Cons_giveawayInfo { + public var flags: Int32 + public var startDate: Int32 + public var joinedTooEarlyDate: Int32? + public var adminDisallowedChatId: Int64? + public var disallowedCountry: String? + public init(flags: Int32, startDate: Int32, joinedTooEarlyDate: Int32?, adminDisallowedChatId: Int64?, disallowedCountry: String?) { + self.flags = flags + self.startDate = startDate + self.joinedTooEarlyDate = joinedTooEarlyDate + self.adminDisallowedChatId = adminDisallowedChatId + self.disallowedCountry = disallowedCountry + } + } + public class Cons_giveawayInfoResults { + public var flags: Int32 + public var startDate: Int32 + public var giftCodeSlug: String? + public var starsPrize: Int64? + public var finishDate: Int32 + public var winnersCount: Int32 + public var activatedCount: Int32? + public init(flags: Int32, startDate: Int32, giftCodeSlug: String?, starsPrize: Int64?, finishDate: Int32, winnersCount: Int32, activatedCount: Int32?) { + self.flags = flags + self.startDate = startDate + self.giftCodeSlug = giftCodeSlug + self.starsPrize = starsPrize + self.finishDate = finishDate + self.winnersCount = winnersCount + self.activatedCount = activatedCount + } + } + case giveawayInfo(Cons_giveawayInfo) + case giveawayInfoResults(Cons_giveawayInfoResults) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .giveawayInfo(let _data): + if boxed { + buffer.appendInt32(1130879648) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.joinedTooEarlyDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.adminDisallowedChatId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.disallowedCountry!, buffer: buffer, boxed: false) + } + break + case .giveawayInfoResults(let _data): + if boxed { + buffer.appendInt32(-512366993) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.startDate, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.giftCodeSlug!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.starsPrize!, buffer: buffer, boxed: false) + } + serializeInt32(_data.finishDate, buffer: buffer, boxed: false) + serializeInt32(_data.winnersCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.activatedCount!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .giveawayInfo(let _data): + return ("giveawayInfo", [("flags", _data.flags as Any), ("startDate", _data.startDate as Any), ("joinedTooEarlyDate", _data.joinedTooEarlyDate as Any), ("adminDisallowedChatId", _data.adminDisallowedChatId as Any), ("disallowedCountry", _data.disallowedCountry as Any)]) + case .giveawayInfoResults(let _data): + return ("giveawayInfoResults", [("flags", _data.flags as Any), ("startDate", _data.startDate as Any), ("giftCodeSlug", _data.giftCodeSlug as Any), ("starsPrize", _data.starsPrize as Any), ("finishDate", _data.finishDate as Any), ("winnersCount", _data.winnersCount as Any), ("activatedCount", _data.activatedCount as Any)]) + } + } + public static func parse_giveawayInfo(_ reader: BufferReader) -> GiveawayInfo? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readInt64() + } var _5: String? - if Int(_1!) & Int(1 << 4) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 4) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.payments.GiveawayInfo.giveawayInfo(flags: _1!, startDate: _2!, joinedTooEarlyDate: _3, adminDisallowedChatId: _4, disallowedCountry: _5) + return Api.payments.GiveawayInfo.giveawayInfo(Cons_giveawayInfo(flags: _1!, startDate: _2!, joinedTooEarlyDate: _3, adminDisallowedChatId: _4, disallowedCountry: _5)) } else { return nil @@ -1266,15 +1555,21 @@ public extension Api.payments { var _2: Int32? _2 = reader.readInt32() var _3: String? - if Int(_1!) & Int(1 << 3) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _3 = parseString(reader) + } var _4: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? _6 = reader.readInt32() var _7: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _7 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil @@ -1283,93 +1578,168 @@ public extension Api.payments { let _c6 = _6 != nil let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.payments.GiveawayInfo.giveawayInfoResults(flags: _1!, startDate: _2!, giftCodeSlug: _3, starsPrize: _4, finishDate: _5!, winnersCount: _6!, activatedCount: _7) + return Api.payments.GiveawayInfo.giveawayInfoResults(Cons_giveawayInfoResults(flags: _1!, startDate: _2!, giftCodeSlug: _3, starsPrize: _4, finishDate: _5!, winnersCount: _6!, activatedCount: _7)) } else { return nil } } - } } public extension Api.payments { enum PaymentForm: TypeConstructorDescription { - case paymentForm(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, providerId: Int64, url: String, nativeProvider: String?, nativeParams: Api.DataJSON?, additionalMethods: [Api.PaymentFormMethod]?, savedInfo: Api.PaymentRequestedInfo?, savedCredentials: [Api.PaymentSavedCredentials]?, users: [Api.User]) - case paymentFormStarGift(formId: Int64, invoice: Api.Invoice) - case paymentFormStars(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentForm(let flags, let formId, let botId, let title, let description, let photo, let invoice, let providerId, let url, let nativeProvider, let nativeParams, let additionalMethods, let savedInfo, let savedCredentials, let users): - if boxed { - buffer.appendInt32(-1610250415) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(formId, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) - serializeInt64(providerId, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeString(nativeProvider!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {nativeParams!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(additionalMethods!.count)) - for item in additionalMethods! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 0) != 0 {savedInfo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(savedCredentials!.count)) - for item in savedCredentials! { - item.serialize(buffer, true) - }} + public class Cons_paymentForm { + public var flags: Int32 + public var formId: Int64 + public var botId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var providerId: Int64 + public var url: String + public var nativeProvider: String? + public var nativeParams: Api.DataJSON? + public var additionalMethods: [Api.PaymentFormMethod]? + public var savedInfo: Api.PaymentRequestedInfo? + public var savedCredentials: [Api.PaymentSavedCredentials]? + public var users: [Api.User] + public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, providerId: Int64, url: String, nativeProvider: String?, nativeParams: Api.DataJSON?, additionalMethods: [Api.PaymentFormMethod]?, savedInfo: Api.PaymentRequestedInfo?, savedCredentials: [Api.PaymentSavedCredentials]?, users: [Api.User]) { + self.flags = flags + self.formId = formId + self.botId = botId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.providerId = providerId + self.url = url + self.nativeProvider = nativeProvider + self.nativeParams = nativeParams + self.additionalMethods = additionalMethods + self.savedInfo = savedInfo + self.savedCredentials = savedCredentials + self.users = users + } + } + public class Cons_paymentFormStarGift { + public var formId: Int64 + public var invoice: Api.Invoice + public init(formId: Int64, invoice: Api.Invoice) { + self.formId = formId + self.invoice = invoice + } + } + public class Cons_paymentFormStars { + public var flags: Int32 + public var formId: Int64 + public var botId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var users: [Api.User] + public init(flags: Int32, formId: Int64, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, users: [Api.User]) { + self.flags = flags + self.formId = formId + self.botId = botId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.users = users + } + } + case paymentForm(Cons_paymentForm) + case paymentFormStarGift(Cons_paymentFormStarGift) + case paymentFormStars(Cons_paymentFormStars) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentForm(let _data): + if boxed { + buffer.appendInt32(-1610250415) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.formId, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + serializeInt64(_data.providerId, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeString(_data.nativeProvider!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.nativeParams!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 6) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { + buffer.appendInt32(Int32(_data.additionalMethods!.count)) + for item in _data.additionalMethods! { item.serialize(buffer, true) } - break - case .paymentFormStarGift(let formId, let invoice): - if boxed { - buffer.appendInt32(-1272590367) - } - serializeInt64(formId, buffer: buffer, boxed: false) - invoice.serialize(buffer, true) - break - case .paymentFormStars(let flags, let formId, let botId, let title, let description, let photo, let invoice, let users): - if boxed { - buffer.appendInt32(2079764828) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(formId, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.savedInfo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { + buffer.appendInt32(Int32(_data.savedCredentials!.count)) + for item in _data.savedCredentials! { item.serialize(buffer, true) } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentForm(let flags, let formId, let botId, let title, let description, let photo, let invoice, let providerId, let url, let nativeProvider, let nativeParams, let additionalMethods, let savedInfo, let savedCredentials, let users): - return ("paymentForm", [("flags", flags as Any), ("formId", formId as Any), ("botId", botId as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("providerId", providerId as Any), ("url", url as Any), ("nativeProvider", nativeProvider as Any), ("nativeParams", nativeParams as Any), ("additionalMethods", additionalMethods as Any), ("savedInfo", savedInfo as Any), ("savedCredentials", savedCredentials as Any), ("users", users as Any)]) - case .paymentFormStarGift(let formId, let invoice): - return ("paymentFormStarGift", [("formId", formId as Any), ("invoice", invoice as Any)]) - case .paymentFormStars(let flags, let formId, let botId, let title, let description, let photo, let invoice, let users): - return ("paymentFormStars", [("flags", flags as Any), ("formId", formId as Any), ("botId", botId as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("users", users as Any)]) - } - } - + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .paymentFormStarGift(let _data): + if boxed { + buffer.appendInt32(-1272590367) + } + serializeInt64(_data.formId, buffer: buffer, boxed: false) + _data.invoice.serialize(buffer, true) + break + case .paymentFormStars(let _data): + if boxed { + buffer.appendInt32(2079764828) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.formId, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentForm(let _data): + return ("paymentForm", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("providerId", _data.providerId as Any), ("url", _data.url as Any), ("nativeProvider", _data.nativeProvider as Any), ("nativeParams", _data.nativeParams as Any), ("additionalMethods", _data.additionalMethods as Any), ("savedInfo", _data.savedInfo as Any), ("savedCredentials", _data.savedCredentials as Any), ("users", _data.users as Any)]) + case .paymentFormStarGift(let _data): + return ("paymentFormStarGift", [("formId", _data.formId as Any), ("invoice", _data.invoice as Any)]) + case .paymentFormStars(let _data): + return ("paymentFormStars", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("users", _data.users as Any)]) + } + } + public static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { var _1: Int32? _1 = reader.readInt32() @@ -1382,9 +1752,11 @@ public extension Api.payments { var _5: String? _5 = parseString(reader) var _6: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _7: Api.Invoice? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.Invoice @@ -1394,23 +1766,33 @@ public extension Api.payments { var _9: String? _9 = parseString(reader) var _10: String? - if Int(_1!) & Int(1 << 4) != 0 {_10 = parseString(reader) } + if Int(_1!) & Int(1 << 4) != 0 { + _10 = parseString(reader) + } var _11: Api.DataJSON? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.DataJSON - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + } var _12: [Api.PaymentFormMethod]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentFormMethod.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentFormMethod.self) + } + } var _13: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } var _14: [Api.PaymentSavedCredentials]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) + } + } var _15: [Api.User]? if let _ = reader.readInt32() { _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) @@ -1431,7 +1813,7 @@ public extension Api.payments { let _c14 = (Int(_1!) & Int(1 << 1) == 0) || _14 != nil let _c15 = _15 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { - return Api.payments.PaymentForm.paymentForm(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, providerId: _8!, url: _9!, nativeProvider: _10, nativeParams: _11, additionalMethods: _12, savedInfo: _13, savedCredentials: _14, users: _15!) + return Api.payments.PaymentForm.paymentForm(Cons_paymentForm(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, providerId: _8!, url: _9!, nativeProvider: _10, nativeParams: _11, additionalMethods: _12, savedInfo: _13, savedCredentials: _14, users: _15!)) } else { return nil @@ -1447,7 +1829,7 @@ public extension Api.payments { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.payments.PaymentForm.paymentFormStarGift(formId: _1!, invoice: _2!) + return Api.payments.PaymentForm.paymentFormStarGift(Cons_paymentFormStarGift(formId: _1!, invoice: _2!)) } else { return nil @@ -1465,9 +1847,11 @@ public extension Api.payments { var _5: String? _5 = parseString(reader) var _6: Api.WebDocument? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _7: Api.Invoice? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.Invoice @@ -1485,12 +1869,11 @@ public extension Api.payments { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.payments.PaymentForm.paymentFormStars(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, users: _8!) + return Api.payments.PaymentForm.paymentFormStars(Cons_paymentFormStars(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, users: _8!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api37.swift b/submodules/TelegramApi/Sources/Api37.swift index b657ab7619..083891d23f 100644 --- a/submodules/TelegramApi/Sources/Api37.swift +++ b/submodules/TelegramApi/Sources/Api37.swift @@ -1,66 +1,136 @@ public extension Api.payments { enum PaymentReceipt: TypeConstructorDescription { - case paymentReceipt(flags: Int32, date: Int32, botId: Int64, providerId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, info: Api.PaymentRequestedInfo?, shipping: Api.ShippingOption?, tipAmount: Int64?, currency: String, totalAmount: Int64, credentialsTitle: String, users: [Api.User]) - case paymentReceiptStars(flags: Int32, date: Int32, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, currency: String, totalAmount: Int64, transactionId: String, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentReceipt(let flags, let date, let botId, let providerId, let title, let description, let photo, let invoice, let info, let shipping, let tipAmount, let currency, let totalAmount, let credentialsTitle, let users): - if boxed { - buffer.appendInt32(1891958275) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeInt64(providerId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {info!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {shipping!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(tipAmount!, buffer: buffer, boxed: false)} - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - serializeString(credentialsTitle, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .paymentReceiptStars(let flags, let date, let botId, let title, let description, let photo, let invoice, let currency, let totalAmount, let transactionId, let users): - if boxed { - buffer.appendInt32(-625215430) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(totalAmount, buffer: buffer, boxed: false) - serializeString(transactionId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentReceipt(let flags, let date, let botId, let providerId, let title, let description, let photo, let invoice, let info, let shipping, let tipAmount, let currency, let totalAmount, let credentialsTitle, let users): - return ("paymentReceipt", [("flags", flags as Any), ("date", date as Any), ("botId", botId as Any), ("providerId", providerId as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("info", info as Any), ("shipping", shipping as Any), ("tipAmount", tipAmount as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("credentialsTitle", credentialsTitle as Any), ("users", users as Any)]) - case .paymentReceiptStars(let flags, let date, let botId, let title, let description, let photo, let invoice, let currency, let totalAmount, let transactionId, let users): - return ("paymentReceiptStars", [("flags", flags as Any), ("date", date as Any), ("botId", botId as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("transactionId", transactionId as Any), ("users", users as Any)]) - } - } - + public class Cons_paymentReceipt { + public var flags: Int32 + public var date: Int32 + public var botId: Int64 + public var providerId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var info: Api.PaymentRequestedInfo? + public var shipping: Api.ShippingOption? + public var tipAmount: Int64? + public var currency: String + public var totalAmount: Int64 + public var credentialsTitle: String + public var users: [Api.User] + public init(flags: Int32, date: Int32, botId: Int64, providerId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, info: Api.PaymentRequestedInfo?, shipping: Api.ShippingOption?, tipAmount: Int64?, currency: String, totalAmount: Int64, credentialsTitle: String, users: [Api.User]) { + self.flags = flags + self.date = date + self.botId = botId + self.providerId = providerId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.info = info + self.shipping = shipping + self.tipAmount = tipAmount + self.currency = currency + self.totalAmount = totalAmount + self.credentialsTitle = credentialsTitle + self.users = users + } + } + public class Cons_paymentReceiptStars { + public var flags: Int32 + public var date: Int32 + public var botId: Int64 + public var title: String + public var description: String + public var photo: Api.WebDocument? + public var invoice: Api.Invoice + public var currency: String + public var totalAmount: Int64 + public var transactionId: String + public var users: [Api.User] + public init(flags: Int32, date: Int32, botId: Int64, title: String, description: String, photo: Api.WebDocument?, invoice: Api.Invoice, currency: String, totalAmount: Int64, transactionId: String, users: [Api.User]) { + self.flags = flags + self.date = date + self.botId = botId + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.currency = currency + self.totalAmount = totalAmount + self.transactionId = transactionId + self.users = users + } + } + case paymentReceipt(Cons_paymentReceipt) + case paymentReceiptStars(Cons_paymentReceiptStars) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentReceipt(let _data): + if boxed { + buffer.appendInt32(1891958275) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt64(_data.providerId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.info!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.shipping!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt64(_data.tipAmount!, buffer: buffer, boxed: false) + } + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + serializeString(_data.credentialsTitle, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .paymentReceiptStars(let _data): + if boxed { + buffer.appendInt32(-625215430) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.totalAmount, buffer: buffer, boxed: false) + serializeString(_data.transactionId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentReceipt(let _data): + return ("paymentReceipt", [("flags", _data.flags as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("providerId", _data.providerId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("info", _data.info as Any), ("shipping", _data.shipping as Any), ("tipAmount", _data.tipAmount as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("credentialsTitle", _data.credentialsTitle as Any), ("users", _data.users as Any)]) + case .paymentReceiptStars(let _data): + return ("paymentReceiptStars", [("flags", _data.flags as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("transactionId", _data.transactionId as Any), ("users", _data.users as Any)]) + } + } + public static func parse_paymentReceipt(_ reader: BufferReader) -> PaymentReceipt? { var _1: Int32? _1 = reader.readInt32() @@ -75,23 +145,31 @@ public extension Api.payments { var _6: String? _6 = parseString(reader) var _7: Api.WebDocument? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _8: Api.Invoice? if let signature = reader.readInt32() { _8 = Api.parse(reader, signature: signature) as? Api.Invoice } var _9: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } var _10: Api.ShippingOption? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.ShippingOption - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.ShippingOption + } + } var _11: Int64? - if Int(_1!) & Int(1 << 3) != 0 {_11 = reader.readInt64() } + if Int(_1!) & Int(1 << 3) != 0 { + _11 = reader.readInt64() + } var _12: String? _12 = parseString(reader) var _13: Int64? @@ -118,7 +196,7 @@ public extension Api.payments { let _c14 = _14 != nil let _c15 = _15 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { - return Api.payments.PaymentReceipt.paymentReceipt(flags: _1!, date: _2!, botId: _3!, providerId: _4!, title: _5!, description: _6!, photo: _7, invoice: _8!, info: _9, shipping: _10, tipAmount: _11, currency: _12!, totalAmount: _13!, credentialsTitle: _14!, users: _15!) + return Api.payments.PaymentReceipt.paymentReceipt(Cons_paymentReceipt(flags: _1!, date: _2!, botId: _3!, providerId: _4!, title: _5!, description: _6!, photo: _7, invoice: _8!, info: _9, shipping: _10, tipAmount: _11, currency: _12!, totalAmount: _13!, credentialsTitle: _14!, users: _15!)) } else { return nil @@ -136,9 +214,11 @@ public extension Api.payments { var _5: String? _5 = parseString(reader) var _6: Api.WebDocument? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WebDocument - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } var _7: Api.Invoice? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.Invoice @@ -165,46 +245,57 @@ public extension Api.payments { let _c10 = _10 != nil let _c11 = _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.payments.PaymentReceipt.paymentReceiptStars(flags: _1!, date: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, currency: _8!, totalAmount: _9!, transactionId: _10!, users: _11!) + return Api.payments.PaymentReceipt.paymentReceiptStars(Cons_paymentReceiptStars(flags: _1!, date: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _7!, currency: _8!, totalAmount: _9!, transactionId: _10!, users: _11!)) } else { return nil } } - } } public extension Api.payments { indirect enum PaymentResult: TypeConstructorDescription { - case paymentResult(updates: Api.Updates) - case paymentVerificationNeeded(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentResult(let updates): - if boxed { - buffer.appendInt32(1314881805) - } - updates.serialize(buffer, true) - break - case .paymentVerificationNeeded(let url): - if boxed { - buffer.appendInt32(-666824391) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .paymentResult(let updates): - return ("paymentResult", [("updates", updates as Any)]) - case .paymentVerificationNeeded(let url): - return ("paymentVerificationNeeded", [("url", url as Any)]) - } - } - + public class Cons_paymentResult { + public var updates: Api.Updates + public init(updates: Api.Updates) { + self.updates = updates + } + } + public class Cons_paymentVerificationNeeded { + public var url: String + public init(url: String) { + self.url = url + } + } + case paymentResult(Cons_paymentResult) + case paymentVerificationNeeded(Cons_paymentVerificationNeeded) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .paymentResult(let _data): + if boxed { + buffer.appendInt32(1314881805) + } + _data.updates.serialize(buffer, true) + break + case .paymentVerificationNeeded(let _data): + if boxed { + buffer.appendInt32(-666824391) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .paymentResult(let _data): + return ("paymentResult", [("updates", _data.updates as Any)]) + case .paymentVerificationNeeded(let _data): + return ("paymentVerificationNeeded", [("url", _data.url as Any)]) + } + } + public static func parse_paymentResult(_ reader: BufferReader) -> PaymentResult? { var _1: Api.Updates? if let signature = reader.readInt32() { @@ -212,7 +303,7 @@ public extension Api.payments { } let _c1 = _1 != nil if _c1 { - return Api.payments.PaymentResult.paymentResult(updates: _1!) + return Api.payments.PaymentResult.paymentResult(Cons_paymentResult(updates: _1!)) } else { return nil @@ -223,65 +314,94 @@ public extension Api.payments { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.payments.PaymentResult.paymentVerificationNeeded(url: _1!) + return Api.payments.PaymentResult.paymentVerificationNeeded(Cons_paymentVerificationNeeded(url: _1!)) } else { return nil } } - } } public extension Api.payments { enum ResaleStarGifts: TypeConstructorDescription { - case resaleStarGifts(flags: Int32, count: Int32, gifts: [Api.StarGift], nextOffset: String?, attributes: [Api.StarGiftAttribute]?, attributesHash: Int64?, chats: [Api.Chat], counters: [Api.StarGiftAttributeCounter]?, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .resaleStarGifts(let flags, let count, let gifts, let nextOffset, let attributes, let attributesHash, let chats, let counters, let users): - if boxed { - buffer.appendInt32(-1803939105) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) + public class Cons_resaleStarGifts { + public var flags: Int32 + public var count: Int32 + public var gifts: [Api.StarGift] + public var nextOffset: String? + public var attributes: [Api.StarGiftAttribute]? + public var attributesHash: Int64? + public var chats: [Api.Chat] + public var counters: [Api.StarGiftAttributeCounter]? + public var users: [Api.User] + public init(flags: Int32, count: Int32, gifts: [Api.StarGift], nextOffset: String?, attributes: [Api.StarGiftAttribute]?, attributesHash: Int64?, chats: [Api.Chat], counters: [Api.StarGiftAttributeCounter]?, users: [Api.User]) { + self.flags = flags + self.count = count + self.gifts = gifts + self.nextOffset = nextOffset + self.attributes = attributes + self.attributesHash = attributesHash + self.chats = chats + self.counters = counters + self.users = users + } + } + case resaleStarGifts(Cons_resaleStarGifts) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .resaleStarGifts(let _data): + if boxed { + buffer.appendInt32(-1803939105) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.gifts.count)) + for item in _data.gifts { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(gifts.count)) - for item in gifts { + buffer.appendInt32(Int32(_data.attributes!.count)) + for item in _data.attributes! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes!.count)) - for item in attributes! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(attributesHash!, buffer: buffer, boxed: false)} + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.attributesHash!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { + buffer.appendInt32(Int32(_data.counters!.count)) + for item in _data.counters! { item.serialize(buffer, true) } - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(counters!.count)) - for item in counters! { - item.serialize(buffer, true) - }} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .resaleStarGifts(let flags, let count, let gifts, let nextOffset, let attributes, let attributesHash, let chats, let counters, let users): - return ("resaleStarGifts", [("flags", flags as Any), ("count", count as Any), ("gifts", gifts as Any), ("nextOffset", nextOffset as Any), ("attributes", attributes as Any), ("attributesHash", attributesHash as Any), ("chats", chats as Any), ("counters", counters as Any), ("users", users as Any)]) - } - } - + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .resaleStarGifts(let _data): + return ("resaleStarGifts", [("flags", _data.flags as Any), ("count", _data.count as Any), ("gifts", _data.gifts as Any), ("nextOffset", _data.nextOffset as Any), ("attributes", _data.attributes as Any), ("attributesHash", _data.attributesHash as Any), ("chats", _data.chats as Any), ("counters", _data.counters as Any), ("users", _data.users as Any)]) + } + } + public static func parse_resaleStarGifts(_ reader: BufferReader) -> ResaleStarGifts? { var _1: Int32? _1 = reader.readInt32() @@ -292,21 +412,29 @@ public extension Api.payments { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGift.self) } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: [Api.StarGiftAttribute]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) + } + } var _6: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt64() + } var _7: [Api.Chat]? if let _ = reader.readInt32() { _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } var _8: [Api.StarGiftAttributeCounter]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttributeCounter.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttributeCounter.self) + } + } var _9: [Api.User]? if let _ = reader.readInt32() { _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) @@ -321,112 +449,148 @@ public extension Api.payments { let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.payments.ResaleStarGifts.resaleStarGifts(flags: _1!, count: _2!, gifts: _3!, nextOffset: _4, attributes: _5, attributesHash: _6, chats: _7!, counters: _8, users: _9!) + return Api.payments.ResaleStarGifts.resaleStarGifts(Cons_resaleStarGifts(flags: _1!, count: _2!, gifts: _3!, nextOffset: _4, attributes: _5, attributesHash: _6, chats: _7!, counters: _8, users: _9!)) } else { return nil } } - } } public extension Api.payments { enum SavedInfo: TypeConstructorDescription { - case savedInfo(flags: Int32, savedInfo: Api.PaymentRequestedInfo?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedInfo(let flags, let savedInfo): - if boxed { - buffer.appendInt32(-74456004) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {savedInfo!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedInfo(let flags, let savedInfo): - return ("savedInfo", [("flags", flags as Any), ("savedInfo", savedInfo as Any)]) - } - } - + public class Cons_savedInfo { + public var flags: Int32 + public var savedInfo: Api.PaymentRequestedInfo? + public init(flags: Int32, savedInfo: Api.PaymentRequestedInfo?) { + self.flags = flags + self.savedInfo = savedInfo + } + } + case savedInfo(Cons_savedInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedInfo(let _data): + if boxed { + buffer.appendInt32(-74456004) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.savedInfo!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedInfo(let _data): + return ("savedInfo", [("flags", _data.flags as Any), ("savedInfo", _data.savedInfo as Any)]) + } + } + public static func parse_savedInfo(_ reader: BufferReader) -> SavedInfo? { var _1: Int32? _1 = reader.readInt32() var _2: Api.PaymentRequestedInfo? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.payments.SavedInfo.savedInfo(flags: _1!, savedInfo: _2) + return Api.payments.SavedInfo.savedInfo(Cons_savedInfo(flags: _1!, savedInfo: _2)) } else { return nil } } - } } public extension Api.payments { enum SavedStarGifts: TypeConstructorDescription { - case savedStarGifts(flags: Int32, count: Int32, chatNotificationsEnabled: Api.Bool?, gifts: [Api.SavedStarGift], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedStarGifts(let flags, let count, let chatNotificationsEnabled, let gifts, let nextOffset, let chats, let users): - if boxed { - buffer.appendInt32(-1779201615) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {chatNotificationsEnabled!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(gifts.count)) - for item in gifts { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedStarGifts(let flags, let count, let chatNotificationsEnabled, let gifts, let nextOffset, let chats, let users): - return ("savedStarGifts", [("flags", flags as Any), ("count", count as Any), ("chatNotificationsEnabled", chatNotificationsEnabled as Any), ("gifts", gifts as Any), ("nextOffset", nextOffset as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_savedStarGifts { + public var flags: Int32 + public var count: Int32 + public var chatNotificationsEnabled: Api.Bool? + public var gifts: [Api.SavedStarGift] + public var nextOffset: String? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, chatNotificationsEnabled: Api.Bool?, gifts: [Api.SavedStarGift], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.chatNotificationsEnabled = chatNotificationsEnabled + self.gifts = gifts + self.nextOffset = nextOffset + self.chats = chats + self.users = users + } + } + case savedStarGifts(Cons_savedStarGifts) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedStarGifts(let _data): + if boxed { + buffer.appendInt32(-1779201615) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.chatNotificationsEnabled!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.gifts.count)) + for item in _data.gifts { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedStarGifts(let _data): + return ("savedStarGifts", [("flags", _data.flags as Any), ("count", _data.count as Any), ("chatNotificationsEnabled", _data.chatNotificationsEnabled as Any), ("gifts", _data.gifts as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_savedStarGifts(_ reader: BufferReader) -> SavedStarGifts? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Api.Bool? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _4: [Api.SavedStarGift]? if let _ = reader.readInt32() { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedStarGift.self) } var _5: String? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } var _6: [Api.Chat]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -443,60 +607,68 @@ public extension Api.payments { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.payments.SavedStarGifts.savedStarGifts(flags: _1!, count: _2!, chatNotificationsEnabled: _3, gifts: _4!, nextOffset: _5, chats: _6!, users: _7!) + return Api.payments.SavedStarGifts.savedStarGifts(Cons_savedStarGifts(flags: _1!, count: _2!, chatNotificationsEnabled: _3, gifts: _4!, nextOffset: _5, chats: _6!, users: _7!)) } else { return nil } } - } } public extension Api.payments { enum StarGiftActiveAuctions: TypeConstructorDescription { - case starGiftActiveAuctions(auctions: [Api.StarGiftActiveAuctionState], users: [Api.User], chats: [Api.Chat]) + public class Cons_starGiftActiveAuctions { + public var auctions: [Api.StarGiftActiveAuctionState] + public var users: [Api.User] + public var chats: [Api.Chat] + public init(auctions: [Api.StarGiftActiveAuctionState], users: [Api.User], chats: [Api.Chat]) { + self.auctions = auctions + self.users = users + self.chats = chats + } + } + case starGiftActiveAuctions(Cons_starGiftActiveAuctions) case starGiftActiveAuctionsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftActiveAuctions(let auctions, let users, let chats): - if boxed { - buffer.appendInt32(-1359565892) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(auctions.count)) - for item in auctions { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - break - case .starGiftActiveAuctionsNotModified: - if boxed { - buffer.appendInt32(-617358640) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftActiveAuctions(let auctions, let users, let chats): - return ("starGiftActiveAuctions", [("auctions", auctions as Any), ("users", users as Any), ("chats", chats as Any)]) - case .starGiftActiveAuctionsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftActiveAuctions(let _data): + if boxed { + buffer.appendInt32(-1359565892) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.auctions.count)) + for item in _data.auctions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + break + case .starGiftActiveAuctionsNotModified: + if boxed { + buffer.appendInt32(-617358640) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftActiveAuctions(let _data): + return ("starGiftActiveAuctions", [("auctions", _data.auctions as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + case .starGiftActiveAuctionsNotModified: return ("starGiftActiveAuctionsNotModified", []) - } - } - + } + } + public static func parse_starGiftActiveAuctions(_ reader: BufferReader) -> StarGiftActiveAuctions? { var _1: [Api.StarGiftActiveAuctionState]? if let _ = reader.readInt32() { @@ -514,7 +686,7 @@ public extension Api.payments { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctions(auctions: _1!, users: _2!, chats: _3!) + return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctions(Cons_starGiftActiveAuctions(auctions: _1!, users: _2!, chats: _3!)) } else { return nil @@ -523,45 +695,54 @@ public extension Api.payments { public static func parse_starGiftActiveAuctionsNotModified(_ reader: BufferReader) -> StarGiftActiveAuctions? { return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctionsNotModified } - } } public extension Api.payments { enum StarGiftAuctionAcquiredGifts: TypeConstructorDescription { - case starGiftAuctionAcquiredGifts(gifts: [Api.StarGiftAuctionAcquiredGift], users: [Api.User], chats: [Api.Chat]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionAcquiredGifts(let gifts, let users, let chats): - if boxed { - buffer.appendInt32(2103169520) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(gifts.count)) - for item in gifts { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionAcquiredGifts(let gifts, let users, let chats): - return ("starGiftAuctionAcquiredGifts", [("gifts", gifts as Any), ("users", users as Any), ("chats", chats as Any)]) - } - } - + public class Cons_starGiftAuctionAcquiredGifts { + public var gifts: [Api.StarGiftAuctionAcquiredGift] + public var users: [Api.User] + public var chats: [Api.Chat] + public init(gifts: [Api.StarGiftAuctionAcquiredGift], users: [Api.User], chats: [Api.Chat]) { + self.gifts = gifts + self.users = users + self.chats = chats + } + } + case starGiftAuctionAcquiredGifts(Cons_starGiftAuctionAcquiredGifts) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionAcquiredGifts(let _data): + if boxed { + buffer.appendInt32(2103169520) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.gifts.count)) + for item in _data.gifts { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionAcquiredGifts(let _data): + return ("starGiftAuctionAcquiredGifts", [("gifts", _data.gifts as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + } + } + public static func parse_starGiftAuctionAcquiredGifts(_ reader: BufferReader) -> StarGiftAuctionAcquiredGifts? { var _1: [Api.StarGiftAuctionAcquiredGift]? if let _ = reader.readInt32() { @@ -579,50 +760,65 @@ public extension Api.payments { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.StarGiftAuctionAcquiredGifts.starGiftAuctionAcquiredGifts(gifts: _1!, users: _2!, chats: _3!) + return Api.payments.StarGiftAuctionAcquiredGifts.starGiftAuctionAcquiredGifts(Cons_starGiftAuctionAcquiredGifts(gifts: _1!, users: _2!, chats: _3!)) } else { return nil } } - } } public extension Api.payments { enum StarGiftAuctionState: TypeConstructorDescription { - case starGiftAuctionState(gift: Api.StarGift, state: Api.StarGiftAuctionState, userState: Api.StarGiftAuctionUserState, timeout: Int32, users: [Api.User], chats: [Api.Chat]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionState(let gift, let state, let userState, let timeout, let users, let chats): - if boxed { - buffer.appendInt32(1798960364) - } - gift.serialize(buffer, true) - state.serialize(buffer, true) - userState.serialize(buffer, true) - serializeInt32(timeout, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionState(let gift, let state, let userState, let timeout, let users, let chats): - return ("starGiftAuctionState", [("gift", gift as Any), ("state", state as Any), ("userState", userState as Any), ("timeout", timeout as Any), ("users", users as Any), ("chats", chats as Any)]) - } - } - + public class Cons_starGiftAuctionState { + public var gift: Api.StarGift + public var state: Api.StarGiftAuctionState + public var userState: Api.StarGiftAuctionUserState + public var timeout: Int32 + public var users: [Api.User] + public var chats: [Api.Chat] + public init(gift: Api.StarGift, state: Api.StarGiftAuctionState, userState: Api.StarGiftAuctionUserState, timeout: Int32, users: [Api.User], chats: [Api.Chat]) { + self.gift = gift + self.state = state + self.userState = userState + self.timeout = timeout + self.users = users + self.chats = chats + } + } + case starGiftAuctionState(Cons_starGiftAuctionState) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftAuctionState(let _data): + if boxed { + buffer.appendInt32(1798960364) + } + _data.gift.serialize(buffer, true) + _data.state.serialize(buffer, true) + _data.userState.serialize(buffer, true) + serializeInt32(_data.timeout, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftAuctionState(let _data): + return ("starGiftAuctionState", [("gift", _data.gift as Any), ("state", _data.state as Any), ("userState", _data.userState as Any), ("timeout", _data.timeout as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + } + } + public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { var _1: Api.StarGift? if let signature = reader.readInt32() { @@ -653,50 +849,54 @@ public extension Api.payments { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.payments.StarGiftAuctionState.starGiftAuctionState(gift: _1!, state: _2!, userState: _3!, timeout: _4!, users: _5!, chats: _6!) + return Api.payments.StarGiftAuctionState.starGiftAuctionState(Cons_starGiftAuctionState(gift: _1!, state: _2!, userState: _3!, timeout: _4!, users: _5!, chats: _6!)) } else { return nil } } - } } public extension Api.payments { enum StarGiftCollections: TypeConstructorDescription { - case starGiftCollections(collections: [Api.StarGiftCollection]) + public class Cons_starGiftCollections { + public var collections: [Api.StarGiftCollection] + public init(collections: [Api.StarGiftCollection]) { + self.collections = collections + } + } + case starGiftCollections(Cons_starGiftCollections) case starGiftCollectionsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftCollections(let collections): - if boxed { - buffer.appendInt32(-1977011469) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(collections.count)) - for item in collections { - item.serialize(buffer, true) - } - break - case .starGiftCollectionsNotModified: - if boxed { - buffer.appendInt32(-1598402793) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftCollections(let collections): - return ("starGiftCollections", [("collections", collections as Any)]) - case .starGiftCollectionsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftCollections(let _data): + if boxed { + buffer.appendInt32(-1977011469) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.collections.count)) + for item in _data.collections { + item.serialize(buffer, true) + } + break + case .starGiftCollectionsNotModified: + if boxed { + buffer.appendInt32(-1598402793) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftCollections(let _data): + return ("starGiftCollections", [("collections", _data.collections as Any)]) + case .starGiftCollectionsNotModified: return ("starGiftCollectionsNotModified", []) - } - } - + } + } + public static func parse_starGiftCollections(_ reader: BufferReader) -> StarGiftCollections? { var _1: [Api.StarGiftCollection]? if let _ = reader.readInt32() { @@ -704,7 +904,7 @@ public extension Api.payments { } let _c1 = _1 != nil if _c1 { - return Api.payments.StarGiftCollections.starGiftCollections(collections: _1!) + return Api.payments.StarGiftCollections.starGiftCollections(Cons_starGiftCollections(collections: _1!)) } else { return nil @@ -713,35 +913,40 @@ public extension Api.payments { public static func parse_starGiftCollectionsNotModified(_ reader: BufferReader) -> StarGiftCollections? { return Api.payments.StarGiftCollections.starGiftCollectionsNotModified } - } } public extension Api.payments { enum StarGiftUpgradeAttributes: TypeConstructorDescription { - case starGiftUpgradeAttributes(attributes: [Api.StarGiftAttribute]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftUpgradeAttributes(let attributes): - if boxed { - buffer.appendInt32(1187439471) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftUpgradeAttributes(let attributes): - return ("starGiftUpgradeAttributes", [("attributes", attributes as Any)]) - } - } - + public class Cons_starGiftUpgradeAttributes { + public var attributes: [Api.StarGiftAttribute] + public init(attributes: [Api.StarGiftAttribute]) { + self.attributes = attributes + } + } + case starGiftUpgradeAttributes(Cons_starGiftUpgradeAttributes) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftUpgradeAttributes(let _data): + if boxed { + buffer.appendInt32(1187439471) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftUpgradeAttributes(let _data): + return ("starGiftUpgradeAttributes", [("attributes", _data.attributes as Any)]) + } + } + public static func parse_starGiftUpgradeAttributes(_ reader: BufferReader) -> StarGiftUpgradeAttributes? { var _1: [Api.StarGiftAttribute]? if let _ = reader.readInt32() { @@ -749,51 +954,60 @@ public extension Api.payments { } let _c1 = _1 != nil if _c1 { - return Api.payments.StarGiftUpgradeAttributes.starGiftUpgradeAttributes(attributes: _1!) + return Api.payments.StarGiftUpgradeAttributes.starGiftUpgradeAttributes(Cons_starGiftUpgradeAttributes(attributes: _1!)) } else { return nil } } - } } public extension Api.payments { enum StarGiftUpgradePreview: TypeConstructorDescription { - case starGiftUpgradePreview(sampleAttributes: [Api.StarGiftAttribute], prices: [Api.StarGiftUpgradePrice], nextPrices: [Api.StarGiftUpgradePrice]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftUpgradePreview(let sampleAttributes, let prices, let nextPrices): - if boxed { - buffer.appendInt32(1038213101) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sampleAttributes.count)) - for item in sampleAttributes { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prices.count)) - for item in prices { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(nextPrices.count)) - for item in nextPrices { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftUpgradePreview(let sampleAttributes, let prices, let nextPrices): - return ("starGiftUpgradePreview", [("sampleAttributes", sampleAttributes as Any), ("prices", prices as Any), ("nextPrices", nextPrices as Any)]) - } - } - + public class Cons_starGiftUpgradePreview { + public var sampleAttributes: [Api.StarGiftAttribute] + public var prices: [Api.StarGiftUpgradePrice] + public var nextPrices: [Api.StarGiftUpgradePrice] + public init(sampleAttributes: [Api.StarGiftAttribute], prices: [Api.StarGiftUpgradePrice], nextPrices: [Api.StarGiftUpgradePrice]) { + self.sampleAttributes = sampleAttributes + self.prices = prices + self.nextPrices = nextPrices + } + } + case starGiftUpgradePreview(Cons_starGiftUpgradePreview) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftUpgradePreview(let _data): + if boxed { + buffer.appendInt32(1038213101) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sampleAttributes.count)) + for item in _data.sampleAttributes { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prices.count)) + for item in _data.prices { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.nextPrices.count)) + for item in _data.nextPrices { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftUpgradePreview(let _data): + return ("starGiftUpgradePreview", [("sampleAttributes", _data.sampleAttributes as Any), ("prices", _data.prices as Any), ("nextPrices", _data.nextPrices as Any)]) + } + } + public static func parse_starGiftUpgradePreview(_ reader: BufferReader) -> StarGiftUpgradePreview? { var _1: [Api.StarGiftAttribute]? if let _ = reader.readInt32() { @@ -811,97 +1025,112 @@ public extension Api.payments { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.StarGiftUpgradePreview.starGiftUpgradePreview(sampleAttributes: _1!, prices: _2!, nextPrices: _3!) + return Api.payments.StarGiftUpgradePreview.starGiftUpgradePreview(Cons_starGiftUpgradePreview(sampleAttributes: _1!, prices: _2!, nextPrices: _3!)) } else { return nil } } - } } public extension Api.payments { enum StarGiftWithdrawalUrl: TypeConstructorDescription { - case starGiftWithdrawalUrl(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftWithdrawalUrl(let url): - if boxed { - buffer.appendInt32(-2069218660) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftWithdrawalUrl(let url): - return ("starGiftWithdrawalUrl", [("url", url as Any)]) - } - } - + public class Cons_starGiftWithdrawalUrl { + public var url: String + public init(url: String) { + self.url = url + } + } + case starGiftWithdrawalUrl(Cons_starGiftWithdrawalUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftWithdrawalUrl(let _data): + if boxed { + buffer.appendInt32(-2069218660) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGiftWithdrawalUrl(let _data): + return ("starGiftWithdrawalUrl", [("url", _data.url as Any)]) + } + } + public static func parse_starGiftWithdrawalUrl(_ reader: BufferReader) -> StarGiftWithdrawalUrl? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.payments.StarGiftWithdrawalUrl.starGiftWithdrawalUrl(url: _1!) + return Api.payments.StarGiftWithdrawalUrl.starGiftWithdrawalUrl(Cons_starGiftWithdrawalUrl(url: _1!)) } else { return nil } } - } } public extension Api.payments { enum StarGifts: TypeConstructorDescription { - case starGifts(hash: Int32, gifts: [Api.StarGift], chats: [Api.Chat], users: [Api.User]) + public class Cons_starGifts { + public var hash: Int32 + public var gifts: [Api.StarGift] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(hash: Int32, gifts: [Api.StarGift], chats: [Api.Chat], users: [Api.User]) { + self.hash = hash + self.gifts = gifts + self.chats = chats + self.users = users + } + } + case starGifts(Cons_starGifts) case starGiftsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGifts(let hash, let gifts, let chats, let users): - if boxed { - buffer.appendInt32(785918357) - } - serializeInt32(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(gifts.count)) - for item in gifts { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .starGiftsNotModified: - if boxed { - buffer.appendInt32(-1551326360) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGifts(let hash, let gifts, let chats, let users): - return ("starGifts", [("hash", hash as Any), ("gifts", gifts as Any), ("chats", chats as Any), ("users", users as Any)]) - case .starGiftsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGifts(let _data): + if boxed { + buffer.appendInt32(785918357) + } + serializeInt32(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.gifts.count)) + for item in _data.gifts { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .starGiftsNotModified: + if boxed { + buffer.appendInt32(-1551326360) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starGifts(let _data): + return ("starGifts", [("hash", _data.hash as Any), ("gifts", _data.gifts as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .starGiftsNotModified: return ("starGiftsNotModified", []) - } - } - + } + } + public static func parse_starGifts(_ reader: BufferReader) -> StarGifts? { var _1: Int32? _1 = reader.readInt32() @@ -922,7 +1151,7 @@ public extension Api.payments { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.payments.StarGifts.starGifts(hash: _1!, gifts: _2!, chats: _3!, users: _4!) + return Api.payments.StarGifts.starGifts(Cons_starGifts(hash: _1!, gifts: _2!, chats: _3!, users: _4!)) } else { return nil @@ -931,78 +1160,100 @@ public extension Api.payments { public static func parse_starGiftsNotModified(_ reader: BufferReader) -> StarGifts? { return Api.payments.StarGifts.starGiftsNotModified } - } } public extension Api.payments { enum StarsRevenueAdsAccountUrl: TypeConstructorDescription { - case starsRevenueAdsAccountUrl(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsRevenueAdsAccountUrl(let url): - if boxed { - buffer.appendInt32(961445665) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsRevenueAdsAccountUrl(let url): - return ("starsRevenueAdsAccountUrl", [("url", url as Any)]) - } - } - + public class Cons_starsRevenueAdsAccountUrl { + public var url: String + public init(url: String) { + self.url = url + } + } + case starsRevenueAdsAccountUrl(Cons_starsRevenueAdsAccountUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsRevenueAdsAccountUrl(let _data): + if boxed { + buffer.appendInt32(961445665) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsRevenueAdsAccountUrl(let _data): + return ("starsRevenueAdsAccountUrl", [("url", _data.url as Any)]) + } + } + public static func parse_starsRevenueAdsAccountUrl(_ reader: BufferReader) -> StarsRevenueAdsAccountUrl? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.payments.StarsRevenueAdsAccountUrl.starsRevenueAdsAccountUrl(url: _1!) + return Api.payments.StarsRevenueAdsAccountUrl.starsRevenueAdsAccountUrl(Cons_starsRevenueAdsAccountUrl(url: _1!)) } else { return nil } } - } } public extension Api.payments { enum StarsRevenueStats: TypeConstructorDescription { - case starsRevenueStats(flags: Int32, topHoursGraph: Api.StatsGraph?, revenueGraph: Api.StatsGraph, status: Api.StarsRevenueStatus, usdRate: Double) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsRevenueStats(let flags, let topHoursGraph, let revenueGraph, let status, let usdRate): - if boxed { - buffer.appendInt32(1814066038) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {topHoursGraph!.serialize(buffer, true)} - revenueGraph.serialize(buffer, true) - status.serialize(buffer, true) - serializeDouble(usdRate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsRevenueStats(let flags, let topHoursGraph, let revenueGraph, let status, let usdRate): - return ("starsRevenueStats", [("flags", flags as Any), ("topHoursGraph", topHoursGraph as Any), ("revenueGraph", revenueGraph as Any), ("status", status as Any), ("usdRate", usdRate as Any)]) - } - } - + public class Cons_starsRevenueStats { + public var flags: Int32 + public var topHoursGraph: Api.StatsGraph? + public var revenueGraph: Api.StatsGraph + public var status: Api.StarsRevenueStatus + public var usdRate: Double + public init(flags: Int32, topHoursGraph: Api.StatsGraph?, revenueGraph: Api.StatsGraph, status: Api.StarsRevenueStatus, usdRate: Double) { + self.flags = flags + self.topHoursGraph = topHoursGraph + self.revenueGraph = revenueGraph + self.status = status + self.usdRate = usdRate + } + } + case starsRevenueStats(Cons_starsRevenueStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsRevenueStats(let _data): + if boxed { + buffer.appendInt32(1814066038) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.topHoursGraph!.serialize(buffer, true) + } + _data.revenueGraph.serialize(buffer, true) + _data.status.serialize(buffer, true) + serializeDouble(_data.usdRate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsRevenueStats(let _data): + return ("starsRevenueStats", [("flags", _data.flags as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("revenueGraph", _data.revenueGraph as Any), ("status", _data.status as Any), ("usdRate", _data.usdRate as Any)]) + } + } + public static func parse_starsRevenueStats(_ reader: BufferReader) -> StarsRevenueStats? { var _1: Int32? _1 = reader.readInt32() var _2: Api.StatsGraph? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + } var _3: Api.StatsGraph? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.StatsGraph @@ -1019,97 +1270,133 @@ public extension Api.payments { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.payments.StarsRevenueStats.starsRevenueStats(flags: _1!, topHoursGraph: _2, revenueGraph: _3!, status: _4!, usdRate: _5!) + return Api.payments.StarsRevenueStats.starsRevenueStats(Cons_starsRevenueStats(flags: _1!, topHoursGraph: _2, revenueGraph: _3!, status: _4!, usdRate: _5!)) } else { return nil } } - } } public extension Api.payments { enum StarsRevenueWithdrawalUrl: TypeConstructorDescription { - case starsRevenueWithdrawalUrl(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsRevenueWithdrawalUrl(let url): - if boxed { - buffer.appendInt32(497778871) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsRevenueWithdrawalUrl(let url): - return ("starsRevenueWithdrawalUrl", [("url", url as Any)]) - } - } - + public class Cons_starsRevenueWithdrawalUrl { + public var url: String + public init(url: String) { + self.url = url + } + } + case starsRevenueWithdrawalUrl(Cons_starsRevenueWithdrawalUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsRevenueWithdrawalUrl(let _data): + if boxed { + buffer.appendInt32(497778871) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsRevenueWithdrawalUrl(let _data): + return ("starsRevenueWithdrawalUrl", [("url", _data.url as Any)]) + } + } + public static func parse_starsRevenueWithdrawalUrl(_ reader: BufferReader) -> StarsRevenueWithdrawalUrl? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.payments.StarsRevenueWithdrawalUrl.starsRevenueWithdrawalUrl(url: _1!) + return Api.payments.StarsRevenueWithdrawalUrl.starsRevenueWithdrawalUrl(Cons_starsRevenueWithdrawalUrl(url: _1!)) } else { return nil } } - } } public extension Api.payments { enum StarsStatus: TypeConstructorDescription { - case starsStatus(flags: Int32, balance: Api.StarsAmount, subscriptions: [Api.StarsSubscription]?, subscriptionsNextOffset: String?, subscriptionsMissingBalance: Int64?, history: [Api.StarsTransaction]?, nextOffset: String?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starsStatus(let flags, let balance, let subscriptions, let subscriptionsNextOffset, let subscriptionsMissingBalance, let history, let nextOffset, let chats, let users): - if boxed { - buffer.appendInt32(1822222573) - } - serializeInt32(flags, buffer: buffer, boxed: false) - balance.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(subscriptions!.count)) - for item in subscriptions! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {serializeString(subscriptionsNextOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(subscriptionsMissingBalance!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(history!.count)) - for item in history! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} + public class Cons_starsStatus { + public var flags: Int32 + public var balance: Api.StarsAmount + public var subscriptions: [Api.StarsSubscription]? + public var subscriptionsNextOffset: String? + public var subscriptionsMissingBalance: Int64? + public var history: [Api.StarsTransaction]? + public var nextOffset: String? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, balance: Api.StarsAmount, subscriptions: [Api.StarsSubscription]?, subscriptionsNextOffset: String?, subscriptionsMissingBalance: Int64?, history: [Api.StarsTransaction]?, nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.balance = balance + self.subscriptions = subscriptions + self.subscriptionsNextOffset = subscriptionsNextOffset + self.subscriptionsMissingBalance = subscriptionsMissingBalance + self.history = history + self.nextOffset = nextOffset + self.chats = chats + self.users = users + } + } + case starsStatus(Cons_starsStatus) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starsStatus(let _data): + if boxed { + buffer.appendInt32(1822222573) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.balance.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 1) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { + buffer.appendInt32(Int32(_data.subscriptions!.count)) + for item in _data.subscriptions! { item.serialize(buffer, true) } + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.subscriptionsNextOffset!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.subscriptionsMissingBalance!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { + buffer.appendInt32(Int32(_data.history!.count)) + for item in _data.history! { item.serialize(buffer, true) } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starsStatus(let flags, let balance, let subscriptions, let subscriptionsNextOffset, let subscriptionsMissingBalance, let history, let nextOffset, let chats, let users): - return ("starsStatus", [("flags", flags as Any), ("balance", balance as Any), ("subscriptions", subscriptions as Any), ("subscriptionsNextOffset", subscriptionsNextOffset as Any), ("subscriptionsMissingBalance", subscriptionsMissingBalance as Any), ("history", history as Any), ("nextOffset", nextOffset as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .starsStatus(let _data): + return ("starsStatus", [("flags", _data.flags as Any), ("balance", _data.balance as Any), ("subscriptions", _data.subscriptions as Any), ("subscriptionsNextOffset", _data.subscriptionsNextOffset as Any), ("subscriptionsMissingBalance", _data.subscriptionsMissingBalance as Any), ("history", _data.history as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_starsStatus(_ reader: BufferReader) -> StarsStatus? { var _1: Int32? _1 = reader.readInt32() @@ -1118,19 +1405,29 @@ public extension Api.payments { _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount } var _3: [Api.StarsSubscription]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsSubscription.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsSubscription.self) + } + } var _4: String? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } var _5: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt64() + } var _6: [Api.StarsTransaction]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTransaction.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTransaction.self) + } + } var _7: String? - if Int(_1!) & Int(1 << 0) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } var _8: [Api.Chat]? if let _ = reader.readInt32() { _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -1149,49 +1446,64 @@ public extension Api.payments { let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.payments.StarsStatus.starsStatus(flags: _1!, balance: _2!, subscriptions: _3, subscriptionsNextOffset: _4, subscriptionsMissingBalance: _5, history: _6, nextOffset: _7, chats: _8!, users: _9!) + return Api.payments.StarsStatus.starsStatus(Cons_starsStatus(flags: _1!, balance: _2!, subscriptions: _3, subscriptionsNextOffset: _4, subscriptionsMissingBalance: _5, history: _6, nextOffset: _7, chats: _8!, users: _9!)) } else { return nil } } - } } public extension Api.payments { enum SuggestedStarRefBots: TypeConstructorDescription { - case suggestedStarRefBots(flags: Int32, count: Int32, suggestedBots: [Api.StarRefProgram], users: [Api.User], nextOffset: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .suggestedStarRefBots(let flags, let count, let suggestedBots, let users, let nextOffset): - if boxed { - buffer.appendInt32(-1261053863) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(suggestedBots.count)) - for item in suggestedBots { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .suggestedStarRefBots(let flags, let count, let suggestedBots, let users, let nextOffset): - return ("suggestedStarRefBots", [("flags", flags as Any), ("count", count as Any), ("suggestedBots", suggestedBots as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_suggestedStarRefBots { + public var flags: Int32 + public var count: Int32 + public var suggestedBots: [Api.StarRefProgram] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, count: Int32, suggestedBots: [Api.StarRefProgram], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.count = count + self.suggestedBots = suggestedBots + self.users = users + self.nextOffset = nextOffset + } + } + case suggestedStarRefBots(Cons_suggestedStarRefBots) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .suggestedStarRefBots(let _data): + if boxed { + buffer.appendInt32(-1261053863) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.suggestedBots.count)) + for item in _data.suggestedBots { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .suggestedStarRefBots(let _data): + return ("suggestedStarRefBots", [("flags", _data.flags as Any), ("count", _data.count as Any), ("suggestedBots", _data.suggestedBots as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_suggestedStarRefBots(_ reader: BufferReader) -> SuggestedStarRefBots? { var _1: Int32? _1 = reader.readInt32() @@ -1206,54 +1518,65 @@ public extension Api.payments { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _5: String? - if Int(_1!) & Int(1 << 0) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.payments.SuggestedStarRefBots.suggestedStarRefBots(flags: _1!, count: _2!, suggestedBots: _3!, users: _4!, nextOffset: _5) + return Api.payments.SuggestedStarRefBots.suggestedStarRefBots(Cons_suggestedStarRefBots(flags: _1!, count: _2!, suggestedBots: _3!, users: _4!, nextOffset: _5)) } else { return nil } } - } } public extension Api.payments { enum UniqueStarGift: TypeConstructorDescription { - case uniqueStarGift(gift: Api.StarGift, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .uniqueStarGift(let gift, let chats, let users): - if boxed { - buffer.appendInt32(1097619176) - } - gift.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .uniqueStarGift(let gift, let chats, let users): - return ("uniqueStarGift", [("gift", gift as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_uniqueStarGift { + public var gift: Api.StarGift + public var chats: [Api.Chat] + public var users: [Api.User] + public init(gift: Api.StarGift, chats: [Api.Chat], users: [Api.User]) { + self.gift = gift + self.chats = chats + self.users = users + } + } + case uniqueStarGift(Cons_uniqueStarGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .uniqueStarGift(let _data): + if boxed { + buffer.appendInt32(1097619176) + } + _data.gift.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .uniqueStarGift(let _data): + return ("uniqueStarGift", [("gift", _data.gift as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_uniqueStarGift(_ reader: BufferReader) -> UniqueStarGift? { var _1: Api.StarGift? if let signature = reader.readInt32() { @@ -1271,49 +1594,92 @@ public extension Api.payments { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.UniqueStarGift.uniqueStarGift(gift: _1!, chats: _2!, users: _3!) + return Api.payments.UniqueStarGift.uniqueStarGift(Cons_uniqueStarGift(gift: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.payments { enum UniqueStarGiftValueInfo: TypeConstructorDescription { - case uniqueStarGiftValueInfo(flags: Int32, currency: String, value: Int64, initialSaleDate: Int32, initialSaleStars: Int64, initialSalePrice: Int64, lastSaleDate: Int32?, lastSalePrice: Int64?, floorPrice: Int64?, averagePrice: Int64?, listedCount: Int32?, fragmentListedCount: Int32?, fragmentListedUrl: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .uniqueStarGiftValueInfo(let flags, let currency, let value, let initialSaleDate, let initialSaleStars, let initialSalePrice, let lastSaleDate, let lastSalePrice, let floorPrice, let averagePrice, let listedCount, let fragmentListedCount, let fragmentListedUrl): - if boxed { - buffer.appendInt32(1362093126) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(currency, buffer: buffer, boxed: false) - serializeInt64(value, buffer: buffer, boxed: false) - serializeInt32(initialSaleDate, buffer: buffer, boxed: false) - serializeInt64(initialSaleStars, buffer: buffer, boxed: false) - serializeInt64(initialSalePrice, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(lastSaleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(lastSalePrice!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(floorPrice!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(averagePrice!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(listedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(fragmentListedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(fragmentListedUrl!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .uniqueStarGiftValueInfo(let flags, let currency, let value, let initialSaleDate, let initialSaleStars, let initialSalePrice, let lastSaleDate, let lastSalePrice, let floorPrice, let averagePrice, let listedCount, let fragmentListedCount, let fragmentListedUrl): - return ("uniqueStarGiftValueInfo", [("flags", flags as Any), ("currency", currency as Any), ("value", value as Any), ("initialSaleDate", initialSaleDate as Any), ("initialSaleStars", initialSaleStars as Any), ("initialSalePrice", initialSalePrice as Any), ("lastSaleDate", lastSaleDate as Any), ("lastSalePrice", lastSalePrice as Any), ("floorPrice", floorPrice as Any), ("averagePrice", averagePrice as Any), ("listedCount", listedCount as Any), ("fragmentListedCount", fragmentListedCount as Any), ("fragmentListedUrl", fragmentListedUrl as Any)]) - } - } - + public class Cons_uniqueStarGiftValueInfo { + public var flags: Int32 + public var currency: String + public var value: Int64 + public var initialSaleDate: Int32 + public var initialSaleStars: Int64 + public var initialSalePrice: Int64 + public var lastSaleDate: Int32? + public var lastSalePrice: Int64? + public var floorPrice: Int64? + public var averagePrice: Int64? + public var listedCount: Int32? + public var fragmentListedCount: Int32? + public var fragmentListedUrl: String? + public init(flags: Int32, currency: String, value: Int64, initialSaleDate: Int32, initialSaleStars: Int64, initialSalePrice: Int64, lastSaleDate: Int32?, lastSalePrice: Int64?, floorPrice: Int64?, averagePrice: Int64?, listedCount: Int32?, fragmentListedCount: Int32?, fragmentListedUrl: String?) { + self.flags = flags + self.currency = currency + self.value = value + self.initialSaleDate = initialSaleDate + self.initialSaleStars = initialSaleStars + self.initialSalePrice = initialSalePrice + self.lastSaleDate = lastSaleDate + self.lastSalePrice = lastSalePrice + self.floorPrice = floorPrice + self.averagePrice = averagePrice + self.listedCount = listedCount + self.fragmentListedCount = fragmentListedCount + self.fragmentListedUrl = fragmentListedUrl + } + } + case uniqueStarGiftValueInfo(Cons_uniqueStarGiftValueInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .uniqueStarGiftValueInfo(let _data): + if boxed { + buffer.appendInt32(1362093126) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.currency, buffer: buffer, boxed: false) + serializeInt64(_data.value, buffer: buffer, boxed: false) + serializeInt32(_data.initialSaleDate, buffer: buffer, boxed: false) + serializeInt64(_data.initialSaleStars, buffer: buffer, boxed: false) + serializeInt64(_data.initialSalePrice, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.lastSaleDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.lastSalePrice!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.floorPrice!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt64(_data.averagePrice!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.listedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.fragmentListedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.fragmentListedUrl!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .uniqueStarGiftValueInfo(let _data): + return ("uniqueStarGiftValueInfo", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("value", _data.value as Any), ("initialSaleDate", _data.initialSaleDate as Any), ("initialSaleStars", _data.initialSaleStars as Any), ("initialSalePrice", _data.initialSalePrice as Any), ("lastSaleDate", _data.lastSaleDate as Any), ("lastSalePrice", _data.lastSalePrice as Any), ("floorPrice", _data.floorPrice as Any), ("averagePrice", _data.averagePrice as Any), ("listedCount", _data.listedCount as Any), ("fragmentListedCount", _data.fragmentListedCount as Any), ("fragmentListedUrl", _data.fragmentListedUrl as Any)]) + } + } + public static func parse_uniqueStarGiftValueInfo(_ reader: BufferReader) -> UniqueStarGiftValueInfo? { var _1: Int32? _1 = reader.readInt32() @@ -1328,19 +1694,33 @@ public extension Api.payments { var _6: Int64? _6 = reader.readInt64() var _7: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = reader.readInt32() + } var _8: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_8 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _8 = reader.readInt64() + } var _9: Int64? - if Int(_1!) & Int(1 << 2) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 2) != 0 { + _9 = reader.readInt64() + } var _10: Int64? - if Int(_1!) & Int(1 << 3) != 0 {_10 = reader.readInt64() } + if Int(_1!) & Int(1 << 3) != 0 { + _10 = reader.readInt64() + } var _11: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _11 = reader.readInt32() + } var _12: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _12 = reader.readInt32() + } var _13: String? - if Int(_1!) & Int(1 << 5) != 0 {_13 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _13 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1355,139 +1735,174 @@ public extension Api.payments { let _c12 = (Int(_1!) & Int(1 << 5) == 0) || _12 != nil let _c13 = (Int(_1!) & Int(1 << 5) == 0) || _13 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.payments.UniqueStarGiftValueInfo.uniqueStarGiftValueInfo(flags: _1!, currency: _2!, value: _3!, initialSaleDate: _4!, initialSaleStars: _5!, initialSalePrice: _6!, lastSaleDate: _7, lastSalePrice: _8, floorPrice: _9, averagePrice: _10, listedCount: _11, fragmentListedCount: _12, fragmentListedUrl: _13) + return Api.payments.UniqueStarGiftValueInfo.uniqueStarGiftValueInfo(Cons_uniqueStarGiftValueInfo(flags: _1!, currency: _2!, value: _3!, initialSaleDate: _4!, initialSaleStars: _5!, initialSalePrice: _6!, lastSaleDate: _7, lastSalePrice: _8, floorPrice: _9, averagePrice: _10, listedCount: _11, fragmentListedCount: _12, fragmentListedUrl: _13)) } else { return nil } } - } } public extension Api.payments { enum ValidatedRequestedInfo: TypeConstructorDescription { - case validatedRequestedInfo(flags: Int32, id: String?, shippingOptions: [Api.ShippingOption]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .validatedRequestedInfo(let flags, let id, let shippingOptions): - if boxed { - buffer.appendInt32(-784000893) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(id!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(shippingOptions!.count)) - for item in shippingOptions! { + public class Cons_validatedRequestedInfo { + public var flags: Int32 + public var id: String? + public var shippingOptions: [Api.ShippingOption]? + public init(flags: Int32, id: String?, shippingOptions: [Api.ShippingOption]?) { + self.flags = flags + self.id = id + self.shippingOptions = shippingOptions + } + } + case validatedRequestedInfo(Cons_validatedRequestedInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .validatedRequestedInfo(let _data): + if boxed { + buffer.appendInt32(-784000893) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.id!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.shippingOptions!.count)) + for item in _data.shippingOptions! { item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .validatedRequestedInfo(let flags, let id, let shippingOptions): - return ("validatedRequestedInfo", [("flags", flags as Any), ("id", id as Any), ("shippingOptions", shippingOptions as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .validatedRequestedInfo(let _data): + return ("validatedRequestedInfo", [("flags", _data.flags as Any), ("id", _data.id as Any), ("shippingOptions", _data.shippingOptions as Any)]) + } + } + public static func parse_validatedRequestedInfo(_ reader: BufferReader) -> ValidatedRequestedInfo? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: [Api.ShippingOption]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ShippingOption.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ShippingOption.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.payments.ValidatedRequestedInfo.validatedRequestedInfo(flags: _1!, id: _2, shippingOptions: _3) + return Api.payments.ValidatedRequestedInfo.validatedRequestedInfo(Cons_validatedRequestedInfo(flags: _1!, id: _2, shippingOptions: _3)) } else { return nil } } - } } public extension Api.phone { enum ExportedGroupCallInvite: TypeConstructorDescription { - case exportedGroupCallInvite(link: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedGroupCallInvite(let link): - if boxed { - buffer.appendInt32(541839704) - } - serializeString(link, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedGroupCallInvite(let link): - return ("exportedGroupCallInvite", [("link", link as Any)]) - } - } - + public class Cons_exportedGroupCallInvite { + public var link: String + public init(link: String) { + self.link = link + } + } + case exportedGroupCallInvite(Cons_exportedGroupCallInvite) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedGroupCallInvite(let _data): + if boxed { + buffer.appendInt32(541839704) + } + serializeString(_data.link, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedGroupCallInvite(let _data): + return ("exportedGroupCallInvite", [("link", _data.link as Any)]) + } + } + public static func parse_exportedGroupCallInvite(_ reader: BufferReader) -> ExportedGroupCallInvite? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.phone.ExportedGroupCallInvite.exportedGroupCallInvite(link: _1!) + return Api.phone.ExportedGroupCallInvite.exportedGroupCallInvite(Cons_exportedGroupCallInvite(link: _1!)) } else { return nil } } - } } public extension Api.phone { enum GroupCall: TypeConstructorDescription { - case groupCall(call: Api.GroupCall, participants: [Api.GroupCallParticipant], participantsNextOffset: String, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCall(let call, let participants, let participantsNextOffset, let chats, let users): - if boxed { - buffer.appendInt32(-1636664659) - } - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants.count)) - for item in participants { - item.serialize(buffer, true) - } - serializeString(participantsNextOffset, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCall(let call, let participants, let participantsNextOffset, let chats, let users): - return ("groupCall", [("call", call as Any), ("participants", participants as Any), ("participantsNextOffset", participantsNextOffset as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_groupCall { + public var call: Api.GroupCall + public var participants: [Api.GroupCallParticipant] + public var participantsNextOffset: String + public var chats: [Api.Chat] + public var users: [Api.User] + public init(call: Api.GroupCall, participants: [Api.GroupCallParticipant], participantsNextOffset: String, chats: [Api.Chat], users: [Api.User]) { + self.call = call + self.participants = participants + self.participantsNextOffset = participantsNextOffset + self.chats = chats + self.users = users + } + } + case groupCall(Cons_groupCall) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCall(let _data): + if boxed { + buffer.appendInt32(-1636664659) + } + _data.call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + serializeString(_data.participantsNextOffset, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCall(let _data): + return ("groupCall", [("call", _data.call as Any), ("participants", _data.participants as Any), ("participantsNextOffset", _data.participantsNextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_groupCall(_ reader: BufferReader) -> GroupCall? { var _1: Api.GroupCall? if let signature = reader.readInt32() { @@ -1513,52 +1928,63 @@ public extension Api.phone { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.phone.GroupCall.groupCall(call: _1!, participants: _2!, participantsNextOffset: _3!, chats: _4!, users: _5!) + return Api.phone.GroupCall.groupCall(Cons_groupCall(call: _1!, participants: _2!, participantsNextOffset: _3!, chats: _4!, users: _5!)) } else { return nil } } - } } public extension Api.phone { enum GroupCallStars: TypeConstructorDescription { - case groupCallStars(totalStars: Int64, topDonors: [Api.GroupCallDonor], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStars(let totalStars, let topDonors, let chats, let users): - if boxed { - buffer.appendInt32(-1658995418) - } - serializeInt64(totalStars, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topDonors.count)) - for item in topDonors { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStars(let totalStars, let topDonors, let chats, let users): - return ("groupCallStars", [("totalStars", totalStars as Any), ("topDonors", topDonors as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_groupCallStars { + public var totalStars: Int64 + public var topDonors: [Api.GroupCallDonor] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(totalStars: Int64, topDonors: [Api.GroupCallDonor], chats: [Api.Chat], users: [Api.User]) { + self.totalStars = totalStars + self.topDonors = topDonors + self.chats = chats + self.users = users + } + } + case groupCallStars(Cons_groupCallStars) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStars(let _data): + if boxed { + buffer.appendInt32(-1658995418) + } + serializeInt64(_data.totalStars, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topDonors.count)) + for item in _data.topDonors { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStars(let _data): + return ("groupCallStars", [("totalStars", _data.totalStars as Any), ("topDonors", _data.topDonors as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_groupCallStars(_ reader: BufferReader) -> GroupCallStars? { var _1: Int64? _1 = reader.readInt64() @@ -1579,41 +2005,46 @@ public extension Api.phone { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.phone.GroupCallStars.groupCallStars(totalStars: _1!, topDonors: _2!, chats: _3!, users: _4!) + return Api.phone.GroupCallStars.groupCallStars(Cons_groupCallStars(totalStars: _1!, topDonors: _2!, chats: _3!, users: _4!)) } else { return nil } } - } } public extension Api.phone { enum GroupCallStreamChannels: TypeConstructorDescription { - case groupCallStreamChannels(channels: [Api.GroupCallStreamChannel]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStreamChannels(let channels): - if boxed { - buffer.appendInt32(-790330702) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(channels.count)) - for item in channels { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStreamChannels(let channels): - return ("groupCallStreamChannels", [("channels", channels as Any)]) - } - } - + public class Cons_groupCallStreamChannels { + public var channels: [Api.GroupCallStreamChannel] + public init(channels: [Api.GroupCallStreamChannel]) { + self.channels = channels + } + } + case groupCallStreamChannels(Cons_groupCallStreamChannels) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStreamChannels(let _data): + if boxed { + buffer.appendInt32(-790330702) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.channels.count)) + for item in _data.channels { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStreamChannels(let _data): + return ("groupCallStreamChannels", [("channels", _data.channels as Any)]) + } + } + public static func parse_groupCallStreamChannels(_ reader: BufferReader) -> GroupCallStreamChannels? { var _1: [Api.GroupCallStreamChannel]? if let _ = reader.readInt32() { @@ -1621,38 +2052,45 @@ public extension Api.phone { } let _c1 = _1 != nil if _c1 { - return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(channels: _1!) + return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(Cons_groupCallStreamChannels(channels: _1!)) } else { return nil } } - } } public extension Api.phone { enum GroupCallStreamRtmpUrl: TypeConstructorDescription { - case groupCallStreamRtmpUrl(url: String, key: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStreamRtmpUrl(let url, let key): - if boxed { - buffer.appendInt32(767505458) - } - serializeString(url, buffer: buffer, boxed: false) - serializeString(key, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStreamRtmpUrl(let url, let key): - return ("groupCallStreamRtmpUrl", [("url", url as Any), ("key", key as Any)]) - } - } - + public class Cons_groupCallStreamRtmpUrl { + public var url: String + public var key: String + public init(url: String, key: String) { + self.url = url + self.key = key + } + } + case groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStreamRtmpUrl(let _data): + if boxed { + buffer.appendInt32(767505458) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.key, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStreamRtmpUrl(let _data): + return ("groupCallStreamRtmpUrl", [("url", _data.url as Any), ("key", _data.key as Any)]) + } + } + public static func parse_groupCallStreamRtmpUrl(_ reader: BufferReader) -> GroupCallStreamRtmpUrl? { var _1: String? _1 = parseString(reader) @@ -1661,54 +2099,69 @@ public extension Api.phone { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(url: _1!, key: _2!) + return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl(url: _1!, key: _2!)) } else { return nil } } - } } public extension Api.phone { enum GroupParticipants: TypeConstructorDescription { - case groupParticipants(count: Int32, participants: [Api.GroupCallParticipant], nextOffset: String, chats: [Api.Chat], users: [Api.User], version: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupParticipants(let count, let participants, let nextOffset, let chats, let users, let version): - if boxed { - buffer.appendInt32(-193506890) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants.count)) - for item in participants { - item.serialize(buffer, true) - } - serializeString(nextOffset, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - serializeInt32(version, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupParticipants(let count, let participants, let nextOffset, let chats, let users, let version): - return ("groupParticipants", [("count", count as Any), ("participants", participants as Any), ("nextOffset", nextOffset as Any), ("chats", chats as Any), ("users", users as Any), ("version", version as Any)]) - } - } - + public class Cons_groupParticipants { + public var count: Int32 + public var participants: [Api.GroupCallParticipant] + public var nextOffset: String + public var chats: [Api.Chat] + public var users: [Api.User] + public var version: Int32 + public init(count: Int32, participants: [Api.GroupCallParticipant], nextOffset: String, chats: [Api.Chat], users: [Api.User], version: Int32) { + self.count = count + self.participants = participants + self.nextOffset = nextOffset + self.chats = chats + self.users = users + self.version = version + } + } + case groupParticipants(Cons_groupParticipants) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupParticipants(let _data): + if boxed { + buffer.appendInt32(-193506890) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + serializeString(_data.nextOffset, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupParticipants(let _data): + return ("groupParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("version", _data.version as Any)]) + } + } + public static func parse_groupParticipants(_ reader: BufferReader) -> GroupParticipants? { var _1: Int32? _1 = reader.readInt32() @@ -1735,12 +2188,11 @@ public extension Api.phone { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.phone.GroupParticipants.groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!) + return Api.phone.GroupParticipants.groupParticipants(Cons_groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api38.swift b/submodules/TelegramApi/Sources/Api38.swift index 4d5a192fea..17cdf6bb96 100644 --- a/submodules/TelegramApi/Sources/Api38.swift +++ b/submodules/TelegramApi/Sources/Api38.swift @@ -1,39 +1,49 @@ public extension Api.phone { enum JoinAsPeers: TypeConstructorDescription { - case joinAsPeers(peers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .joinAsPeers(let peers, let chats, let users): - if boxed { - buffer.appendInt32(-1343921601) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .joinAsPeers(let peers, let chats, let users): - return ("joinAsPeers", [("peers", peers as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_joinAsPeers { + public var peers: [Api.Peer] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(peers: [Api.Peer], chats: [Api.Chat], users: [Api.User]) { + self.peers = peers + self.chats = chats + self.users = users + } + } + case joinAsPeers(Cons_joinAsPeers) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .joinAsPeers(let _data): + if boxed { + buffer.appendInt32(-1343921601) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .joinAsPeers(let _data): + return ("joinAsPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_joinAsPeers(_ reader: BufferReader) -> JoinAsPeers? { var _1: [Api.Peer]? if let _ = reader.readInt32() { @@ -51,42 +61,49 @@ public extension Api.phone { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.phone.JoinAsPeers.joinAsPeers(peers: _1!, chats: _2!, users: _3!) + return Api.phone.JoinAsPeers.joinAsPeers(Cons_joinAsPeers(peers: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.phone { enum PhoneCall: TypeConstructorDescription { - case phoneCall(phoneCall: Api.PhoneCall, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneCall(let phoneCall, let users): - if boxed { - buffer.appendInt32(-326966976) - } - phoneCall.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneCall(let phoneCall, let users): - return ("phoneCall", [("phoneCall", phoneCall as Any), ("users", users as Any)]) - } - } - + public class Cons_phoneCall { + public var phoneCall: Api.PhoneCall + public var users: [Api.User] + public init(phoneCall: Api.PhoneCall, users: [Api.User]) { + self.phoneCall = phoneCall + self.users = users + } + } + case phoneCall(Cons_phoneCall) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .phoneCall(let _data): + if boxed { + buffer.appendInt32(-326966976) + } + _data.phoneCall.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .phoneCall(let _data): + return ("phoneCall", [("phoneCall", _data.phoneCall as Any), ("users", _data.users as Any)]) + } + } + public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { var _1: Api.PhoneCall? if let signature = reader.readInt32() { @@ -99,42 +116,49 @@ public extension Api.phone { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.phone.PhoneCall.phoneCall(phoneCall: _1!, users: _2!) + return Api.phone.PhoneCall.phoneCall(Cons_phoneCall(phoneCall: _1!, users: _2!)) } else { return nil } } - } } public extension Api.photos { enum Photo: TypeConstructorDescription { - case photo(photo: Api.Photo, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .photo(let photo, let users): - if boxed { - buffer.appendInt32(539045032) - } - photo.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .photo(let photo, let users): - return ("photo", [("photo", photo as Any), ("users", users as Any)]) - } - } - + public class Cons_photo { + public var photo: Api.Photo + public var users: [Api.User] + public init(photo: Api.Photo, users: [Api.User]) { + self.photo = photo + self.users = users + } + } + case photo(Cons_photo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .photo(let _data): + if boxed { + buffer.appendInt32(539045032) + } + _data.photo.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .photo(let _data): + return ("photo", [("photo", _data.photo as Any), ("users", _data.users as Any)]) + } + } + public static func parse_photo(_ reader: BufferReader) -> Photo? { var _1: Api.Photo? if let signature = reader.readInt32() { @@ -147,65 +171,82 @@ public extension Api.photos { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.photos.Photo.photo(photo: _1!, users: _2!) + return Api.photos.Photo.photo(Cons_photo(photo: _1!, users: _2!)) } else { return nil } } - } } public extension Api.photos { enum Photos: TypeConstructorDescription { - case photos(photos: [Api.Photo], users: [Api.User]) - case photosSlice(count: Int32, photos: [Api.Photo], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .photos(let photos, let users): - if boxed { - buffer.appendInt32(-1916114267) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(photos.count)) - for item in photos { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .photosSlice(let count, let photos, let users): - if boxed { - buffer.appendInt32(352657236) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(photos.count)) - for item in photos { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .photos(let photos, let users): - return ("photos", [("photos", photos as Any), ("users", users as Any)]) - case .photosSlice(let count, let photos, let users): - return ("photosSlice", [("count", count as Any), ("photos", photos as Any), ("users", users as Any)]) - } - } - + public class Cons_photos { + public var photos: [Api.Photo] + public var users: [Api.User] + public init(photos: [Api.Photo], users: [Api.User]) { + self.photos = photos + self.users = users + } + } + public class Cons_photosSlice { + public var count: Int32 + public var photos: [Api.Photo] + public var users: [Api.User] + public init(count: Int32, photos: [Api.Photo], users: [Api.User]) { + self.count = count + self.photos = photos + self.users = users + } + } + case photos(Cons_photos) + case photosSlice(Cons_photosSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .photos(let _data): + if boxed { + buffer.appendInt32(-1916114267) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.photos.count)) + for item in _data.photos { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .photosSlice(let _data): + if boxed { + buffer.appendInt32(352657236) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.photos.count)) + for item in _data.photos { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .photos(let _data): + return ("photos", [("photos", _data.photos as Any), ("users", _data.users as Any)]) + case .photosSlice(let _data): + return ("photosSlice", [("count", _data.count as Any), ("photos", _data.photos as Any), ("users", _data.users as Any)]) + } + } + public static func parse_photos(_ reader: BufferReader) -> Photos? { var _1: [Api.Photo]? if let _ = reader.readInt32() { @@ -218,7 +259,7 @@ public extension Api.photos { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.photos.Photos.photos(photos: _1!, users: _2!) + return Api.photos.Photos.photos(Cons_photos(photos: _1!, users: _2!)) } else { return nil @@ -239,49 +280,64 @@ public extension Api.photos { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.photos.Photos.photosSlice(count: _1!, photos: _2!, users: _3!) + return Api.photos.Photos.photosSlice(Cons_photosSlice(count: _1!, photos: _2!, users: _3!)) } else { return nil } } - } } public extension Api.premium { enum BoostsList: TypeConstructorDescription { - case boostsList(flags: Int32, count: Int32, boosts: [Api.Boost], nextOffset: String?, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .boostsList(let flags, let count, let boosts, let nextOffset, let users): - if boxed { - buffer.appendInt32(-2030542532) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(boosts.count)) - for item in boosts { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .boostsList(let flags, let count, let boosts, let nextOffset, let users): - return ("boostsList", [("flags", flags as Any), ("count", count as Any), ("boosts", boosts as Any), ("nextOffset", nextOffset as Any), ("users", users as Any)]) - } - } - + public class Cons_boostsList { + public var flags: Int32 + public var count: Int32 + public var boosts: [Api.Boost] + public var nextOffset: String? + public var users: [Api.User] + public init(flags: Int32, count: Int32, boosts: [Api.Boost], nextOffset: String?, users: [Api.User]) { + self.flags = flags + self.count = count + self.boosts = boosts + self.nextOffset = nextOffset + self.users = users + } + } + case boostsList(Cons_boostsList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .boostsList(let _data): + if boxed { + buffer.appendInt32(-2030542532) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.boosts.count)) + for item in _data.boosts { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .boostsList(let _data): + return ("boostsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("boosts", _data.boosts as Any), ("nextOffset", _data.nextOffset as Any), ("users", _data.users as Any)]) + } + } + public static func parse_boostsList(_ reader: BufferReader) -> BoostsList? { var _1: Int32? _1 = reader.readInt32() @@ -292,7 +348,9 @@ public extension Api.premium { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Boost.self) } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: [Api.User]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) @@ -303,54 +361,87 @@ public extension Api.premium { let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.premium.BoostsList.boostsList(flags: _1!, count: _2!, boosts: _3!, nextOffset: _4, users: _5!) + return Api.premium.BoostsList.boostsList(Cons_boostsList(flags: _1!, count: _2!, boosts: _3!, nextOffset: _4, users: _5!)) } else { return nil } } - } } public extension Api.premium { enum BoostsStatus: TypeConstructorDescription { - case boostsStatus(flags: Int32, level: Int32, currentLevelBoosts: Int32, boosts: Int32, giftBoosts: Int32?, nextLevelBoosts: Int32?, premiumAudience: Api.StatsPercentValue?, boostUrl: String, prepaidGiveaways: [Api.PrepaidGiveaway]?, myBoostSlots: [Int32]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .boostsStatus(let flags, let level, let currentLevelBoosts, let boosts, let giftBoosts, let nextLevelBoosts, let premiumAudience, let boostUrl, let prepaidGiveaways, let myBoostSlots): - if boxed { - buffer.appendInt32(1230586490) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(level, buffer: buffer, boxed: false) - serializeInt32(currentLevelBoosts, buffer: buffer, boxed: false) - serializeInt32(boosts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(giftBoosts!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(nextLevelBoosts!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {premiumAudience!.serialize(buffer, true)} - serializeString(boostUrl, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(prepaidGiveaways!.count)) - for item in prepaidGiveaways! { + public class Cons_boostsStatus { + public var flags: Int32 + public var level: Int32 + public var currentLevelBoosts: Int32 + public var boosts: Int32 + public var giftBoosts: Int32? + public var nextLevelBoosts: Int32? + public var premiumAudience: Api.StatsPercentValue? + public var boostUrl: String + public var prepaidGiveaways: [Api.PrepaidGiveaway]? + public var myBoostSlots: [Int32]? + public init(flags: Int32, level: Int32, currentLevelBoosts: Int32, boosts: Int32, giftBoosts: Int32?, nextLevelBoosts: Int32?, premiumAudience: Api.StatsPercentValue?, boostUrl: String, prepaidGiveaways: [Api.PrepaidGiveaway]?, myBoostSlots: [Int32]?) { + self.flags = flags + self.level = level + self.currentLevelBoosts = currentLevelBoosts + self.boosts = boosts + self.giftBoosts = giftBoosts + self.nextLevelBoosts = nextLevelBoosts + self.premiumAudience = premiumAudience + self.boostUrl = boostUrl + self.prepaidGiveaways = prepaidGiveaways + self.myBoostSlots = myBoostSlots + } + } + case boostsStatus(Cons_boostsStatus) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .boostsStatus(let _data): + if boxed { + buffer.appendInt32(1230586490) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.level, buffer: buffer, boxed: false) + serializeInt32(_data.currentLevelBoosts, buffer: buffer, boxed: false) + serializeInt32(_data.boosts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.giftBoosts!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.nextLevelBoosts!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.premiumAudience!.serialize(buffer, true) + } + serializeString(_data.boostUrl, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.prepaidGiveaways!.count)) + for item in _data.prepaidGiveaways! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(myBoostSlots!.count)) - for item in myBoostSlots! { + } + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.myBoostSlots!.count)) + for item in _data.myBoostSlots! { serializeInt32(item, buffer: buffer, boxed: false) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .boostsStatus(let flags, let level, let currentLevelBoosts, let boosts, let giftBoosts, let nextLevelBoosts, let premiumAudience, let boostUrl, let prepaidGiveaways, let myBoostSlots): - return ("boostsStatus", [("flags", flags as Any), ("level", level as Any), ("currentLevelBoosts", currentLevelBoosts as Any), ("boosts", boosts as Any), ("giftBoosts", giftBoosts as Any), ("nextLevelBoosts", nextLevelBoosts as Any), ("premiumAudience", premiumAudience as Any), ("boostUrl", boostUrl as Any), ("prepaidGiveaways", prepaidGiveaways as Any), ("myBoostSlots", myBoostSlots as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .boostsStatus(let _data): + return ("boostsStatus", [("flags", _data.flags as Any), ("level", _data.level as Any), ("currentLevelBoosts", _data.currentLevelBoosts as Any), ("boosts", _data.boosts as Any), ("giftBoosts", _data.giftBoosts as Any), ("nextLevelBoosts", _data.nextLevelBoosts as Any), ("premiumAudience", _data.premiumAudience as Any), ("boostUrl", _data.boostUrl as Any), ("prepaidGiveaways", _data.prepaidGiveaways as Any), ("myBoostSlots", _data.myBoostSlots as Any)]) + } + } + public static func parse_boostsStatus(_ reader: BufferReader) -> BoostsStatus? { var _1: Int32? _1 = reader.readInt32() @@ -361,23 +452,33 @@ public extension Api.premium { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } var _7: Api.StatsPercentValue? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.StatsPercentValue - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.StatsPercentValue + } + } var _8: String? _8 = parseString(reader) var _9: [Api.PrepaidGiveaway]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrepaidGiveaway.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrepaidGiveaway.self) + } + } var _10: [Int32]? - if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() { - _10 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _10 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -389,51 +490,60 @@ public extension Api.premium { let _c9 = (Int(_1!) & Int(1 << 3) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 2) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.premium.BoostsStatus.boostsStatus(flags: _1!, level: _2!, currentLevelBoosts: _3!, boosts: _4!, giftBoosts: _5, nextLevelBoosts: _6, premiumAudience: _7, boostUrl: _8!, prepaidGiveaways: _9, myBoostSlots: _10) + return Api.premium.BoostsStatus.boostsStatus(Cons_boostsStatus(flags: _1!, level: _2!, currentLevelBoosts: _3!, boosts: _4!, giftBoosts: _5, nextLevelBoosts: _6, premiumAudience: _7, boostUrl: _8!, prepaidGiveaways: _9, myBoostSlots: _10)) } else { return nil } } - } } public extension Api.premium { enum MyBoosts: TypeConstructorDescription { - case myBoosts(myBoosts: [Api.MyBoost], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .myBoosts(let myBoosts, let chats, let users): - if boxed { - buffer.appendInt32(-1696454430) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(myBoosts.count)) - for item in myBoosts { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .myBoosts(let myBoosts, let chats, let users): - return ("myBoosts", [("myBoosts", myBoosts as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_myBoosts { + public var myBoosts: [Api.MyBoost] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(myBoosts: [Api.MyBoost], chats: [Api.Chat], users: [Api.User]) { + self.myBoosts = myBoosts + self.chats = chats + self.users = users + } + } + case myBoosts(Cons_myBoosts) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .myBoosts(let _data): + if boxed { + buffer.appendInt32(-1696454430) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.myBoosts.count)) + for item in _data.myBoosts { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .myBoosts(let _data): + return ("myBoosts", [("myBoosts", _data.myBoosts as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_myBoosts(_ reader: BufferReader) -> MyBoosts? { var _1: [Api.MyBoost]? if let _ = reader.readInt32() { @@ -451,38 +561,45 @@ public extension Api.premium { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.premium.MyBoosts.myBoosts(myBoosts: _1!, chats: _2!, users: _3!) + return Api.premium.MyBoosts.myBoosts(Cons_myBoosts(myBoosts: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.smsjobs { enum EligibilityToJoin: TypeConstructorDescription { - case eligibleToJoin(termsUrl: String, monthlySentSms: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .eligibleToJoin(let termsUrl, let monthlySentSms): - if boxed { - buffer.appendInt32(-594852657) - } - serializeString(termsUrl, buffer: buffer, boxed: false) - serializeInt32(monthlySentSms, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .eligibleToJoin(let termsUrl, let monthlySentSms): - return ("eligibleToJoin", [("termsUrl", termsUrl as Any), ("monthlySentSms", monthlySentSms as Any)]) - } - } - + public class Cons_eligibleToJoin { + public var termsUrl: String + public var monthlySentSms: Int32 + public init(termsUrl: String, monthlySentSms: Int32) { + self.termsUrl = termsUrl + self.monthlySentSms = monthlySentSms + } + } + case eligibleToJoin(Cons_eligibleToJoin) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .eligibleToJoin(let _data): + if boxed { + buffer.appendInt32(-594852657) + } + serializeString(_data.termsUrl, buffer: buffer, boxed: false) + serializeInt32(_data.monthlySentSms, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .eligibleToJoin(let _data): + return ("eligibleToJoin", [("termsUrl", _data.termsUrl as Any), ("monthlySentSms", _data.monthlySentSms as Any)]) + } + } + public static func parse_eligibleToJoin(_ reader: BufferReader) -> EligibilityToJoin? { var _1: String? _1 = parseString(reader) @@ -491,44 +608,65 @@ public extension Api.smsjobs { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.smsjobs.EligibilityToJoin.eligibleToJoin(termsUrl: _1!, monthlySentSms: _2!) + return Api.smsjobs.EligibilityToJoin.eligibleToJoin(Cons_eligibleToJoin(termsUrl: _1!, monthlySentSms: _2!)) } else { return nil } } - } } public extension Api.smsjobs { enum Status: TypeConstructorDescription { - case status(flags: Int32, recentSent: Int32, recentSince: Int32, recentRemains: Int32, totalSent: Int32, totalSince: Int32, lastGiftSlug: String?, termsUrl: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .status(let flags, let recentSent, let recentSince, let recentRemains, let totalSent, let totalSince, let lastGiftSlug, let termsUrl): - if boxed { - buffer.appendInt32(720277905) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(recentSent, buffer: buffer, boxed: false) - serializeInt32(recentSince, buffer: buffer, boxed: false) - serializeInt32(recentRemains, buffer: buffer, boxed: false) - serializeInt32(totalSent, buffer: buffer, boxed: false) - serializeInt32(totalSince, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(lastGiftSlug!, buffer: buffer, boxed: false)} - serializeString(termsUrl, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .status(let flags, let recentSent, let recentSince, let recentRemains, let totalSent, let totalSince, let lastGiftSlug, let termsUrl): - return ("status", [("flags", flags as Any), ("recentSent", recentSent as Any), ("recentSince", recentSince as Any), ("recentRemains", recentRemains as Any), ("totalSent", totalSent as Any), ("totalSince", totalSince as Any), ("lastGiftSlug", lastGiftSlug as Any), ("termsUrl", termsUrl as Any)]) - } - } - + public class Cons_status { + public var flags: Int32 + public var recentSent: Int32 + public var recentSince: Int32 + public var recentRemains: Int32 + public var totalSent: Int32 + public var totalSince: Int32 + public var lastGiftSlug: String? + public var termsUrl: String + public init(flags: Int32, recentSent: Int32, recentSince: Int32, recentRemains: Int32, totalSent: Int32, totalSince: Int32, lastGiftSlug: String?, termsUrl: String) { + self.flags = flags + self.recentSent = recentSent + self.recentSince = recentSince + self.recentRemains = recentRemains + self.totalSent = totalSent + self.totalSince = totalSince + self.lastGiftSlug = lastGiftSlug + self.termsUrl = termsUrl + } + } + case status(Cons_status) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .status(let _data): + if boxed { + buffer.appendInt32(720277905) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.recentSent, buffer: buffer, boxed: false) + serializeInt32(_data.recentSince, buffer: buffer, boxed: false) + serializeInt32(_data.recentRemains, buffer: buffer, boxed: false) + serializeInt32(_data.totalSent, buffer: buffer, boxed: false) + serializeInt32(_data.totalSince, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.lastGiftSlug!, buffer: buffer, boxed: false) + } + serializeString(_data.termsUrl, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .status(let _data): + return ("status", [("flags", _data.flags as Any), ("recentSent", _data.recentSent as Any), ("recentSince", _data.recentSince as Any), ("recentRemains", _data.recentRemains as Any), ("totalSent", _data.totalSent as Any), ("totalSince", _data.totalSince as Any), ("lastGiftSlug", _data.lastGiftSlug as Any), ("termsUrl", _data.termsUrl as Any)]) + } + } + public static func parse_status(_ reader: BufferReader) -> Status? { var _1: Int32? _1 = reader.readInt32() @@ -543,7 +681,9 @@ public extension Api.smsjobs { var _6: Int32? _6 = reader.readInt32() var _7: String? - if Int(_1!) & Int(1 << 1) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } var _8: String? _8 = parseString(reader) let _c1 = _1 != nil @@ -555,62 +695,109 @@ public extension Api.smsjobs { let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.smsjobs.Status.status(flags: _1!, recentSent: _2!, recentSince: _3!, recentRemains: _4!, totalSent: _5!, totalSince: _6!, lastGiftSlug: _7, termsUrl: _8!) + return Api.smsjobs.Status.status(Cons_status(flags: _1!, recentSent: _2!, recentSince: _3!, recentRemains: _4!, totalSent: _5!, totalSince: _6!, lastGiftSlug: _7, termsUrl: _8!)) } else { return nil } } - } } public extension Api.stats { enum BroadcastStats: TypeConstructorDescription { - case broadcastStats(period: Api.StatsDateRangeDays, followers: Api.StatsAbsValueAndPrev, viewsPerPost: Api.StatsAbsValueAndPrev, sharesPerPost: Api.StatsAbsValueAndPrev, reactionsPerPost: Api.StatsAbsValueAndPrev, viewsPerStory: Api.StatsAbsValueAndPrev, sharesPerStory: Api.StatsAbsValueAndPrev, reactionsPerStory: Api.StatsAbsValueAndPrev, enabledNotifications: Api.StatsPercentValue, growthGraph: Api.StatsGraph, followersGraph: Api.StatsGraph, muteGraph: Api.StatsGraph, topHoursGraph: Api.StatsGraph, interactionsGraph: Api.StatsGraph, ivInteractionsGraph: Api.StatsGraph, viewsBySourceGraph: Api.StatsGraph, newFollowersBySourceGraph: Api.StatsGraph, languagesGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph, storyInteractionsGraph: Api.StatsGraph, storyReactionsByEmotionGraph: Api.StatsGraph, recentPostsInteractions: [Api.PostInteractionCounters]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .broadcastStats(let period, let followers, let viewsPerPost, let sharesPerPost, let reactionsPerPost, let viewsPerStory, let sharesPerStory, let reactionsPerStory, let enabledNotifications, let growthGraph, let followersGraph, let muteGraph, let topHoursGraph, let interactionsGraph, let ivInteractionsGraph, let viewsBySourceGraph, let newFollowersBySourceGraph, let languagesGraph, let reactionsByEmotionGraph, let storyInteractionsGraph, let storyReactionsByEmotionGraph, let recentPostsInteractions): - if boxed { - buffer.appendInt32(963421692) - } - period.serialize(buffer, true) - followers.serialize(buffer, true) - viewsPerPost.serialize(buffer, true) - sharesPerPost.serialize(buffer, true) - reactionsPerPost.serialize(buffer, true) - viewsPerStory.serialize(buffer, true) - sharesPerStory.serialize(buffer, true) - reactionsPerStory.serialize(buffer, true) - enabledNotifications.serialize(buffer, true) - growthGraph.serialize(buffer, true) - followersGraph.serialize(buffer, true) - muteGraph.serialize(buffer, true) - topHoursGraph.serialize(buffer, true) - interactionsGraph.serialize(buffer, true) - ivInteractionsGraph.serialize(buffer, true) - viewsBySourceGraph.serialize(buffer, true) - newFollowersBySourceGraph.serialize(buffer, true) - languagesGraph.serialize(buffer, true) - reactionsByEmotionGraph.serialize(buffer, true) - storyInteractionsGraph.serialize(buffer, true) - storyReactionsByEmotionGraph.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentPostsInteractions.count)) - for item in recentPostsInteractions { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .broadcastStats(let period, let followers, let viewsPerPost, let sharesPerPost, let reactionsPerPost, let viewsPerStory, let sharesPerStory, let reactionsPerStory, let enabledNotifications, let growthGraph, let followersGraph, let muteGraph, let topHoursGraph, let interactionsGraph, let ivInteractionsGraph, let viewsBySourceGraph, let newFollowersBySourceGraph, let languagesGraph, let reactionsByEmotionGraph, let storyInteractionsGraph, let storyReactionsByEmotionGraph, let recentPostsInteractions): - return ("broadcastStats", [("period", period as Any), ("followers", followers as Any), ("viewsPerPost", viewsPerPost as Any), ("sharesPerPost", sharesPerPost as Any), ("reactionsPerPost", reactionsPerPost as Any), ("viewsPerStory", viewsPerStory as Any), ("sharesPerStory", sharesPerStory as Any), ("reactionsPerStory", reactionsPerStory as Any), ("enabledNotifications", enabledNotifications as Any), ("growthGraph", growthGraph as Any), ("followersGraph", followersGraph as Any), ("muteGraph", muteGraph as Any), ("topHoursGraph", topHoursGraph as Any), ("interactionsGraph", interactionsGraph as Any), ("ivInteractionsGraph", ivInteractionsGraph as Any), ("viewsBySourceGraph", viewsBySourceGraph as Any), ("newFollowersBySourceGraph", newFollowersBySourceGraph as Any), ("languagesGraph", languagesGraph as Any), ("reactionsByEmotionGraph", reactionsByEmotionGraph as Any), ("storyInteractionsGraph", storyInteractionsGraph as Any), ("storyReactionsByEmotionGraph", storyReactionsByEmotionGraph as Any), ("recentPostsInteractions", recentPostsInteractions as Any)]) - } - } - + public class Cons_broadcastStats { + public var period: Api.StatsDateRangeDays + public var followers: Api.StatsAbsValueAndPrev + public var viewsPerPost: Api.StatsAbsValueAndPrev + public var sharesPerPost: Api.StatsAbsValueAndPrev + public var reactionsPerPost: Api.StatsAbsValueAndPrev + public var viewsPerStory: Api.StatsAbsValueAndPrev + public var sharesPerStory: Api.StatsAbsValueAndPrev + public var reactionsPerStory: Api.StatsAbsValueAndPrev + public var enabledNotifications: Api.StatsPercentValue + public var growthGraph: Api.StatsGraph + public var followersGraph: Api.StatsGraph + public var muteGraph: Api.StatsGraph + public var topHoursGraph: Api.StatsGraph + public var interactionsGraph: Api.StatsGraph + public var ivInteractionsGraph: Api.StatsGraph + public var viewsBySourceGraph: Api.StatsGraph + public var newFollowersBySourceGraph: Api.StatsGraph + public var languagesGraph: Api.StatsGraph + public var reactionsByEmotionGraph: Api.StatsGraph + public var storyInteractionsGraph: Api.StatsGraph + public var storyReactionsByEmotionGraph: Api.StatsGraph + public var recentPostsInteractions: [Api.PostInteractionCounters] + public init(period: Api.StatsDateRangeDays, followers: Api.StatsAbsValueAndPrev, viewsPerPost: Api.StatsAbsValueAndPrev, sharesPerPost: Api.StatsAbsValueAndPrev, reactionsPerPost: Api.StatsAbsValueAndPrev, viewsPerStory: Api.StatsAbsValueAndPrev, sharesPerStory: Api.StatsAbsValueAndPrev, reactionsPerStory: Api.StatsAbsValueAndPrev, enabledNotifications: Api.StatsPercentValue, growthGraph: Api.StatsGraph, followersGraph: Api.StatsGraph, muteGraph: Api.StatsGraph, topHoursGraph: Api.StatsGraph, interactionsGraph: Api.StatsGraph, ivInteractionsGraph: Api.StatsGraph, viewsBySourceGraph: Api.StatsGraph, newFollowersBySourceGraph: Api.StatsGraph, languagesGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph, storyInteractionsGraph: Api.StatsGraph, storyReactionsByEmotionGraph: Api.StatsGraph, recentPostsInteractions: [Api.PostInteractionCounters]) { + self.period = period + self.followers = followers + self.viewsPerPost = viewsPerPost + self.sharesPerPost = sharesPerPost + self.reactionsPerPost = reactionsPerPost + self.viewsPerStory = viewsPerStory + self.sharesPerStory = sharesPerStory + self.reactionsPerStory = reactionsPerStory + self.enabledNotifications = enabledNotifications + self.growthGraph = growthGraph + self.followersGraph = followersGraph + self.muteGraph = muteGraph + self.topHoursGraph = topHoursGraph + self.interactionsGraph = interactionsGraph + self.ivInteractionsGraph = ivInteractionsGraph + self.viewsBySourceGraph = viewsBySourceGraph + self.newFollowersBySourceGraph = newFollowersBySourceGraph + self.languagesGraph = languagesGraph + self.reactionsByEmotionGraph = reactionsByEmotionGraph + self.storyInteractionsGraph = storyInteractionsGraph + self.storyReactionsByEmotionGraph = storyReactionsByEmotionGraph + self.recentPostsInteractions = recentPostsInteractions + } + } + case broadcastStats(Cons_broadcastStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .broadcastStats(let _data): + if boxed { + buffer.appendInt32(963421692) + } + _data.period.serialize(buffer, true) + _data.followers.serialize(buffer, true) + _data.viewsPerPost.serialize(buffer, true) + _data.sharesPerPost.serialize(buffer, true) + _data.reactionsPerPost.serialize(buffer, true) + _data.viewsPerStory.serialize(buffer, true) + _data.sharesPerStory.serialize(buffer, true) + _data.reactionsPerStory.serialize(buffer, true) + _data.enabledNotifications.serialize(buffer, true) + _data.growthGraph.serialize(buffer, true) + _data.followersGraph.serialize(buffer, true) + _data.muteGraph.serialize(buffer, true) + _data.topHoursGraph.serialize(buffer, true) + _data.interactionsGraph.serialize(buffer, true) + _data.ivInteractionsGraph.serialize(buffer, true) + _data.viewsBySourceGraph.serialize(buffer, true) + _data.newFollowersBySourceGraph.serialize(buffer, true) + _data.languagesGraph.serialize(buffer, true) + _data.reactionsByEmotionGraph.serialize(buffer, true) + _data.storyInteractionsGraph.serialize(buffer, true) + _data.storyReactionsByEmotionGraph.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentPostsInteractions.count)) + for item in _data.recentPostsInteractions { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .broadcastStats(let _data): + return ("broadcastStats", [("period", _data.period as Any), ("followers", _data.followers as Any), ("viewsPerPost", _data.viewsPerPost as Any), ("sharesPerPost", _data.sharesPerPost as Any), ("reactionsPerPost", _data.reactionsPerPost as Any), ("viewsPerStory", _data.viewsPerStory as Any), ("sharesPerStory", _data.sharesPerStory as Any), ("reactionsPerStory", _data.reactionsPerStory as Any), ("enabledNotifications", _data.enabledNotifications as Any), ("growthGraph", _data.growthGraph as Any), ("followersGraph", _data.followersGraph as Any), ("muteGraph", _data.muteGraph as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("interactionsGraph", _data.interactionsGraph as Any), ("ivInteractionsGraph", _data.ivInteractionsGraph as Any), ("viewsBySourceGraph", _data.viewsBySourceGraph as Any), ("newFollowersBySourceGraph", _data.newFollowersBySourceGraph as Any), ("languagesGraph", _data.languagesGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any), ("storyInteractionsGraph", _data.storyInteractionsGraph as Any), ("storyReactionsByEmotionGraph", _data.storyReactionsByEmotionGraph as Any), ("recentPostsInteractions", _data.recentPostsInteractions as Any)]) + } + } + public static func parse_broadcastStats(_ reader: BufferReader) -> BroadcastStats? { var _1: Api.StatsDateRangeDays? if let signature = reader.readInt32() { @@ -723,69 +910,106 @@ public extension Api.stats { let _c21 = _21 != nil let _c22 = _22 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 { - return Api.stats.BroadcastStats.broadcastStats(period: _1!, followers: _2!, viewsPerPost: _3!, sharesPerPost: _4!, reactionsPerPost: _5!, viewsPerStory: _6!, sharesPerStory: _7!, reactionsPerStory: _8!, enabledNotifications: _9!, growthGraph: _10!, followersGraph: _11!, muteGraph: _12!, topHoursGraph: _13!, interactionsGraph: _14!, ivInteractionsGraph: _15!, viewsBySourceGraph: _16!, newFollowersBySourceGraph: _17!, languagesGraph: _18!, reactionsByEmotionGraph: _19!, storyInteractionsGraph: _20!, storyReactionsByEmotionGraph: _21!, recentPostsInteractions: _22!) + return Api.stats.BroadcastStats.broadcastStats(Cons_broadcastStats(period: _1!, followers: _2!, viewsPerPost: _3!, sharesPerPost: _4!, reactionsPerPost: _5!, viewsPerStory: _6!, sharesPerStory: _7!, reactionsPerStory: _8!, enabledNotifications: _9!, growthGraph: _10!, followersGraph: _11!, muteGraph: _12!, topHoursGraph: _13!, interactionsGraph: _14!, ivInteractionsGraph: _15!, viewsBySourceGraph: _16!, newFollowersBySourceGraph: _17!, languagesGraph: _18!, reactionsByEmotionGraph: _19!, storyInteractionsGraph: _20!, storyReactionsByEmotionGraph: _21!, recentPostsInteractions: _22!)) } else { return nil } } - } } public extension Api.stats { enum MegagroupStats: TypeConstructorDescription { - case megagroupStats(period: Api.StatsDateRangeDays, members: Api.StatsAbsValueAndPrev, messages: Api.StatsAbsValueAndPrev, viewers: Api.StatsAbsValueAndPrev, posters: Api.StatsAbsValueAndPrev, growthGraph: Api.StatsGraph, membersGraph: Api.StatsGraph, newMembersBySourceGraph: Api.StatsGraph, languagesGraph: Api.StatsGraph, messagesGraph: Api.StatsGraph, actionsGraph: Api.StatsGraph, topHoursGraph: Api.StatsGraph, weekdaysGraph: Api.StatsGraph, topPosters: [Api.StatsGroupTopPoster], topAdmins: [Api.StatsGroupTopAdmin], topInviters: [Api.StatsGroupTopInviter], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .megagroupStats(let period, let members, let messages, let viewers, let posters, let growthGraph, let membersGraph, let newMembersBySourceGraph, let languagesGraph, let messagesGraph, let actionsGraph, let topHoursGraph, let weekdaysGraph, let topPosters, let topAdmins, let topInviters, let users): - if boxed { - buffer.appendInt32(-276825834) - } - period.serialize(buffer, true) - members.serialize(buffer, true) - messages.serialize(buffer, true) - viewers.serialize(buffer, true) - posters.serialize(buffer, true) - growthGraph.serialize(buffer, true) - membersGraph.serialize(buffer, true) - newMembersBySourceGraph.serialize(buffer, true) - languagesGraph.serialize(buffer, true) - messagesGraph.serialize(buffer, true) - actionsGraph.serialize(buffer, true) - topHoursGraph.serialize(buffer, true) - weekdaysGraph.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topPosters.count)) - for item in topPosters { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topAdmins.count)) - for item in topAdmins { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topInviters.count)) - for item in topInviters { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .megagroupStats(let period, let members, let messages, let viewers, let posters, let growthGraph, let membersGraph, let newMembersBySourceGraph, let languagesGraph, let messagesGraph, let actionsGraph, let topHoursGraph, let weekdaysGraph, let topPosters, let topAdmins, let topInviters, let users): - return ("megagroupStats", [("period", period as Any), ("members", members as Any), ("messages", messages as Any), ("viewers", viewers as Any), ("posters", posters as Any), ("growthGraph", growthGraph as Any), ("membersGraph", membersGraph as Any), ("newMembersBySourceGraph", newMembersBySourceGraph as Any), ("languagesGraph", languagesGraph as Any), ("messagesGraph", messagesGraph as Any), ("actionsGraph", actionsGraph as Any), ("topHoursGraph", topHoursGraph as Any), ("weekdaysGraph", weekdaysGraph as Any), ("topPosters", topPosters as Any), ("topAdmins", topAdmins as Any), ("topInviters", topInviters as Any), ("users", users as Any)]) - } - } - + public class Cons_megagroupStats { + public var period: Api.StatsDateRangeDays + public var members: Api.StatsAbsValueAndPrev + public var messages: Api.StatsAbsValueAndPrev + public var viewers: Api.StatsAbsValueAndPrev + public var posters: Api.StatsAbsValueAndPrev + public var growthGraph: Api.StatsGraph + public var membersGraph: Api.StatsGraph + public var newMembersBySourceGraph: Api.StatsGraph + public var languagesGraph: Api.StatsGraph + public var messagesGraph: Api.StatsGraph + public var actionsGraph: Api.StatsGraph + public var topHoursGraph: Api.StatsGraph + public var weekdaysGraph: Api.StatsGraph + public var topPosters: [Api.StatsGroupTopPoster] + public var topAdmins: [Api.StatsGroupTopAdmin] + public var topInviters: [Api.StatsGroupTopInviter] + public var users: [Api.User] + public init(period: Api.StatsDateRangeDays, members: Api.StatsAbsValueAndPrev, messages: Api.StatsAbsValueAndPrev, viewers: Api.StatsAbsValueAndPrev, posters: Api.StatsAbsValueAndPrev, growthGraph: Api.StatsGraph, membersGraph: Api.StatsGraph, newMembersBySourceGraph: Api.StatsGraph, languagesGraph: Api.StatsGraph, messagesGraph: Api.StatsGraph, actionsGraph: Api.StatsGraph, topHoursGraph: Api.StatsGraph, weekdaysGraph: Api.StatsGraph, topPosters: [Api.StatsGroupTopPoster], topAdmins: [Api.StatsGroupTopAdmin], topInviters: [Api.StatsGroupTopInviter], users: [Api.User]) { + self.period = period + self.members = members + self.messages = messages + self.viewers = viewers + self.posters = posters + self.growthGraph = growthGraph + self.membersGraph = membersGraph + self.newMembersBySourceGraph = newMembersBySourceGraph + self.languagesGraph = languagesGraph + self.messagesGraph = messagesGraph + self.actionsGraph = actionsGraph + self.topHoursGraph = topHoursGraph + self.weekdaysGraph = weekdaysGraph + self.topPosters = topPosters + self.topAdmins = topAdmins + self.topInviters = topInviters + self.users = users + } + } + case megagroupStats(Cons_megagroupStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .megagroupStats(let _data): + if boxed { + buffer.appendInt32(-276825834) + } + _data.period.serialize(buffer, true) + _data.members.serialize(buffer, true) + _data.messages.serialize(buffer, true) + _data.viewers.serialize(buffer, true) + _data.posters.serialize(buffer, true) + _data.growthGraph.serialize(buffer, true) + _data.membersGraph.serialize(buffer, true) + _data.newMembersBySourceGraph.serialize(buffer, true) + _data.languagesGraph.serialize(buffer, true) + _data.messagesGraph.serialize(buffer, true) + _data.actionsGraph.serialize(buffer, true) + _data.topHoursGraph.serialize(buffer, true) + _data.weekdaysGraph.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topPosters.count)) + for item in _data.topPosters { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topAdmins.count)) + for item in _data.topAdmins { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topInviters.count)) + for item in _data.topInviters { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .megagroupStats(let _data): + return ("megagroupStats", [("period", _data.period as Any), ("members", _data.members as Any), ("messages", _data.messages as Any), ("viewers", _data.viewers as Any), ("posters", _data.posters as Any), ("growthGraph", _data.growthGraph as Any), ("membersGraph", _data.membersGraph as Any), ("newMembersBySourceGraph", _data.newMembersBySourceGraph as Any), ("languagesGraph", _data.languagesGraph as Any), ("messagesGraph", _data.messagesGraph as Any), ("actionsGraph", _data.actionsGraph as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("weekdaysGraph", _data.weekdaysGraph as Any), ("topPosters", _data.topPosters as Any), ("topAdmins", _data.topAdmins as Any), ("topInviters", _data.topInviters as Any), ("users", _data.users as Any)]) + } + } + public static func parse_megagroupStats(_ reader: BufferReader) -> MegagroupStats? { var _1: Api.StatsDateRangeDays? if let signature = reader.readInt32() { @@ -873,38 +1097,45 @@ public extension Api.stats { let _c16 = _16 != nil let _c17 = _17 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 { - return Api.stats.MegagroupStats.megagroupStats(period: _1!, members: _2!, messages: _3!, viewers: _4!, posters: _5!, growthGraph: _6!, membersGraph: _7!, newMembersBySourceGraph: _8!, languagesGraph: _9!, messagesGraph: _10!, actionsGraph: _11!, topHoursGraph: _12!, weekdaysGraph: _13!, topPosters: _14!, topAdmins: _15!, topInviters: _16!, users: _17!) + return Api.stats.MegagroupStats.megagroupStats(Cons_megagroupStats(period: _1!, members: _2!, messages: _3!, viewers: _4!, posters: _5!, growthGraph: _6!, membersGraph: _7!, newMembersBySourceGraph: _8!, languagesGraph: _9!, messagesGraph: _10!, actionsGraph: _11!, topHoursGraph: _12!, weekdaysGraph: _13!, topPosters: _14!, topAdmins: _15!, topInviters: _16!, users: _17!)) } else { return nil } } - } } public extension Api.stats { enum MessageStats: TypeConstructorDescription { - case messageStats(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .messageStats(let viewsGraph, let reactionsByEmotionGraph): - if boxed { - buffer.appendInt32(2145983508) - } - viewsGraph.serialize(buffer, true) - reactionsByEmotionGraph.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .messageStats(let viewsGraph, let reactionsByEmotionGraph): - return ("messageStats", [("viewsGraph", viewsGraph as Any), ("reactionsByEmotionGraph", reactionsByEmotionGraph as Any)]) - } - } - + public class Cons_messageStats { + public var viewsGraph: Api.StatsGraph + public var reactionsByEmotionGraph: Api.StatsGraph + public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { + self.viewsGraph = viewsGraph + self.reactionsByEmotionGraph = reactionsByEmotionGraph + } + } + case messageStats(Cons_messageStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .messageStats(let _data): + if boxed { + buffer.appendInt32(2145983508) + } + _data.viewsGraph.serialize(buffer, true) + _data.reactionsByEmotionGraph.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .messageStats(let _data): + return ("messageStats", [("viewsGraph", _data.viewsGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any)]) + } + } + public static func parse_messageStats(_ reader: BufferReader) -> MessageStats? { var _1: Api.StatsGraph? if let signature = reader.readInt32() { @@ -917,54 +1148,71 @@ public extension Api.stats { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.stats.MessageStats.messageStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!) + return Api.stats.MessageStats.messageStats(Cons_messageStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) } else { return nil } } - } } public extension Api.stats { enum PublicForwards: TypeConstructorDescription { - case publicForwards(flags: Int32, count: Int32, forwards: [Api.PublicForward], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .publicForwards(let flags, let count, let forwards, let nextOffset, let chats, let users): - if boxed { - buffer.appendInt32(-1828487648) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(forwards.count)) - for item in forwards { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .publicForwards(let flags, let count, let forwards, let nextOffset, let chats, let users): - return ("publicForwards", [("flags", flags as Any), ("count", count as Any), ("forwards", forwards as Any), ("nextOffset", nextOffset as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_publicForwards { + public var flags: Int32 + public var count: Int32 + public var forwards: [Api.PublicForward] + public var nextOffset: String? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, forwards: [Api.PublicForward], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.forwards = forwards + self.nextOffset = nextOffset + self.chats = chats + self.users = users + } + } + case publicForwards(Cons_publicForwards) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .publicForwards(let _data): + if boxed { + buffer.appendInt32(-1828487648) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.forwards.count)) + for item in _data.forwards { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .publicForwards(let _data): + return ("publicForwards", [("flags", _data.flags as Any), ("count", _data.count as Any), ("forwards", _data.forwards as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_publicForwards(_ reader: BufferReader) -> PublicForwards? { var _1: Int32? _1 = reader.readInt32() @@ -975,7 +1223,9 @@ public extension Api.stats { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PublicForward.self) } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: [Api.Chat]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -991,38 +1241,45 @@ public extension Api.stats { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stats.PublicForwards.publicForwards(flags: _1!, count: _2!, forwards: _3!, nextOffset: _4, chats: _5!, users: _6!) + return Api.stats.PublicForwards.publicForwards(Cons_publicForwards(flags: _1!, count: _2!, forwards: _3!, nextOffset: _4, chats: _5!, users: _6!)) } else { return nil } } - } } public extension Api.stats { enum StoryStats: TypeConstructorDescription { - case storyStats(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyStats(let viewsGraph, let reactionsByEmotionGraph): - if boxed { - buffer.appendInt32(1355613820) - } - viewsGraph.serialize(buffer, true) - reactionsByEmotionGraph.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyStats(let viewsGraph, let reactionsByEmotionGraph): - return ("storyStats", [("viewsGraph", viewsGraph as Any), ("reactionsByEmotionGraph", reactionsByEmotionGraph as Any)]) - } - } - + public class Cons_storyStats { + public var viewsGraph: Api.StatsGraph + public var reactionsByEmotionGraph: Api.StatsGraph + public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { + self.viewsGraph = viewsGraph + self.reactionsByEmotionGraph = reactionsByEmotionGraph + } + } + case storyStats(Cons_storyStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyStats(let _data): + if boxed { + buffer.appendInt32(1355613820) + } + _data.viewsGraph.serialize(buffer, true) + _data.reactionsByEmotionGraph.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyStats(let _data): + return ("storyStats", [("viewsGraph", _data.viewsGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any)]) + } + } + public static func parse_storyStats(_ reader: BufferReader) -> StoryStats? { var _1: Api.StatsGraph? if let signature = reader.readInt32() { @@ -1035,49 +1292,53 @@ public extension Api.stats { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.stats.StoryStats.storyStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!) + return Api.stats.StoryStats.storyStats(Cons_storyStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) } else { return nil } } - } } public extension Api.stickers { enum SuggestedShortName: TypeConstructorDescription { - case suggestedShortName(shortName: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .suggestedShortName(let shortName): - if boxed { - buffer.appendInt32(-2046910401) - } - serializeString(shortName, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .suggestedShortName(let shortName): - return ("suggestedShortName", [("shortName", shortName as Any)]) - } - } - + public class Cons_suggestedShortName { + public var shortName: String + public init(shortName: String) { + self.shortName = shortName + } + } + case suggestedShortName(Cons_suggestedShortName) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .suggestedShortName(let _data): + if boxed { + buffer.appendInt32(-2046910401) + } + serializeString(_data.shortName, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .suggestedShortName(let _data): + return ("suggestedShortName", [("shortName", _data.shortName as Any)]) + } + } + public static func parse_suggestedShortName(_ reader: BufferReader) -> SuggestedShortName? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.stickers.SuggestedShortName.suggestedShortName(shortName: _1!) + return Api.stickers.SuggestedShortName.suggestedShortName(Cons_suggestedShortName(shortName: _1!)) } else { return nil } } - } } public extension Api.storage { @@ -1092,97 +1353,87 @@ public extension Api.storage { case filePng case fileUnknown case fileWebp - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .fileGif: - if boxed { - buffer.appendInt32(-891180321) - } - - break - case .fileJpeg: - if boxed { - buffer.appendInt32(8322574) - } - - break - case .fileMov: - if boxed { - buffer.appendInt32(1258941372) - } - - break - case .fileMp3: - if boxed { - buffer.appendInt32(1384777335) - } - - break - case .fileMp4: - if boxed { - buffer.appendInt32(-1278304028) - } - - break - case .filePartial: - if boxed { - buffer.appendInt32(1086091090) - } - - break - case .filePdf: - if boxed { - buffer.appendInt32(-1373745011) - } - - break - case .filePng: - if boxed { - buffer.appendInt32(172975040) - } - - break - case .fileUnknown: - if boxed { - buffer.appendInt32(-1432995067) - } - - break - case .fileWebp: - if boxed { - buffer.appendInt32(276907596) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .fileGif: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .fileGif: + if boxed { + buffer.appendInt32(-891180321) + } + break + case .fileJpeg: + if boxed { + buffer.appendInt32(8322574) + } + break + case .fileMov: + if boxed { + buffer.appendInt32(1258941372) + } + break + case .fileMp3: + if boxed { + buffer.appendInt32(1384777335) + } + break + case .fileMp4: + if boxed { + buffer.appendInt32(-1278304028) + } + break + case .filePartial: + if boxed { + buffer.appendInt32(1086091090) + } + break + case .filePdf: + if boxed { + buffer.appendInt32(-1373745011) + } + break + case .filePng: + if boxed { + buffer.appendInt32(172975040) + } + break + case .fileUnknown: + if boxed { + buffer.appendInt32(-1432995067) + } + break + case .fileWebp: + if boxed { + buffer.appendInt32(276907596) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .fileGif: return ("fileGif", []) - case .fileJpeg: + case .fileJpeg: return ("fileJpeg", []) - case .fileMov: + case .fileMov: return ("fileMov", []) - case .fileMp3: + case .fileMp3: return ("fileMp3", []) - case .fileMp4: + case .fileMp4: return ("fileMp4", []) - case .filePartial: + case .filePartial: return ("filePartial", []) - case .filePdf: + case .filePdf: return ("filePdf", []) - case .filePng: + case .filePng: return ("filePng", []) - case .fileUnknown: + case .fileUnknown: return ("fileUnknown", []) - case .fileWebp: + case .fileWebp: return ("fileWebp", []) - } - } - + } + } + public static func parse_fileGif(_ reader: BufferReader) -> FileType? { return Api.storage.FileType.fileGif } @@ -1213,45 +1464,51 @@ public extension Api.storage { public static func parse_fileWebp(_ reader: BufferReader) -> FileType? { return Api.storage.FileType.fileWebp } - } } public extension Api.stories { enum Albums: TypeConstructorDescription { - case albums(hash: Int64, albums: [Api.StoryAlbum]) + public class Cons_albums { + public var hash: Int64 + public var albums: [Api.StoryAlbum] + public init(hash: Int64, albums: [Api.StoryAlbum]) { + self.hash = hash + self.albums = albums + } + } + case albums(Cons_albums) case albumsNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .albums(let hash, let albums): - if boxed { - buffer.appendInt32(-1013417414) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(albums.count)) - for item in albums { - item.serialize(buffer, true) - } - break - case .albumsNotModified: - if boxed { - buffer.appendInt32(1448008427) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .albums(let hash, let albums): - return ("albums", [("hash", hash as Any), ("albums", albums as Any)]) - case .albumsNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .albums(let _data): + if boxed { + buffer.appendInt32(-1013417414) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.albums.count)) + for item in _data.albums { + item.serialize(buffer, true) + } + break + case .albumsNotModified: + if boxed { + buffer.appendInt32(1448008427) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .albums(let _data): + return ("albums", [("hash", _data.hash as Any), ("albums", _data.albums as Any)]) + case .albumsNotModified: return ("albumsNotModified", []) - } - } - + } + } + public static func parse_albums(_ reader: BufferReader) -> Albums? { var _1: Int64? _1 = reader.readInt64() @@ -1262,7 +1519,7 @@ public extension Api.stories { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.stories.Albums.albums(hash: _1!, albums: _2!) + return Api.stories.Albums.albums(Cons_albums(hash: _1!, albums: _2!)) } else { return nil @@ -1271,60 +1528,87 @@ public extension Api.stories { public static func parse_albumsNotModified(_ reader: BufferReader) -> Albums? { return Api.stories.Albums.albumsNotModified } - } } public extension Api.stories { enum AllStories: TypeConstructorDescription { - case allStories(flags: Int32, count: Int32, state: String, peerStories: [Api.PeerStories], chats: [Api.Chat], users: [Api.User], stealthMode: Api.StoriesStealthMode) - case allStoriesNotModified(flags: Int32, state: String, stealthMode: Api.StoriesStealthMode) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .allStories(let flags, let count, let state, let peerStories, let chats, let users, let stealthMode): - if boxed { - buffer.appendInt32(1862033025) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - serializeString(state, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peerStories.count)) - for item in peerStories { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - stealthMode.serialize(buffer, true) - break - case .allStoriesNotModified(let flags, let state, let stealthMode): - if boxed { - buffer.appendInt32(291044926) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(state, buffer: buffer, boxed: false) - stealthMode.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .allStories(let flags, let count, let state, let peerStories, let chats, let users, let stealthMode): - return ("allStories", [("flags", flags as Any), ("count", count as Any), ("state", state as Any), ("peerStories", peerStories as Any), ("chats", chats as Any), ("users", users as Any), ("stealthMode", stealthMode as Any)]) - case .allStoriesNotModified(let flags, let state, let stealthMode): - return ("allStoriesNotModified", [("flags", flags as Any), ("state", state as Any), ("stealthMode", stealthMode as Any)]) - } - } - + public class Cons_allStories { + public var flags: Int32 + public var count: Int32 + public var state: String + public var peerStories: [Api.PeerStories] + public var chats: [Api.Chat] + public var users: [Api.User] + public var stealthMode: Api.StoriesStealthMode + public init(flags: Int32, count: Int32, state: String, peerStories: [Api.PeerStories], chats: [Api.Chat], users: [Api.User], stealthMode: Api.StoriesStealthMode) { + self.flags = flags + self.count = count + self.state = state + self.peerStories = peerStories + self.chats = chats + self.users = users + self.stealthMode = stealthMode + } + } + public class Cons_allStoriesNotModified { + public var flags: Int32 + public var state: String + public var stealthMode: Api.StoriesStealthMode + public init(flags: Int32, state: String, stealthMode: Api.StoriesStealthMode) { + self.flags = flags + self.state = state + self.stealthMode = stealthMode + } + } + case allStories(Cons_allStories) + case allStoriesNotModified(Cons_allStoriesNotModified) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .allStories(let _data): + if boxed { + buffer.appendInt32(1862033025) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeString(_data.state, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peerStories.count)) + for item in _data.peerStories { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + _data.stealthMode.serialize(buffer, true) + break + case .allStoriesNotModified(let _data): + if boxed { + buffer.appendInt32(291044926) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.state, buffer: buffer, boxed: false) + _data.stealthMode.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .allStories(let _data): + return ("allStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("state", _data.state as Any), ("peerStories", _data.peerStories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("stealthMode", _data.stealthMode as Any)]) + case .allStoriesNotModified(let _data): + return ("allStoriesNotModified", [("flags", _data.flags as Any), ("state", _data.state as Any), ("stealthMode", _data.stealthMode as Any)]) + } + } + public static func parse_allStories(_ reader: BufferReader) -> AllStories? { var _1: Int32? _1 = reader.readInt32() @@ -1356,7 +1640,7 @@ public extension Api.stories { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.stories.AllStories.allStories(flags: _1!, count: _2!, state: _3!, peerStories: _4!, chats: _5!, users: _6!, stealthMode: _7!) + return Api.stories.AllStories.allStories(Cons_allStories(flags: _1!, count: _2!, state: _3!, peerStories: _4!, chats: _5!, users: _6!, stealthMode: _7!)) } else { return nil @@ -1375,90 +1659,112 @@ public extension Api.stories { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.stories.AllStories.allStoriesNotModified(flags: _1!, state: _2!, stealthMode: _3!) + return Api.stories.AllStories.allStoriesNotModified(Cons_allStoriesNotModified(flags: _1!, state: _2!, stealthMode: _3!)) } else { return nil } } - } } public extension Api.stories { enum CanSendStoryCount: TypeConstructorDescription { - case canSendStoryCount(countRemains: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .canSendStoryCount(let countRemains): - if boxed { - buffer.appendInt32(-1014513586) - } - serializeInt32(countRemains, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .canSendStoryCount(let countRemains): - return ("canSendStoryCount", [("countRemains", countRemains as Any)]) - } - } - + public class Cons_canSendStoryCount { + public var countRemains: Int32 + public init(countRemains: Int32) { + self.countRemains = countRemains + } + } + case canSendStoryCount(Cons_canSendStoryCount) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .canSendStoryCount(let _data): + if boxed { + buffer.appendInt32(-1014513586) + } + serializeInt32(_data.countRemains, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .canSendStoryCount(let _data): + return ("canSendStoryCount", [("countRemains", _data.countRemains as Any)]) + } + } + public static func parse_canSendStoryCount(_ reader: BufferReader) -> CanSendStoryCount? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.stories.CanSendStoryCount.canSendStoryCount(countRemains: _1!) + return Api.stories.CanSendStoryCount.canSendStoryCount(Cons_canSendStoryCount(countRemains: _1!)) } else { return nil } } - } } public extension Api.stories { enum FoundStories: TypeConstructorDescription { - case foundStories(flags: Int32, count: Int32, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .foundStories(let flags, let count, let stories, let nextOffset, let chats, let users): - if boxed { - buffer.appendInt32(-488736969) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stories.count)) - for item in stories { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .foundStories(let flags, let count, let stories, let nextOffset, let chats, let users): - return ("foundStories", [("flags", flags as Any), ("count", count as Any), ("stories", stories as Any), ("nextOffset", nextOffset as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_foundStories { + public var flags: Int32 + public var count: Int32 + public var stories: [Api.FoundStory] + public var nextOffset: String? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.stories = stories + self.nextOffset = nextOffset + self.chats = chats + self.users = users + } + } + case foundStories(Cons_foundStories) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .foundStories(let _data): + if boxed { + buffer.appendInt32(-488736969) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stories.count)) + for item in _data.stories { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .foundStories(let _data): + return ("foundStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_foundStories(_ reader: BufferReader) -> FoundStories? { var _1: Int32? _1 = reader.readInt32() @@ -1469,7 +1775,9 @@ public extension Api.stories { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FoundStory.self) } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } var _5: [Api.Chat]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -1485,12 +1793,11 @@ public extension Api.stories { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stories.FoundStories.foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!) + return Api.stories.FoundStories.foundStories(Cons_foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api39.swift b/submodules/TelegramApi/Sources/Api39.swift index b9811b62c3..6a352c8b5f 100644 --- a/submodules/TelegramApi/Sources/Api39.swift +++ b/submodules/TelegramApi/Sources/Api39.swift @@ -1,35 +1,45 @@ public extension Api.stories { enum PeerStories: TypeConstructorDescription { - case peerStories(stories: Api.PeerStories, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .peerStories(let stories, let chats, let users): - if boxed { - buffer.appendInt32(-890861720) - } - stories.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .peerStories(let stories, let chats, let users): - return ("peerStories", [("stories", stories as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_peerStories { + public var stories: Api.PeerStories + public var chats: [Api.Chat] + public var users: [Api.User] + public init(stories: Api.PeerStories, chats: [Api.Chat], users: [Api.User]) { + self.stories = stories + self.chats = chats + self.users = users + } + } + case peerStories(Cons_peerStories) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .peerStories(let _data): + if boxed { + buffer.appendInt32(-890861720) + } + _data.stories.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .peerStories(let _data): + return ("peerStories", [("stories", _data.stories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { var _1: Api.PeerStories? if let signature = reader.readInt32() { @@ -47,58 +57,75 @@ public extension Api.stories { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.stories.PeerStories.peerStories(stories: _1!, chats: _2!, users: _3!) + return Api.stories.PeerStories.peerStories(Cons_peerStories(stories: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.stories { enum Stories: TypeConstructorDescription { - case stories(flags: Int32, count: Int32, stories: [Api.StoryItem], pinnedToTop: [Int32]?, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stories(let flags, let count, let stories, let pinnedToTop, let chats, let users): - if boxed { - buffer.appendInt32(1673780490) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) + public class Cons_stories { + public var flags: Int32 + public var count: Int32 + public var stories: [Api.StoryItem] + public var pinnedToTop: [Int32]? + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, count: Int32, stories: [Api.StoryItem], pinnedToTop: [Int32]?, chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.count = count + self.stories = stories + self.pinnedToTop = pinnedToTop + self.chats = chats + self.users = users + } + } + case stories(Cons_stories) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .stories(let _data): + if boxed { + buffer.appendInt32(1673780490) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.stories.count)) + for item in _data.stories { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stories.count)) - for item in stories { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(pinnedToTop!.count)) - for item in pinnedToTop! { + buffer.appendInt32(Int32(_data.pinnedToTop!.count)) + for item in _data.pinnedToTop! { serializeInt32(item, buffer: buffer, boxed: false) - }} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stories(let flags, let count, let stories, let pinnedToTop, let chats, let users): - return ("stories", [("flags", flags as Any), ("count", count as Any), ("stories", stories as Any), ("pinnedToTop", pinnedToTop as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .stories(let _data): + return ("stories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("pinnedToTop", _data.pinnedToTop as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_stories(_ reader: BufferReader) -> Stories? { var _1: Int32? _1 = reader.readInt32() @@ -109,9 +136,11 @@ public extension Api.stories { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryItem.self) } var _4: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } var _5: [Api.Chat]? if let _ = reader.readInt32() { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) @@ -127,54 +156,71 @@ public extension Api.stories { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stories.Stories.stories(flags: _1!, count: _2!, stories: _3!, pinnedToTop: _4, chats: _5!, users: _6!) + return Api.stories.Stories.stories(Cons_stories(flags: _1!, count: _2!, stories: _3!, pinnedToTop: _4, chats: _5!, users: _6!)) } else { return nil } } - } } public extension Api.stories { enum StoryReactionsList: TypeConstructorDescription { - case storyReactionsList(flags: Int32, count: Int32, reactions: [Api.StoryReaction], chats: [Api.Chat], users: [Api.User], nextOffset: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyReactionsList(let flags, let count, let reactions, let chats, let users, let nextOffset): - if boxed { - buffer.appendInt32(-1436583780) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyReactionsList(let flags, let count, let reactions, let chats, let users, let nextOffset): - return ("storyReactionsList", [("flags", flags as Any), ("count", count as Any), ("reactions", reactions as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_storyReactionsList { + public var flags: Int32 + public var count: Int32 + public var reactions: [Api.StoryReaction] + public var chats: [Api.Chat] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, count: Int32, reactions: [Api.StoryReaction], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.count = count + self.reactions = reactions + self.chats = chats + self.users = users + self.nextOffset = nextOffset + } + } + case storyReactionsList(Cons_storyReactionsList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyReactionsList(let _data): + if boxed { + buffer.appendInt32(-1436583780) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyReactionsList(let _data): + return ("storyReactionsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("reactions", _data.reactions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_storyReactionsList(_ reader: BufferReader) -> StoryReactionsList? { var _1: Int32? _1 = reader.readInt32() @@ -193,7 +239,9 @@ public extension Api.stories { _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _6: String? - if Int(_1!) & Int(1 << 0) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -201,46 +249,53 @@ public extension Api.stories { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stories.StoryReactionsList.storyReactionsList(flags: _1!, count: _2!, reactions: _3!, chats: _4!, users: _5!, nextOffset: _6) + return Api.stories.StoryReactionsList.storyReactionsList(Cons_storyReactionsList(flags: _1!, count: _2!, reactions: _3!, chats: _4!, users: _5!, nextOffset: _6)) } else { return nil } } - } } public extension Api.stories { enum StoryViews: TypeConstructorDescription { - case storyViews(views: [Api.StoryViews], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyViews(let views, let users): - if boxed { - buffer.appendInt32(-560009955) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(views.count)) - for item in views { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyViews(let views, let users): - return ("storyViews", [("views", views as Any), ("users", users as Any)]) - } - } - + public class Cons_storyViews { + public var views: [Api.StoryViews] + public var users: [Api.User] + public init(views: [Api.StoryViews], users: [Api.User]) { + self.views = views + self.users = users + } + } + case storyViews(Cons_storyViews) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyViews(let _data): + if boxed { + buffer.appendInt32(-560009955) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.views.count)) + for item in _data.views { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyViews(let _data): + return ("storyViews", [("views", _data.views as Any), ("users", _data.users as Any)]) + } + } + public static func parse_storyViews(_ reader: BufferReader) -> StoryViews? { var _1: [Api.StoryViews]? if let _ = reader.readInt32() { @@ -253,57 +308,80 @@ public extension Api.stories { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.stories.StoryViews.storyViews(views: _1!, users: _2!) + return Api.stories.StoryViews.storyViews(Cons_storyViews(views: _1!, users: _2!)) } else { return nil } } - } } public extension Api.stories { enum StoryViewsList: TypeConstructorDescription { - case storyViewsList(flags: Int32, count: Int32, viewsCount: Int32, forwardsCount: Int32, reactionsCount: Int32, views: [Api.StoryView], chats: [Api.Chat], users: [Api.User], nextOffset: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .storyViewsList(let flags, let count, let viewsCount, let forwardsCount, let reactionsCount, let views, let chats, let users, let nextOffset): - if boxed { - buffer.appendInt32(1507299269) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - serializeInt32(viewsCount, buffer: buffer, boxed: false) - serializeInt32(forwardsCount, buffer: buffer, boxed: false) - serializeInt32(reactionsCount, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(views.count)) - for item in views { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 0) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .storyViewsList(let flags, let count, let viewsCount, let forwardsCount, let reactionsCount, let views, let chats, let users, let nextOffset): - return ("storyViewsList", [("flags", flags as Any), ("count", count as Any), ("viewsCount", viewsCount as Any), ("forwardsCount", forwardsCount as Any), ("reactionsCount", reactionsCount as Any), ("views", views as Any), ("chats", chats as Any), ("users", users as Any), ("nextOffset", nextOffset as Any)]) - } - } - + public class Cons_storyViewsList { + public var flags: Int32 + public var count: Int32 + public var viewsCount: Int32 + public var forwardsCount: Int32 + public var reactionsCount: Int32 + public var views: [Api.StoryView] + public var chats: [Api.Chat] + public var users: [Api.User] + public var nextOffset: String? + public init(flags: Int32, count: Int32, viewsCount: Int32, forwardsCount: Int32, reactionsCount: Int32, views: [Api.StoryView], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { + self.flags = flags + self.count = count + self.viewsCount = viewsCount + self.forwardsCount = forwardsCount + self.reactionsCount = reactionsCount + self.views = views + self.chats = chats + self.users = users + self.nextOffset = nextOffset + } + } + case storyViewsList(Cons_storyViewsList) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .storyViewsList(let _data): + if boxed { + buffer.appendInt32(1507299269) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt32(_data.viewsCount, buffer: buffer, boxed: false) + serializeInt32(_data.forwardsCount, buffer: buffer, boxed: false) + serializeInt32(_data.reactionsCount, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.views.count)) + for item in _data.views { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.nextOffset!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .storyViewsList(let _data): + return ("storyViewsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("viewsCount", _data.viewsCount as Any), ("forwardsCount", _data.forwardsCount as Any), ("reactionsCount", _data.reactionsCount as Any), ("views", _data.views as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + } + } + public static func parse_storyViewsList(_ reader: BufferReader) -> StoryViewsList? { var _1: Int32? _1 = reader.readInt32() @@ -328,7 +406,9 @@ public extension Api.stories { _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } var _9: String? - if Int(_1!) & Int(1 << 0) != 0 {_9 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _9 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -339,103 +419,154 @@ public extension Api.stories { let _c8 = _8 != nil let _c9 = (Int(_1!) & Int(1 << 0) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.stories.StoryViewsList.storyViewsList(flags: _1!, count: _2!, viewsCount: _3!, forwardsCount: _4!, reactionsCount: _5!, views: _6!, chats: _7!, users: _8!, nextOffset: _9) + return Api.stories.StoryViewsList.storyViewsList(Cons_storyViewsList(flags: _1!, count: _2!, viewsCount: _3!, forwardsCount: _4!, reactionsCount: _5!, views: _6!, chats: _7!, users: _8!, nextOffset: _9)) } else { return nil } } - } } public extension Api.updates { indirect enum ChannelDifference: TypeConstructorDescription { - case channelDifference(flags: Int32, pts: Int32, timeout: Int32?, newMessages: [Api.Message], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User]) - case channelDifferenceEmpty(flags: Int32, pts: Int32, timeout: Int32?) - case channelDifferenceTooLong(flags: Int32, timeout: Int32?, dialog: Api.Dialog, messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelDifference(let flags, let pts, let timeout, let newMessages, let otherUpdates, let chats, let users): - if boxed { - buffer.appendInt32(543450958) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(timeout!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newMessages.count)) - for item in newMessages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherUpdates.count)) - for item in otherUpdates { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .channelDifferenceEmpty(let flags, let pts, let timeout): - if boxed { - buffer.appendInt32(1041346555) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(timeout!, buffer: buffer, boxed: false)} - break - case .channelDifferenceTooLong(let flags, let timeout, let dialog, let messages, let chats, let users): - if boxed { - buffer.appendInt32(-1531132162) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(timeout!, buffer: buffer, boxed: false)} - dialog.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelDifference(let flags, let pts, let timeout, let newMessages, let otherUpdates, let chats, let users): - return ("channelDifference", [("flags", flags as Any), ("pts", pts as Any), ("timeout", timeout as Any), ("newMessages", newMessages as Any), ("otherUpdates", otherUpdates as Any), ("chats", chats as Any), ("users", users as Any)]) - case .channelDifferenceEmpty(let flags, let pts, let timeout): - return ("channelDifferenceEmpty", [("flags", flags as Any), ("pts", pts as Any), ("timeout", timeout as Any)]) - case .channelDifferenceTooLong(let flags, let timeout, let dialog, let messages, let chats, let users): - return ("channelDifferenceTooLong", [("flags", flags as Any), ("timeout", timeout as Any), ("dialog", dialog as Any), ("messages", messages as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_channelDifference { + public var flags: Int32 + public var pts: Int32 + public var timeout: Int32? + public var newMessages: [Api.Message] + public var otherUpdates: [Api.Update] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, pts: Int32, timeout: Int32?, newMessages: [Api.Message], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.pts = pts + self.timeout = timeout + self.newMessages = newMessages + self.otherUpdates = otherUpdates + self.chats = chats + self.users = users + } + } + public class Cons_channelDifferenceEmpty { + public var flags: Int32 + public var pts: Int32 + public var timeout: Int32? + public init(flags: Int32, pts: Int32, timeout: Int32?) { + self.flags = flags + self.pts = pts + self.timeout = timeout + } + } + public class Cons_channelDifferenceTooLong { + public var flags: Int32 + public var timeout: Int32? + public var dialog: Api.Dialog + public var messages: [Api.Message] + public var chats: [Api.Chat] + public var users: [Api.User] + public init(flags: Int32, timeout: Int32?, dialog: Api.Dialog, messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) { + self.flags = flags + self.timeout = timeout + self.dialog = dialog + self.messages = messages + self.chats = chats + self.users = users + } + } + case channelDifference(Cons_channelDifference) + case channelDifferenceEmpty(Cons_channelDifferenceEmpty) + case channelDifferenceTooLong(Cons_channelDifferenceTooLong) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelDifference(let _data): + if boxed { + buffer.appendInt32(543450958) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.timeout!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newMessages.count)) + for item in _data.newMessages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.otherUpdates.count)) + for item in _data.otherUpdates { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .channelDifferenceEmpty(let _data): + if boxed { + buffer.appendInt32(1041346555) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.pts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.timeout!, buffer: buffer, boxed: false) + } + break + case .channelDifferenceTooLong(let _data): + if boxed { + buffer.appendInt32(-1531132162) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.timeout!, buffer: buffer, boxed: false) + } + _data.dialog.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.messages.count)) + for item in _data.messages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelDifference(let _data): + return ("channelDifference", [("flags", _data.flags as Any), ("pts", _data.pts as Any), ("timeout", _data.timeout as Any), ("newMessages", _data.newMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + case .channelDifferenceEmpty(let _data): + return ("channelDifferenceEmpty", [("flags", _data.flags as Any), ("pts", _data.pts as Any), ("timeout", _data.timeout as Any)]) + case .channelDifferenceTooLong(let _data): + return ("channelDifferenceTooLong", [("flags", _data.flags as Any), ("timeout", _data.timeout as Any), ("dialog", _data.dialog as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_channelDifference(_ reader: BufferReader) -> ChannelDifference? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } var _4: [Api.Message]? if let _ = reader.readInt32() { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) @@ -460,7 +591,7 @@ public extension Api.updates { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.updates.ChannelDifference.channelDifference(flags: _1!, pts: _2!, timeout: _3, newMessages: _4!, otherUpdates: _5!, chats: _6!, users: _7!) + return Api.updates.ChannelDifference.channelDifference(Cons_channelDifference(flags: _1!, pts: _2!, timeout: _3, newMessages: _4!, otherUpdates: _5!, chats: _6!, users: _7!)) } else { return nil @@ -472,12 +603,14 @@ public extension Api.updates { var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.updates.ChannelDifference.channelDifferenceEmpty(flags: _1!, pts: _2!, timeout: _3) + return Api.updates.ChannelDifference.channelDifferenceEmpty(Cons_channelDifferenceEmpty(flags: _1!, pts: _2!, timeout: _3)) } else { return nil @@ -487,7 +620,9 @@ public extension Api.updates { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } var _3: Api.Dialog? if let signature = reader.readInt32() { _3 = Api.parse(reader, signature: signature) as? Api.Dialog @@ -511,115 +646,160 @@ public extension Api.updates { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.ChannelDifference.channelDifferenceTooLong(flags: _1!, timeout: _2, dialog: _3!, messages: _4!, chats: _5!, users: _6!) + return Api.updates.ChannelDifference.channelDifferenceTooLong(Cons_channelDifferenceTooLong(flags: _1!, timeout: _2, dialog: _3!, messages: _4!, chats: _5!, users: _6!)) } else { return nil } } - } } public extension Api.updates { enum Difference: TypeConstructorDescription { - case difference(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) - case differenceEmpty(date: Int32, seq: Int32) - case differenceSlice(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], intermediateState: Api.updates.State) - case differenceTooLong(pts: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .difference(let newMessages, let newEncryptedMessages, let otherUpdates, let chats, let users, let state): - if boxed { - buffer.appendInt32(16030880) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newMessages.count)) - for item in newMessages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newEncryptedMessages.count)) - for item in newEncryptedMessages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherUpdates.count)) - for item in otherUpdates { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - state.serialize(buffer, true) - break - case .differenceEmpty(let date, let seq): - if boxed { - buffer.appendInt32(1567990072) - } - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(seq, buffer: buffer, boxed: false) - break - case .differenceSlice(let newMessages, let newEncryptedMessages, let otherUpdates, let chats, let users, let intermediateState): - if boxed { - buffer.appendInt32(-1459938943) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newMessages.count)) - for item in newMessages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(newEncryptedMessages.count)) - for item in newEncryptedMessages { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherUpdates.count)) - for item in otherUpdates { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - intermediateState.serialize(buffer, true) - break - case .differenceTooLong(let pts): - if boxed { - buffer.appendInt32(1258196845) - } - serializeInt32(pts, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .difference(let newMessages, let newEncryptedMessages, let otherUpdates, let chats, let users, let state): - return ("difference", [("newMessages", newMessages as Any), ("newEncryptedMessages", newEncryptedMessages as Any), ("otherUpdates", otherUpdates as Any), ("chats", chats as Any), ("users", users as Any), ("state", state as Any)]) - case .differenceEmpty(let date, let seq): - return ("differenceEmpty", [("date", date as Any), ("seq", seq as Any)]) - case .differenceSlice(let newMessages, let newEncryptedMessages, let otherUpdates, let chats, let users, let intermediateState): - return ("differenceSlice", [("newMessages", newMessages as Any), ("newEncryptedMessages", newEncryptedMessages as Any), ("otherUpdates", otherUpdates as Any), ("chats", chats as Any), ("users", users as Any), ("intermediateState", intermediateState as Any)]) - case .differenceTooLong(let pts): - return ("differenceTooLong", [("pts", pts as Any)]) - } - } - + public class Cons_difference { + public var newMessages: [Api.Message] + public var newEncryptedMessages: [Api.EncryptedMessage] + public var otherUpdates: [Api.Update] + public var chats: [Api.Chat] + public var users: [Api.User] + public var state: Api.updates.State + public init(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], state: Api.updates.State) { + self.newMessages = newMessages + self.newEncryptedMessages = newEncryptedMessages + self.otherUpdates = otherUpdates + self.chats = chats + self.users = users + self.state = state + } + } + public class Cons_differenceEmpty { + public var date: Int32 + public var seq: Int32 + public init(date: Int32, seq: Int32) { + self.date = date + self.seq = seq + } + } + public class Cons_differenceSlice { + public var newMessages: [Api.Message] + public var newEncryptedMessages: [Api.EncryptedMessage] + public var otherUpdates: [Api.Update] + public var chats: [Api.Chat] + public var users: [Api.User] + public var intermediateState: Api.updates.State + public init(newMessages: [Api.Message], newEncryptedMessages: [Api.EncryptedMessage], otherUpdates: [Api.Update], chats: [Api.Chat], users: [Api.User], intermediateState: Api.updates.State) { + self.newMessages = newMessages + self.newEncryptedMessages = newEncryptedMessages + self.otherUpdates = otherUpdates + self.chats = chats + self.users = users + self.intermediateState = intermediateState + } + } + public class Cons_differenceTooLong { + public var pts: Int32 + public init(pts: Int32) { + self.pts = pts + } + } + case difference(Cons_difference) + case differenceEmpty(Cons_differenceEmpty) + case differenceSlice(Cons_differenceSlice) + case differenceTooLong(Cons_differenceTooLong) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .difference(let _data): + if boxed { + buffer.appendInt32(16030880) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newMessages.count)) + for item in _data.newMessages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newEncryptedMessages.count)) + for item in _data.newEncryptedMessages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.otherUpdates.count)) + for item in _data.otherUpdates { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + _data.state.serialize(buffer, true) + break + case .differenceEmpty(let _data): + if boxed { + buffer.appendInt32(1567990072) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.seq, buffer: buffer, boxed: false) + break + case .differenceSlice(let _data): + if boxed { + buffer.appendInt32(-1459938943) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newMessages.count)) + for item in _data.newMessages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.newEncryptedMessages.count)) + for item in _data.newEncryptedMessages { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.otherUpdates.count)) + for item in _data.otherUpdates { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + _data.intermediateState.serialize(buffer, true) + break + case .differenceTooLong(let _data): + if boxed { + buffer.appendInt32(1258196845) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .difference(let _data): + return ("difference", [("newMessages", _data.newMessages as Any), ("newEncryptedMessages", _data.newEncryptedMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("state", _data.state as Any)]) + case .differenceEmpty(let _data): + return ("differenceEmpty", [("date", _data.date as Any), ("seq", _data.seq as Any)]) + case .differenceSlice(let _data): + return ("differenceSlice", [("newMessages", _data.newMessages as Any), ("newEncryptedMessages", _data.newEncryptedMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("intermediateState", _data.intermediateState as Any)]) + case .differenceTooLong(let _data): + return ("differenceTooLong", [("pts", _data.pts as Any)]) + } + } + public static func parse_difference(_ reader: BufferReader) -> Difference? { var _1: [Api.Message]? if let _ = reader.readInt32() { @@ -652,7 +832,7 @@ public extension Api.updates { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.Difference.difference(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, state: _6!) + return Api.updates.Difference.difference(Cons_difference(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, state: _6!)) } else { return nil @@ -666,7 +846,7 @@ public extension Api.updates { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.updates.Difference.differenceEmpty(date: _1!, seq: _2!) + return Api.updates.Difference.differenceEmpty(Cons_differenceEmpty(date: _1!, seq: _2!)) } else { return nil @@ -704,7 +884,7 @@ public extension Api.updates { let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.Difference.differenceSlice(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, intermediateState: _6!) + return Api.updates.Difference.differenceSlice(Cons_differenceSlice(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, intermediateState: _6!)) } else { return nil @@ -715,41 +895,54 @@ public extension Api.updates { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.updates.Difference.differenceTooLong(pts: _1!) + return Api.updates.Difference.differenceTooLong(Cons_differenceTooLong(pts: _1!)) } else { return nil } } - } } public extension Api.updates { enum State: TypeConstructorDescription { - case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .state(let pts, let qts, let date, let seq, let unreadCount): - if boxed { - buffer.appendInt32(-1519637954) - } - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(qts, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(seq, buffer: buffer, boxed: false) - serializeInt32(unreadCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .state(let pts, let qts, let date, let seq, let unreadCount): - return ("state", [("pts", pts as Any), ("qts", qts as Any), ("date", date as Any), ("seq", seq as Any), ("unreadCount", unreadCount as Any)]) - } - } - + public class Cons_state { + public var pts: Int32 + public var qts: Int32 + public var date: Int32 + public var seq: Int32 + public var unreadCount: Int32 + public init(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32) { + self.pts = pts + self.qts = qts + self.date = date + self.seq = seq + self.unreadCount = unreadCount + } + } + case state(Cons_state) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .state(let _data): + if boxed { + buffer.appendInt32(-1519637954) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.seq, buffer: buffer, boxed: false) + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .state(let _data): + return ("state", [("pts", _data.pts as Any), ("qts", _data.qts as Any), ("date", _data.date as Any), ("seq", _data.seq as Any), ("unreadCount", _data.unreadCount as Any)]) + } + } + public static func parse_state(_ reader: BufferReader) -> State? { var _1: Int32? _1 = reader.readInt32() @@ -767,52 +960,63 @@ public extension Api.updates { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.updates.State.state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!) + return Api.updates.State.state(Cons_state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!)) } else { return nil } } - } } public extension Api.upload { enum CdnFile: TypeConstructorDescription { - case cdnFile(bytes: Buffer) - case cdnFileReuploadNeeded(requestToken: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .cdnFile(let bytes): - if boxed { - buffer.appendInt32(-1449145777) - } - serializeBytes(bytes, buffer: buffer, boxed: false) - break - case .cdnFileReuploadNeeded(let requestToken): - if boxed { - buffer.appendInt32(-290921362) - } - serializeBytes(requestToken, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .cdnFile(let bytes): - return ("cdnFile", [("bytes", bytes as Any)]) - case .cdnFileReuploadNeeded(let requestToken): - return ("cdnFileReuploadNeeded", [("requestToken", requestToken as Any)]) - } - } - + public class Cons_cdnFile { + public var bytes: Buffer + public init(bytes: Buffer) { + self.bytes = bytes + } + } + public class Cons_cdnFileReuploadNeeded { + public var requestToken: Buffer + public init(requestToken: Buffer) { + self.requestToken = requestToken + } + } + case cdnFile(Cons_cdnFile) + case cdnFileReuploadNeeded(Cons_cdnFileReuploadNeeded) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .cdnFile(let _data): + if boxed { + buffer.appendInt32(-1449145777) + } + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + case .cdnFileReuploadNeeded(let _data): + if boxed { + buffer.appendInt32(-290921362) + } + serializeBytes(_data.requestToken, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .cdnFile(let _data): + return ("cdnFile", [("bytes", _data.bytes as Any)]) + case .cdnFileReuploadNeeded(let _data): + return ("cdnFileReuploadNeeded", [("requestToken", _data.requestToken as Any)]) + } + } + public static func parse_cdnFile(_ reader: BufferReader) -> CdnFile? { var _1: Buffer? _1 = parseBytes(reader) let _c1 = _1 != nil if _c1 { - return Api.upload.CdnFile.cdnFile(bytes: _1!) + return Api.upload.CdnFile.cdnFile(Cons_cdnFile(bytes: _1!)) } else { return nil @@ -823,56 +1027,79 @@ public extension Api.upload { _1 = parseBytes(reader) let _c1 = _1 != nil if _c1 { - return Api.upload.CdnFile.cdnFileReuploadNeeded(requestToken: _1!) + return Api.upload.CdnFile.cdnFileReuploadNeeded(Cons_cdnFileReuploadNeeded(requestToken: _1!)) } else { return nil } } - } } public extension Api.upload { enum File: TypeConstructorDescription { - case file(type: Api.storage.FileType, mtime: Int32, bytes: Buffer) - case fileCdnRedirect(dcId: Int32, fileToken: Buffer, encryptionKey: Buffer, encryptionIv: Buffer, fileHashes: [Api.FileHash]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .file(let type, let mtime, let bytes): - if boxed { - buffer.appendInt32(157948117) - } - type.serialize(buffer, true) - serializeInt32(mtime, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - case .fileCdnRedirect(let dcId, let fileToken, let encryptionKey, let encryptionIv, let fileHashes): - if boxed { - buffer.appendInt32(-242427324) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeBytes(fileToken, buffer: buffer, boxed: false) - serializeBytes(encryptionKey, buffer: buffer, boxed: false) - serializeBytes(encryptionIv, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(fileHashes.count)) - for item in fileHashes { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .file(let type, let mtime, let bytes): - return ("file", [("type", type as Any), ("mtime", mtime as Any), ("bytes", bytes as Any)]) - case .fileCdnRedirect(let dcId, let fileToken, let encryptionKey, let encryptionIv, let fileHashes): - return ("fileCdnRedirect", [("dcId", dcId as Any), ("fileToken", fileToken as Any), ("encryptionKey", encryptionKey as Any), ("encryptionIv", encryptionIv as Any), ("fileHashes", fileHashes as Any)]) - } - } - + public class Cons_file { + public var type: Api.storage.FileType + public var mtime: Int32 + public var bytes: Buffer + public init(type: Api.storage.FileType, mtime: Int32, bytes: Buffer) { + self.type = type + self.mtime = mtime + self.bytes = bytes + } + } + public class Cons_fileCdnRedirect { + public var dcId: Int32 + public var fileToken: Buffer + public var encryptionKey: Buffer + public var encryptionIv: Buffer + public var fileHashes: [Api.FileHash] + public init(dcId: Int32, fileToken: Buffer, encryptionKey: Buffer, encryptionIv: Buffer, fileHashes: [Api.FileHash]) { + self.dcId = dcId + self.fileToken = fileToken + self.encryptionKey = encryptionKey + self.encryptionIv = encryptionIv + self.fileHashes = fileHashes + } + } + case file(Cons_file) + case fileCdnRedirect(Cons_fileCdnRedirect) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .file(let _data): + if boxed { + buffer.appendInt32(157948117) + } + _data.type.serialize(buffer, true) + serializeInt32(_data.mtime, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + case .fileCdnRedirect(let _data): + if boxed { + buffer.appendInt32(-242427324) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeBytes(_data.fileToken, buffer: buffer, boxed: false) + serializeBytes(_data.encryptionKey, buffer: buffer, boxed: false) + serializeBytes(_data.encryptionIv, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.fileHashes.count)) + for item in _data.fileHashes { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .file(let _data): + return ("file", [("type", _data.type as Any), ("mtime", _data.mtime as Any), ("bytes", _data.bytes as Any)]) + case .fileCdnRedirect(let _data): + return ("fileCdnRedirect", [("dcId", _data.dcId as Any), ("fileToken", _data.fileToken as Any), ("encryptionKey", _data.encryptionKey as Any), ("encryptionIv", _data.encryptionIv as Any), ("fileHashes", _data.fileHashes as Any)]) + } + } + public static func parse_file(_ reader: BufferReader) -> File? { var _1: Api.storage.FileType? if let signature = reader.readInt32() { @@ -886,7 +1113,7 @@ public extension Api.upload { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.upload.File.file(type: _1!, mtime: _2!, bytes: _3!) + return Api.upload.File.file(Cons_file(type: _1!, mtime: _2!, bytes: _3!)) } else { return nil @@ -911,41 +1138,54 @@ public extension Api.upload { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.upload.File.fileCdnRedirect(dcId: _1!, fileToken: _2!, encryptionKey: _3!, encryptionIv: _4!, fileHashes: _5!) + return Api.upload.File.fileCdnRedirect(Cons_fileCdnRedirect(dcId: _1!, fileToken: _2!, encryptionKey: _3!, encryptionIv: _4!, fileHashes: _5!)) } else { return nil } } - } } public extension Api.upload { enum WebFile: TypeConstructorDescription { - case webFile(size: Int32, mimeType: String, fileType: Api.storage.FileType, mtime: Int32, bytes: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webFile(let size, let mimeType, let fileType, let mtime, let bytes): - if boxed { - buffer.appendInt32(568808380) - } - serializeInt32(size, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - fileType.serialize(buffer, true) - serializeInt32(mtime, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .webFile(let size, let mimeType, let fileType, let mtime, let bytes): - return ("webFile", [("size", size as Any), ("mimeType", mimeType as Any), ("fileType", fileType as Any), ("mtime", mtime as Any), ("bytes", bytes as Any)]) - } - } - + public class Cons_webFile { + public var size: Int32 + public var mimeType: String + public var fileType: Api.storage.FileType + public var mtime: Int32 + public var bytes: Buffer + public init(size: Int32, mimeType: String, fileType: Api.storage.FileType, mtime: Int32, bytes: Buffer) { + self.size = size + self.mimeType = mimeType + self.fileType = fileType + self.mtime = mtime + self.bytes = bytes + } + } + case webFile(Cons_webFile) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webFile(let _data): + if boxed { + buffer.appendInt32(568808380) + } + serializeInt32(_data.size, buffer: buffer, boxed: false) + serializeString(_data.mimeType, buffer: buffer, boxed: false) + _data.fileType.serialize(buffer, true) + serializeInt32(_data.mtime, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .webFile(let _data): + return ("webFile", [("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("fileType", _data.fileType as Any), ("mtime", _data.mtime as Any), ("bytes", _data.bytes as Any)]) + } + } + public static func parse_webFile(_ reader: BufferReader) -> WebFile? { var _1: Int32? _1 = reader.readInt32() @@ -965,51 +1205,64 @@ public extension Api.upload { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.upload.WebFile.webFile(size: _1!, mimeType: _2!, fileType: _3!, mtime: _4!, bytes: _5!) + return Api.upload.WebFile.webFile(Cons_webFile(size: _1!, mimeType: _2!, fileType: _3!, mtime: _4!, bytes: _5!)) } else { return nil } } - } } public extension Api.users { enum SavedMusic: TypeConstructorDescription { - case savedMusic(count: Int32, documents: [Api.Document]) - case savedMusicNotModified(count: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedMusic(let count, let documents): - if boxed { - buffer.appendInt32(883094167) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - break - case .savedMusicNotModified(let count): - if boxed { - buffer.appendInt32(-477656412) - } - serializeInt32(count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedMusic(let count, let documents): - return ("savedMusic", [("count", count as Any), ("documents", documents as Any)]) - case .savedMusicNotModified(let count): - return ("savedMusicNotModified", [("count", count as Any)]) - } - } - + public class Cons_savedMusic { + public var count: Int32 + public var documents: [Api.Document] + public init(count: Int32, documents: [Api.Document]) { + self.count = count + self.documents = documents + } + } + public class Cons_savedMusicNotModified { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + } + case savedMusic(Cons_savedMusic) + case savedMusicNotModified(Cons_savedMusicNotModified) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedMusic(let _data): + if boxed { + buffer.appendInt32(883094167) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documents.count)) + for item in _data.documents { + item.serialize(buffer, true) + } + break + case .savedMusicNotModified(let _data): + if boxed { + buffer.appendInt32(-477656412) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .savedMusic(let _data): + return ("savedMusic", [("count", _data.count as Any), ("documents", _data.documents as Any)]) + case .savedMusicNotModified(let _data): + return ("savedMusicNotModified", [("count", _data.count as Any)]) + } + } + public static func parse_savedMusic(_ reader: BufferReader) -> SavedMusic? { var _1: Int32? _1 = reader.readInt32() @@ -1020,7 +1273,7 @@ public extension Api.users { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.users.SavedMusic.savedMusic(count: _1!, documents: _2!) + return Api.users.SavedMusic.savedMusic(Cons_savedMusic(count: _1!, documents: _2!)) } else { return nil @@ -1031,47 +1284,56 @@ public extension Api.users { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.users.SavedMusic.savedMusicNotModified(count: _1!) + return Api.users.SavedMusic.savedMusicNotModified(Cons_savedMusicNotModified(count: _1!)) } else { return nil } } - } } public extension Api.users { enum UserFull: TypeConstructorDescription { - case userFull(fullUser: Api.UserFull, chats: [Api.Chat], users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userFull(let fullUser, let chats, let users): - if boxed { - buffer.appendInt32(997004590) - } - fullUser.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(chats.count)) - for item in chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .userFull(let fullUser, let chats, let users): - return ("userFull", [("fullUser", fullUser as Any), ("chats", chats as Any), ("users", users as Any)]) - } - } - + public class Cons_userFull { + public var fullUser: Api.UserFull + public var chats: [Api.Chat] + public var users: [Api.User] + public init(fullUser: Api.UserFull, chats: [Api.Chat], users: [Api.User]) { + self.fullUser = fullUser + self.chats = chats + self.users = users + } + } + case userFull(Cons_userFull) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userFull(let _data): + if boxed { + buffer.appendInt32(997004590) + } + _data.fullUser.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .userFull(let _data): + return ("userFull", [("fullUser", _data.fullUser as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + } + } + public static func parse_userFull(_ reader: BufferReader) -> UserFull? { var _1: Api.UserFull? if let signature = reader.readInt32() { @@ -1089,55 +1351,68 @@ public extension Api.users { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.users.UserFull.userFull(fullUser: _1!, chats: _2!, users: _3!) + return Api.users.UserFull.userFull(Cons_userFull(fullUser: _1!, chats: _2!, users: _3!)) } else { return nil } } - } } public extension Api.users { enum Users: TypeConstructorDescription { - case users(users: [Api.User]) - case usersSlice(count: Int32, users: [Api.User]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .users(let users): - if boxed { - buffer.appendInt32(1658259128) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - case .usersSlice(let count, let users): - if boxed { - buffer.appendInt32(828000628) - } - serializeInt32(count, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .users(let users): - return ("users", [("users", users as Any)]) - case .usersSlice(let count, let users): - return ("usersSlice", [("count", count as Any), ("users", users as Any)]) - } - } - + public class Cons_users { + public var users: [Api.User] + public init(users: [Api.User]) { + self.users = users + } + } + public class Cons_usersSlice { + public var count: Int32 + public var users: [Api.User] + public init(count: Int32, users: [Api.User]) { + self.count = count + self.users = users + } + } + case users(Cons_users) + case usersSlice(Cons_usersSlice) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .users(let _data): + if boxed { + buffer.appendInt32(1658259128) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .usersSlice(let _data): + if boxed { + buffer.appendInt32(828000628) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .users(let _data): + return ("users", [("users", _data.users as Any)]) + case .usersSlice(let _data): + return ("usersSlice", [("count", _data.count as Any), ("users", _data.users as Any)]) + } + } + public static func parse_users(_ reader: BufferReader) -> Users? { var _1: [Api.User]? if let _ = reader.readInt32() { @@ -1145,7 +1420,7 @@ public extension Api.users { } let _c1 = _1 != nil if _c1 { - return Api.users.Users.users(users: _1!) + return Api.users.Users.users(Cons_users(users: _1!)) } else { return nil @@ -1161,12 +1436,11 @@ public extension Api.users { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.users.Users.usersSlice(count: _1!, users: _2!) + return Api.users.Users.usersSlice(Cons_usersSlice(count: _1!, users: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api4.swift b/submodules/TelegramApi/Sources/Api4.swift index fad4416f33..395f2822ea 100644 --- a/submodules/TelegramApi/Sources/Api4.swift +++ b/submodules/TelegramApi/Sources/Api4.swift @@ -1,71 +1,83 @@ public extension Api { enum ChannelAdminLogEventsFilter: TypeConstructorDescription { - case channelAdminLogEventsFilter(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelAdminLogEventsFilter(let flags): - if boxed { - buffer.appendInt32(-368018716) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelAdminLogEventsFilter(let flags): - return ("channelAdminLogEventsFilter", [("flags", flags as Any)]) - } - } - + public class Cons_channelAdminLogEventsFilter { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case channelAdminLogEventsFilter(Cons_channelAdminLogEventsFilter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelAdminLogEventsFilter(let _data): + if boxed { + buffer.appendInt32(-368018716) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelAdminLogEventsFilter(let _data): + return ("channelAdminLogEventsFilter", [("flags", _data.flags as Any)]) + } + } + public static func parse_channelAdminLogEventsFilter(_ reader: BufferReader) -> ChannelAdminLogEventsFilter? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ChannelAdminLogEventsFilter.channelAdminLogEventsFilter(flags: _1!) + return Api.ChannelAdminLogEventsFilter.channelAdminLogEventsFilter(Cons_channelAdminLogEventsFilter(flags: _1!)) } else { return nil } } - } } public extension Api { enum ChannelLocation: TypeConstructorDescription { - case channelLocation(geoPoint: Api.GeoPoint, address: String) + public class Cons_channelLocation { + public var geoPoint: Api.GeoPoint + public var address: String + public init(geoPoint: Api.GeoPoint, address: String) { + self.geoPoint = geoPoint + self.address = address + } + } + case channelLocation(Cons_channelLocation) case channelLocationEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelLocation(let geoPoint, let address): - if boxed { - buffer.appendInt32(547062491) - } - geoPoint.serialize(buffer, true) - serializeString(address, buffer: buffer, boxed: false) - break - case .channelLocationEmpty: - if boxed { - buffer.appendInt32(-1078612597) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelLocation(let geoPoint, let address): - return ("channelLocation", [("geoPoint", geoPoint as Any), ("address", address as Any)]) - case .channelLocationEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelLocation(let _data): + if boxed { + buffer.appendInt32(547062491) + } + _data.geoPoint.serialize(buffer, true) + serializeString(_data.address, buffer: buffer, boxed: false) + break + case .channelLocationEmpty: + if boxed { + buffer.appendInt32(-1078612597) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelLocation(let _data): + return ("channelLocation", [("geoPoint", _data.geoPoint as Any), ("address", _data.address as Any)]) + case .channelLocationEmpty: return ("channelLocationEmpty", []) - } - } - + } + } + public static func parse_channelLocation(_ reader: BufferReader) -> ChannelLocation? { var _1: Api.GeoPoint? if let signature = reader.readInt32() { @@ -76,7 +88,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelLocation.channelLocation(geoPoint: _1!, address: _2!) + return Api.ChannelLocation.channelLocation(Cons_channelLocation(geoPoint: _1!, address: _2!)) } else { return nil @@ -85,45 +97,51 @@ public extension Api { public static func parse_channelLocationEmpty(_ reader: BufferReader) -> ChannelLocation? { return Api.ChannelLocation.channelLocationEmpty } - } } public extension Api { enum ChannelMessagesFilter: TypeConstructorDescription { - case channelMessagesFilter(flags: Int32, ranges: [Api.MessageRange]) + public class Cons_channelMessagesFilter { + public var flags: Int32 + public var ranges: [Api.MessageRange] + public init(flags: Int32, ranges: [Api.MessageRange]) { + self.flags = flags + self.ranges = ranges + } + } + case channelMessagesFilter(Cons_channelMessagesFilter) case channelMessagesFilterEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelMessagesFilter(let flags, let ranges): - if boxed { - buffer.appendInt32(-847783593) - } - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ranges.count)) - for item in ranges { - item.serialize(buffer, true) - } - break - case .channelMessagesFilterEmpty: - if boxed { - buffer.appendInt32(-1798033689) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelMessagesFilter(let flags, let ranges): - return ("channelMessagesFilter", [("flags", flags as Any), ("ranges", ranges as Any)]) - case .channelMessagesFilterEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelMessagesFilter(let _data): + if boxed { + buffer.appendInt32(-847783593) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.ranges.count)) + for item in _data.ranges { + item.serialize(buffer, true) + } + break + case .channelMessagesFilterEmpty: + if boxed { + buffer.appendInt32(-1798033689) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelMessagesFilter(let _data): + return ("channelMessagesFilter", [("flags", _data.flags as Any), ("ranges", _data.ranges as Any)]) + case .channelMessagesFilterEmpty: return ("channelMessagesFilterEmpty", []) - } - } - + } + } + public static func parse_channelMessagesFilter(_ reader: BufferReader) -> ChannelMessagesFilter? { var _1: Int32? _1 = reader.readInt32() @@ -134,7 +152,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChannelMessagesFilter.channelMessagesFilter(flags: _1!, ranges: _2!) + return Api.ChannelMessagesFilter.channelMessagesFilter(Cons_channelMessagesFilter(flags: _1!, ranges: _2!)) } else { return nil @@ -143,96 +161,181 @@ public extension Api { public static func parse_channelMessagesFilterEmpty(_ reader: BufferReader) -> ChannelMessagesFilter? { return Api.ChannelMessagesFilter.channelMessagesFilterEmpty } - } } public extension Api { enum ChannelParticipant: TypeConstructorDescription { - case channelParticipant(flags: Int32, userId: Int64, date: Int32, subscriptionUntilDate: Int32?) - case channelParticipantAdmin(flags: Int32, userId: Int64, inviterId: Int64?, promotedBy: Int64, date: Int32, adminRights: Api.ChatAdminRights, rank: String?) - case channelParticipantBanned(flags: Int32, peer: Api.Peer, kickedBy: Int64, date: Int32, bannedRights: Api.ChatBannedRights) - case channelParticipantCreator(flags: Int32, userId: Int64, adminRights: Api.ChatAdminRights, rank: String?) - case channelParticipantLeft(peer: Api.Peer) - case channelParticipantSelf(flags: Int32, userId: Int64, inviterId: Int64, date: Int32, subscriptionUntilDate: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelParticipant(let flags, let userId, let date, let subscriptionUntilDate): - if boxed { - buffer.appendInt32(-885426663) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)} - break - case .channelParticipantAdmin(let flags, let userId, let inviterId, let promotedBy, let date, let adminRights, let rank): - if boxed { - buffer.appendInt32(885242707) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(inviterId!, buffer: buffer, boxed: false)} - serializeInt64(promotedBy, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - adminRights.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeString(rank!, buffer: buffer, boxed: false)} - break - case .channelParticipantBanned(let flags, let peer, let kickedBy, let date, let bannedRights): - if boxed { - buffer.appendInt32(1844969806) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt64(kickedBy, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - bannedRights.serialize(buffer, true) - break - case .channelParticipantCreator(let flags, let userId, let adminRights, let rank): - if boxed { - buffer.appendInt32(803602899) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - adminRights.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(rank!, buffer: buffer, boxed: false)} - break - case .channelParticipantLeft(let peer): - if boxed { - buffer.appendInt32(453242886) - } - peer.serialize(buffer, true) - break - case .channelParticipantSelf(let flags, let userId, let inviterId, let date, let subscriptionUntilDate): - if boxed { - buffer.appendInt32(1331723247) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(inviterId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelParticipant(let flags, let userId, let date, let subscriptionUntilDate): - return ("channelParticipant", [("flags", flags as Any), ("userId", userId as Any), ("date", date as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any)]) - case .channelParticipantAdmin(let flags, let userId, let inviterId, let promotedBy, let date, let adminRights, let rank): - return ("channelParticipantAdmin", [("flags", flags as Any), ("userId", userId as Any), ("inviterId", inviterId as Any), ("promotedBy", promotedBy as Any), ("date", date as Any), ("adminRights", adminRights as Any), ("rank", rank as Any)]) - case .channelParticipantBanned(let flags, let peer, let kickedBy, let date, let bannedRights): - return ("channelParticipantBanned", [("flags", flags as Any), ("peer", peer as Any), ("kickedBy", kickedBy as Any), ("date", date as Any), ("bannedRights", bannedRights as Any)]) - case .channelParticipantCreator(let flags, let userId, let adminRights, let rank): - return ("channelParticipantCreator", [("flags", flags as Any), ("userId", userId as Any), ("adminRights", adminRights as Any), ("rank", rank as Any)]) - case .channelParticipantLeft(let peer): - return ("channelParticipantLeft", [("peer", peer as Any)]) - case .channelParticipantSelf(let flags, let userId, let inviterId, let date, let subscriptionUntilDate): - return ("channelParticipantSelf", [("flags", flags as Any), ("userId", userId as Any), ("inviterId", inviterId as Any), ("date", date as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any)]) - } - } - + public class Cons_channelParticipant { + public var flags: Int32 + public var userId: Int64 + public var date: Int32 + public var subscriptionUntilDate: Int32? + public init(flags: Int32, userId: Int64, date: Int32, subscriptionUntilDate: Int32?) { + self.flags = flags + self.userId = userId + self.date = date + self.subscriptionUntilDate = subscriptionUntilDate + } + } + public class Cons_channelParticipantAdmin { + public var flags: Int32 + public var userId: Int64 + public var inviterId: Int64? + public var promotedBy: Int64 + public var date: Int32 + public var adminRights: Api.ChatAdminRights + public var rank: String? + public init(flags: Int32, userId: Int64, inviterId: Int64?, promotedBy: Int64, date: Int32, adminRights: Api.ChatAdminRights, rank: String?) { + self.flags = flags + self.userId = userId + self.inviterId = inviterId + self.promotedBy = promotedBy + self.date = date + self.adminRights = adminRights + self.rank = rank + } + } + public class Cons_channelParticipantBanned { + public var flags: Int32 + public var peer: Api.Peer + public var kickedBy: Int64 + public var date: Int32 + public var bannedRights: Api.ChatBannedRights + public init(flags: Int32, peer: Api.Peer, kickedBy: Int64, date: Int32, bannedRights: Api.ChatBannedRights) { + self.flags = flags + self.peer = peer + self.kickedBy = kickedBy + self.date = date + self.bannedRights = bannedRights + } + } + public class Cons_channelParticipantCreator { + public var flags: Int32 + public var userId: Int64 + public var adminRights: Api.ChatAdminRights + public var rank: String? + public init(flags: Int32, userId: Int64, adminRights: Api.ChatAdminRights, rank: String?) { + self.flags = flags + self.userId = userId + self.adminRights = adminRights + self.rank = rank + } + } + public class Cons_channelParticipantLeft { + public var peer: Api.Peer + public init(peer: Api.Peer) { + self.peer = peer + } + } + public class Cons_channelParticipantSelf { + public var flags: Int32 + public var userId: Int64 + public var inviterId: Int64 + public var date: Int32 + public var subscriptionUntilDate: Int32? + public init(flags: Int32, userId: Int64, inviterId: Int64, date: Int32, subscriptionUntilDate: Int32?) { + self.flags = flags + self.userId = userId + self.inviterId = inviterId + self.date = date + self.subscriptionUntilDate = subscriptionUntilDate + } + } + case channelParticipant(Cons_channelParticipant) + case channelParticipantAdmin(Cons_channelParticipantAdmin) + case channelParticipantBanned(Cons_channelParticipantBanned) + case channelParticipantCreator(Cons_channelParticipantCreator) + case channelParticipantLeft(Cons_channelParticipantLeft) + case channelParticipantSelf(Cons_channelParticipantSelf) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelParticipant(let _data): + if boxed { + buffer.appendInt32(-885426663) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.subscriptionUntilDate!, buffer: buffer, boxed: false) + } + break + case .channelParticipantAdmin(let _data): + if boxed { + buffer.appendInt32(885242707) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.inviterId!, buffer: buffer, boxed: false) + } + serializeInt64(_data.promotedBy, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.adminRights.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.rank!, buffer: buffer, boxed: false) + } + break + case .channelParticipantBanned(let _data): + if boxed { + buffer.appendInt32(1844969806) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt64(_data.kickedBy, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.bannedRights.serialize(buffer, true) + break + case .channelParticipantCreator(let _data): + if boxed { + buffer.appendInt32(803602899) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.adminRights.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.rank!, buffer: buffer, boxed: false) + } + break + case .channelParticipantLeft(let _data): + if boxed { + buffer.appendInt32(453242886) + } + _data.peer.serialize(buffer, true) + break + case .channelParticipantSelf(let _data): + if boxed { + buffer.appendInt32(1331723247) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.inviterId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.subscriptionUntilDate!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelParticipant(let _data): + return ("channelParticipant", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + case .channelParticipantAdmin(let _data): + return ("channelParticipantAdmin", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("promotedBy", _data.promotedBy as Any), ("date", _data.date as Any), ("adminRights", _data.adminRights as Any), ("rank", _data.rank as Any)]) + case .channelParticipantBanned(let _data): + return ("channelParticipantBanned", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("kickedBy", _data.kickedBy as Any), ("date", _data.date as Any), ("bannedRights", _data.bannedRights as Any)]) + case .channelParticipantCreator(let _data): + return ("channelParticipantCreator", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("adminRights", _data.adminRights as Any), ("rank", _data.rank as Any)]) + case .channelParticipantLeft(let _data): + return ("channelParticipantLeft", [("peer", _data.peer as Any)]) + case .channelParticipantSelf(let _data): + return ("channelParticipantSelf", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + } + } + public static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { var _1: Int32? _1 = reader.readInt32() @@ -241,13 +344,15 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ChannelParticipant.channelParticipant(flags: _1!, userId: _2!, date: _3!, subscriptionUntilDate: _4) + return Api.ChannelParticipant.channelParticipant(Cons_channelParticipant(flags: _1!, userId: _2!, date: _3!, subscriptionUntilDate: _4)) } else { return nil @@ -259,7 +364,9 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt64() + } var _4: Int64? _4 = reader.readInt64() var _5: Int32? @@ -269,7 +376,9 @@ public extension Api { _6 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights } var _7: String? - if Int(_1!) & Int(1 << 2) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil @@ -278,7 +387,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.ChannelParticipant.channelParticipantAdmin(flags: _1!, userId: _2!, inviterId: _3, promotedBy: _4!, date: _5!, adminRights: _6!, rank: _7) + return Api.ChannelParticipant.channelParticipantAdmin(Cons_channelParticipantAdmin(flags: _1!, userId: _2!, inviterId: _3, promotedBy: _4!, date: _5!, adminRights: _6!, rank: _7)) } else { return nil @@ -305,7 +414,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.ChannelParticipant.channelParticipantBanned(flags: _1!, peer: _2!, kickedBy: _3!, date: _4!, bannedRights: _5!) + return Api.ChannelParticipant.channelParticipantBanned(Cons_channelParticipantBanned(flags: _1!, peer: _2!, kickedBy: _3!, date: _4!, bannedRights: _5!)) } else { return nil @@ -321,13 +430,15 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights } var _4: String? - if Int(_1!) & Int(1 << 0) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ChannelParticipant.channelParticipantCreator(flags: _1!, userId: _2!, adminRights: _3!, rank: _4) + return Api.ChannelParticipant.channelParticipantCreator(Cons_channelParticipantCreator(flags: _1!, userId: _2!, adminRights: _3!, rank: _4)) } else { return nil @@ -340,7 +451,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChannelParticipant.channelParticipantLeft(peer: _1!) + return Api.ChannelParticipant.channelParticipantLeft(Cons_channelParticipantLeft(peer: _1!)) } else { return nil @@ -356,109 +467,145 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.ChannelParticipant.channelParticipantSelf(flags: _1!, userId: _2!, inviterId: _3!, date: _4!, subscriptionUntilDate: _5) + return Api.ChannelParticipant.channelParticipantSelf(Cons_channelParticipantSelf(flags: _1!, userId: _2!, inviterId: _3!, date: _4!, subscriptionUntilDate: _5)) } else { return nil } } - } } public extension Api { enum ChannelParticipantsFilter: TypeConstructorDescription { + public class Cons_channelParticipantsBanned { + public var q: String + public init(q: String) { + self.q = q + } + } + public class Cons_channelParticipantsContacts { + public var q: String + public init(q: String) { + self.q = q + } + } + public class Cons_channelParticipantsKicked { + public var q: String + public init(q: String) { + self.q = q + } + } + public class Cons_channelParticipantsMentions { + public var flags: Int32 + public var q: String? + public var topMsgId: Int32? + public init(flags: Int32, q: String?, topMsgId: Int32?) { + self.flags = flags + self.q = q + self.topMsgId = topMsgId + } + } + public class Cons_channelParticipantsSearch { + public var q: String + public init(q: String) { + self.q = q + } + } case channelParticipantsAdmins - case channelParticipantsBanned(q: String) + case channelParticipantsBanned(Cons_channelParticipantsBanned) case channelParticipantsBots - case channelParticipantsContacts(q: String) - case channelParticipantsKicked(q: String) - case channelParticipantsMentions(flags: Int32, q: String?, topMsgId: Int32?) + case channelParticipantsContacts(Cons_channelParticipantsContacts) + case channelParticipantsKicked(Cons_channelParticipantsKicked) + case channelParticipantsMentions(Cons_channelParticipantsMentions) case channelParticipantsRecent - case channelParticipantsSearch(q: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelParticipantsAdmins: - if boxed { - buffer.appendInt32(-1268741783) - } - - break - case .channelParticipantsBanned(let q): - if boxed { - buffer.appendInt32(338142689) - } - serializeString(q, buffer: buffer, boxed: false) - break - case .channelParticipantsBots: - if boxed { - buffer.appendInt32(-1328445861) - } - - break - case .channelParticipantsContacts(let q): - if boxed { - buffer.appendInt32(-1150621555) - } - serializeString(q, buffer: buffer, boxed: false) - break - case .channelParticipantsKicked(let q): - if boxed { - buffer.appendInt32(-1548400251) - } - serializeString(q, buffer: buffer, boxed: false) - break - case .channelParticipantsMentions(let flags, let q, let topMsgId): - if boxed { - buffer.appendInt32(-531931925) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(q!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - break - case .channelParticipantsRecent: - if boxed { - buffer.appendInt32(-566281095) - } - - break - case .channelParticipantsSearch(let q): - if boxed { - buffer.appendInt32(106343499) - } - serializeString(q, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelParticipantsAdmins: + case channelParticipantsSearch(Cons_channelParticipantsSearch) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelParticipantsAdmins: + if boxed { + buffer.appendInt32(-1268741783) + } + break + case .channelParticipantsBanned(let _data): + if boxed { + buffer.appendInt32(338142689) + } + serializeString(_data.q, buffer: buffer, boxed: false) + break + case .channelParticipantsBots: + if boxed { + buffer.appendInt32(-1328445861) + } + break + case .channelParticipantsContacts(let _data): + if boxed { + buffer.appendInt32(-1150621555) + } + serializeString(_data.q, buffer: buffer, boxed: false) + break + case .channelParticipantsKicked(let _data): + if boxed { + buffer.appendInt32(-1548400251) + } + serializeString(_data.q, buffer: buffer, boxed: false) + break + case .channelParticipantsMentions(let _data): + if boxed { + buffer.appendInt32(-531931925) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.q!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.topMsgId!, buffer: buffer, boxed: false) + } + break + case .channelParticipantsRecent: + if boxed { + buffer.appendInt32(-566281095) + } + break + case .channelParticipantsSearch(let _data): + if boxed { + buffer.appendInt32(106343499) + } + serializeString(_data.q, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelParticipantsAdmins: return ("channelParticipantsAdmins", []) - case .channelParticipantsBanned(let q): - return ("channelParticipantsBanned", [("q", q as Any)]) - case .channelParticipantsBots: + case .channelParticipantsBanned(let _data): + return ("channelParticipantsBanned", [("q", _data.q as Any)]) + case .channelParticipantsBots: return ("channelParticipantsBots", []) - case .channelParticipantsContacts(let q): - return ("channelParticipantsContacts", [("q", q as Any)]) - case .channelParticipantsKicked(let q): - return ("channelParticipantsKicked", [("q", q as Any)]) - case .channelParticipantsMentions(let flags, let q, let topMsgId): - return ("channelParticipantsMentions", [("flags", flags as Any), ("q", q as Any), ("topMsgId", topMsgId as Any)]) - case .channelParticipantsRecent: + case .channelParticipantsContacts(let _data): + return ("channelParticipantsContacts", [("q", _data.q as Any)]) + case .channelParticipantsKicked(let _data): + return ("channelParticipantsKicked", [("q", _data.q as Any)]) + case .channelParticipantsMentions(let _data): + return ("channelParticipantsMentions", [("flags", _data.flags as Any), ("q", _data.q as Any), ("topMsgId", _data.topMsgId as Any)]) + case .channelParticipantsRecent: return ("channelParticipantsRecent", []) - case .channelParticipantsSearch(let q): - return ("channelParticipantsSearch", [("q", q as Any)]) - } - } - + case .channelParticipantsSearch(let _data): + return ("channelParticipantsSearch", [("q", _data.q as Any)]) + } + } + public static func parse_channelParticipantsAdmins(_ reader: BufferReader) -> ChannelParticipantsFilter? { return Api.ChannelParticipantsFilter.channelParticipantsAdmins } @@ -467,7 +614,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ChannelParticipantsFilter.channelParticipantsBanned(q: _1!) + return Api.ChannelParticipantsFilter.channelParticipantsBanned(Cons_channelParticipantsBanned(q: _1!)) } else { return nil @@ -481,7 +628,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ChannelParticipantsFilter.channelParticipantsContacts(q: _1!) + return Api.ChannelParticipantsFilter.channelParticipantsContacts(Cons_channelParticipantsContacts(q: _1!)) } else { return nil @@ -492,7 +639,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ChannelParticipantsFilter.channelParticipantsKicked(q: _1!) + return Api.ChannelParticipantsFilter.channelParticipantsKicked(Cons_channelParticipantsKicked(q: _1!)) } else { return nil @@ -502,14 +649,18 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } var _3: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.ChannelParticipantsFilter.channelParticipantsMentions(flags: _1!, q: _2, topMsgId: _3) + return Api.ChannelParticipantsFilter.channelParticipantsMentions(Cons_channelParticipantsMentions(flags: _1!, q: _2, topMsgId: _3)) } else { return nil @@ -523,117 +674,260 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ChannelParticipantsFilter.channelParticipantsSearch(q: _1!) + return Api.ChannelParticipantsFilter.channelParticipantsSearch(Cons_channelParticipantsSearch(q: _1!)) } else { return nil } } - } } public extension Api { indirect enum Chat: TypeConstructorDescription { - case channel(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, restrictionReason: [Api.RestrictionReason]?, adminRights: Api.ChatAdminRights?, bannedRights: Api.ChatBannedRights?, defaultBannedRights: Api.ChatBannedRights?, participantsCount: Int32?, usernames: [Api.Username]?, storiesMaxId: Api.RecentStory?, color: Api.PeerColor?, profileColor: Api.PeerColor?, emojiStatus: Api.EmojiStatus?, level: Int32?, subscriptionUntilDate: Int32?, botVerificationIcon: Int64?, sendPaidMessagesStars: Int64?, linkedMonoforumId: Int64?) - case channelForbidden(flags: Int32, id: Int64, accessHash: Int64, title: String, untilDate: Int32?) - case chat(flags: Int32, id: Int64, title: String, photo: Api.ChatPhoto, participantsCount: Int32, date: Int32, version: Int32, migratedTo: Api.InputChannel?, adminRights: Api.ChatAdminRights?, defaultBannedRights: Api.ChatBannedRights?) - case chatEmpty(id: Int64) - case chatForbidden(id: Int64, title: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate, let botVerificationIcon, let sendPaidMessagesStars, let linkedMonoforumId): - if boxed { - buffer.appendInt32(473084188) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(flags2, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 13) != 0 {serializeInt64(accessHash!, buffer: buffer, boxed: false)} - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 6) != 0 {serializeString(username!, buffer: buffer, boxed: false)} - photo.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 9) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(restrictionReason!.count)) - for item in restrictionReason! { + public class Cons_channel { + public var flags: Int32 + public var flags2: Int32 + public var id: Int64 + public var accessHash: Int64? + public var title: String + public var username: String? + public var photo: Api.ChatPhoto + public var date: Int32 + public var restrictionReason: [Api.RestrictionReason]? + public var adminRights: Api.ChatAdminRights? + public var bannedRights: Api.ChatBannedRights? + public var defaultBannedRights: Api.ChatBannedRights? + public var participantsCount: Int32? + public var usernames: [Api.Username]? + public var storiesMaxId: Api.RecentStory? + public var color: Api.PeerColor? + public var profileColor: Api.PeerColor? + public var emojiStatus: Api.EmojiStatus? + public var level: Int32? + public var subscriptionUntilDate: Int32? + public var botVerificationIcon: Int64? + public var sendPaidMessagesStars: Int64? + public var linkedMonoforumId: Int64? + public init(flags: Int32, flags2: Int32, id: Int64, accessHash: Int64?, title: String, username: String?, photo: Api.ChatPhoto, date: Int32, restrictionReason: [Api.RestrictionReason]?, adminRights: Api.ChatAdminRights?, bannedRights: Api.ChatBannedRights?, defaultBannedRights: Api.ChatBannedRights?, participantsCount: Int32?, usernames: [Api.Username]?, storiesMaxId: Api.RecentStory?, color: Api.PeerColor?, profileColor: Api.PeerColor?, emojiStatus: Api.EmojiStatus?, level: Int32?, subscriptionUntilDate: Int32?, botVerificationIcon: Int64?, sendPaidMessagesStars: Int64?, linkedMonoforumId: Int64?) { + self.flags = flags + self.flags2 = flags2 + self.id = id + self.accessHash = accessHash + self.title = title + self.username = username + self.photo = photo + self.date = date + self.restrictionReason = restrictionReason + self.adminRights = adminRights + self.bannedRights = bannedRights + self.defaultBannedRights = defaultBannedRights + self.participantsCount = participantsCount + self.usernames = usernames + self.storiesMaxId = storiesMaxId + self.color = color + self.profileColor = profileColor + self.emojiStatus = emojiStatus + self.level = level + self.subscriptionUntilDate = subscriptionUntilDate + self.botVerificationIcon = botVerificationIcon + self.sendPaidMessagesStars = sendPaidMessagesStars + self.linkedMonoforumId = linkedMonoforumId + } + } + public class Cons_channelForbidden { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var title: String + public var untilDate: Int32? + public init(flags: Int32, id: Int64, accessHash: Int64, title: String, untilDate: Int32?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.title = title + self.untilDate = untilDate + } + } + public class Cons_chat { + public var flags: Int32 + public var id: Int64 + public var title: String + public var photo: Api.ChatPhoto + public var participantsCount: Int32 + public var date: Int32 + public var version: Int32 + public var migratedTo: Api.InputChannel? + public var adminRights: Api.ChatAdminRights? + public var defaultBannedRights: Api.ChatBannedRights? + public init(flags: Int32, id: Int64, title: String, photo: Api.ChatPhoto, participantsCount: Int32, date: Int32, version: Int32, migratedTo: Api.InputChannel?, adminRights: Api.ChatAdminRights?, defaultBannedRights: Api.ChatBannedRights?) { + self.flags = flags + self.id = id + self.title = title + self.photo = photo + self.participantsCount = participantsCount + self.date = date + self.version = version + self.migratedTo = migratedTo + self.adminRights = adminRights + self.defaultBannedRights = defaultBannedRights + } + } + public class Cons_chatEmpty { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + public class Cons_chatForbidden { + public var id: Int64 + public var title: String + public init(id: Int64, title: String) { + self.id = id + self.title = title + } + } + case channel(Cons_channel) + case channelForbidden(Cons_channelForbidden) + case chat(Cons_chat) + case chatEmpty(Cons_chatEmpty) + case chatForbidden(Cons_chatForbidden) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channel(let _data): + if boxed { + buffer.appendInt32(473084188) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.flags2, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt64(_data.accessHash!, buffer: buffer, boxed: false) + } + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.username!, buffer: buffer, boxed: false) + } + _data.photo.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 9) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.restrictionReason!.count)) + for item in _data.restrictionReason! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 14) != 0 {adminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 15) != 0 {bannedRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {defaultBannedRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt32(participantsCount!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(usernames!.count)) - for item in usernames! { + } + } + if Int(_data.flags) & Int(1 << 14) != 0 { + _data.adminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.bannedRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.defaultBannedRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + serializeInt32(_data.participantsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.usernames!.count)) + for item in _data.usernames! { item.serialize(buffer, true) - }} - if Int(flags2) & Int(1 << 4) != 0 {storiesMaxId!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 7) != 0 {color!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 8) != 0 {profileColor!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 9) != 0 {emojiStatus!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 10) != 0 {serializeInt32(level!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 11) != 0 {serializeInt32(subscriptionUntilDate!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 13) != 0 {serializeInt64(botVerificationIcon!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 14) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 18) != 0 {serializeInt64(linkedMonoforumId!, buffer: buffer, boxed: false)} - break - case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate): - if boxed { - buffer.appendInt32(399807445) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 16) != 0 {serializeInt32(untilDate!, buffer: buffer, boxed: false)} - break - case .chat(let flags, let id, let title, let photo, let participantsCount, let date, let version, let migratedTo, let adminRights, let defaultBannedRights): - if boxed { - buffer.appendInt32(1103884886) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - photo.serialize(buffer, true) - serializeInt32(participantsCount, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 6) != 0 {migratedTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {adminRights!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {defaultBannedRights!.serialize(buffer, true)} - break - case .chatEmpty(let id): - if boxed { - buffer.appendInt32(693512293) - } - serializeInt64(id, buffer: buffer, boxed: false) - break - case .chatForbidden(let id, let title): - if boxed { - buffer.appendInt32(1704108455) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channel(let flags, let flags2, let id, let accessHash, let title, let username, let photo, let date, let restrictionReason, let adminRights, let bannedRights, let defaultBannedRights, let participantsCount, let usernames, let storiesMaxId, let color, let profileColor, let emojiStatus, let level, let subscriptionUntilDate, let botVerificationIcon, let sendPaidMessagesStars, let linkedMonoforumId): - return ("channel", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("username", username as Any), ("photo", photo as Any), ("date", date as Any), ("restrictionReason", restrictionReason as Any), ("adminRights", adminRights as Any), ("bannedRights", bannedRights as Any), ("defaultBannedRights", defaultBannedRights as Any), ("participantsCount", participantsCount as Any), ("usernames", usernames as Any), ("storiesMaxId", storiesMaxId as Any), ("color", color as Any), ("profileColor", profileColor as Any), ("emojiStatus", emojiStatus as Any), ("level", level as Any), ("subscriptionUntilDate", subscriptionUntilDate as Any), ("botVerificationIcon", botVerificationIcon as Any), ("sendPaidMessagesStars", sendPaidMessagesStars as Any), ("linkedMonoforumId", linkedMonoforumId as Any)]) - case .channelForbidden(let flags, let id, let accessHash, let title, let untilDate): - return ("channelForbidden", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("title", title as Any), ("untilDate", untilDate as Any)]) - case .chat(let flags, let id, let title, let photo, let participantsCount, let date, let version, let migratedTo, let adminRights, let defaultBannedRights): - return ("chat", [("flags", flags as Any), ("id", id as Any), ("title", title as Any), ("photo", photo as Any), ("participantsCount", participantsCount as Any), ("date", date as Any), ("version", version as Any), ("migratedTo", migratedTo as Any), ("adminRights", adminRights as Any), ("defaultBannedRights", defaultBannedRights as Any)]) - case .chatEmpty(let id): - return ("chatEmpty", [("id", id as Any)]) - case .chatForbidden(let id, let title): - return ("chatForbidden", [("id", id as Any), ("title", title as Any)]) - } - } - + } + if Int(_data.flags2) & Int(1 << 4) != 0 { + _data.storiesMaxId!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 7) != 0 { + _data.color!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 8) != 0 { + _data.profileColor!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 9) != 0 { + _data.emojiStatus!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 10) != 0 { + serializeInt32(_data.level!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 11) != 0 { + serializeInt32(_data.subscriptionUntilDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 13) != 0 { + serializeInt64(_data.botVerificationIcon!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 14) != 0 { + serializeInt64(_data.sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 18) != 0 { + serializeInt64(_data.linkedMonoforumId!, buffer: buffer, boxed: false) + } + break + case .channelForbidden(let _data): + if boxed { + buffer.appendInt32(399807445) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeInt32(_data.untilDate!, buffer: buffer, boxed: false) + } + break + case .chat(let _data): + if boxed { + buffer.appendInt32(1103884886) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + _data.photo.serialize(buffer, true) + serializeInt32(_data.participantsCount, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.migratedTo!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + _data.adminRights!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.defaultBannedRights!.serialize(buffer, true) + } + break + case .chatEmpty(let _data): + if boxed { + buffer.appendInt32(693512293) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + case .chatForbidden(let _data): + if boxed { + buffer.appendInt32(1704108455) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channel(let _data): + return ("channel", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("username", _data.username as Any), ("photo", _data.photo as Any), ("date", _data.date as Any), ("restrictionReason", _data.restrictionReason as Any), ("adminRights", _data.adminRights as Any), ("bannedRights", _data.bannedRights as Any), ("defaultBannedRights", _data.defaultBannedRights as Any), ("participantsCount", _data.participantsCount as Any), ("usernames", _data.usernames as Any), ("storiesMaxId", _data.storiesMaxId as Any), ("color", _data.color as Any), ("profileColor", _data.profileColor as Any), ("emojiStatus", _data.emojiStatus as Any), ("level", _data.level as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any), ("botVerificationIcon", _data.botVerificationIcon as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("linkedMonoforumId", _data.linkedMonoforumId as Any)]) + case .channelForbidden(let _data): + return ("channelForbidden", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("untilDate", _data.untilDate as Any)]) + case .chat(let _data): + return ("chat", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("photo", _data.photo as Any), ("participantsCount", _data.participantsCount as Any), ("date", _data.date as Any), ("version", _data.version as Any), ("migratedTo", _data.migratedTo as Any), ("adminRights", _data.adminRights as Any), ("defaultBannedRights", _data.defaultBannedRights as Any)]) + case .chatEmpty(let _data): + return ("chatEmpty", [("id", _data.id as Any)]) + case .chatForbidden(let _data): + return ("chatForbidden", [("id", _data.id as Any), ("title", _data.title as Any)]) + } + } + public static func parse_channel(_ reader: BufferReader) -> Chat? { var _1: Int32? _1 = reader.readInt32() @@ -642,11 +936,15 @@ public extension Api { var _3: Int64? _3 = reader.readInt64() var _4: Int64? - if Int(_1!) & Int(1 << 13) != 0 {_4 = reader.readInt64() } + if Int(_1!) & Int(1 << 13) != 0 { + _4 = reader.readInt64() + } var _5: String? _5 = parseString(reader) var _6: String? - if Int(_1!) & Int(1 << 6) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 6) != 0 { + _6 = parseString(reader) + } var _7: Api.ChatPhoto? if let signature = reader.readInt32() { _7 = Api.parse(reader, signature: signature) as? Api.ChatPhoto @@ -654,53 +952,83 @@ public extension Api { var _8: Int32? _8 = reader.readInt32() var _9: [Api.RestrictionReason]? - if Int(_1!) & Int(1 << 9) != 0 {if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) + } + } var _10: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _11: Api.ChatBannedRights? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights + } + } var _12: Api.ChatBannedRights? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights + } + } var _13: Int32? - if Int(_1!) & Int(1 << 17) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 17) != 0 { + _13 = reader.readInt32() + } var _14: [Api.Username]? - if Int(_2!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) - } } + if Int(_2!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) + } + } var _15: Api.RecentStory? - if Int(_2!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.RecentStory - } } + if Int(_2!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.RecentStory + } + } var _16: Api.PeerColor? - if Int(_2!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_2!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _17: Api.PeerColor? - if Int(_2!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.PeerColor - } } + if Int(_2!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } var _18: Api.EmojiStatus? - if Int(_2!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.EmojiStatus - } } + if Int(_2!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _18 = Api.parse(reader, signature: signature) as? Api.EmojiStatus + } + } var _19: Int32? - if Int(_2!) & Int(1 << 10) != 0 {_19 = reader.readInt32() } + if Int(_2!) & Int(1 << 10) != 0 { + _19 = reader.readInt32() + } var _20: Int32? - if Int(_2!) & Int(1 << 11) != 0 {_20 = reader.readInt32() } + if Int(_2!) & Int(1 << 11) != 0 { + _20 = reader.readInt32() + } var _21: Int64? - if Int(_2!) & Int(1 << 13) != 0 {_21 = reader.readInt64() } + if Int(_2!) & Int(1 << 13) != 0 { + _21 = reader.readInt64() + } var _22: Int64? - if Int(_2!) & Int(1 << 14) != 0 {_22 = reader.readInt64() } + if Int(_2!) & Int(1 << 14) != 0 { + _22 = reader.readInt64() + } var _23: Int64? - if Int(_2!) & Int(1 << 18) != 0 {_23 = reader.readInt64() } + if Int(_2!) & Int(1 << 18) != 0 { + _23 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -725,7 +1053,7 @@ public extension Api { let _c22 = (Int(_2!) & Int(1 << 14) == 0) || _22 != nil let _c23 = (Int(_2!) & Int(1 << 18) == 0) || _23 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 { - return Api.Chat.channel(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, title: _5!, username: _6, photo: _7!, date: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, defaultBannedRights: _12, participantsCount: _13, usernames: _14, storiesMaxId: _15, color: _16, profileColor: _17, emojiStatus: _18, level: _19, subscriptionUntilDate: _20, botVerificationIcon: _21, sendPaidMessagesStars: _22, linkedMonoforumId: _23) + return Api.Chat.channel(Cons_channel(flags: _1!, flags2: _2!, id: _3!, accessHash: _4, title: _5!, username: _6, photo: _7!, date: _8!, restrictionReason: _9, adminRights: _10, bannedRights: _11, defaultBannedRights: _12, participantsCount: _13, usernames: _14, storiesMaxId: _15, color: _16, profileColor: _17, emojiStatus: _18, level: _19, subscriptionUntilDate: _20, botVerificationIcon: _21, sendPaidMessagesStars: _22, linkedMonoforumId: _23)) } else { return nil @@ -741,14 +1069,16 @@ public extension Api { var _4: String? _4 = parseString(reader) var _5: Int32? - if Int(_1!) & Int(1 << 16) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 16) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 16) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Chat.channelForbidden(flags: _1!, id: _2!, accessHash: _3!, title: _4!, untilDate: _5) + return Api.Chat.channelForbidden(Cons_channelForbidden(flags: _1!, id: _2!, accessHash: _3!, title: _4!, untilDate: _5)) } else { return nil @@ -772,17 +1102,23 @@ public extension Api { var _7: Int32? _7 = reader.readInt32() var _8: Api.InputChannel? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.InputChannel - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.InputChannel + } + } var _9: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } var _10: Api.ChatBannedRights? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -794,7 +1130,7 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 14) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 18) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.Chat.chat(flags: _1!, id: _2!, title: _3!, photo: _4!, participantsCount: _5!, date: _6!, version: _7!, migratedTo: _8, adminRights: _9, defaultBannedRights: _10) + return Api.Chat.chat(Cons_chat(flags: _1!, id: _2!, title: _3!, photo: _4!, participantsCount: _5!, date: _6!, version: _7!, migratedTo: _8, adminRights: _9, defaultBannedRights: _10)) } else { return nil @@ -805,7 +1141,7 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Chat.chatEmpty(id: _1!) + return Api.Chat.chatEmpty(Cons_chatEmpty(id: _1!)) } else { return nil @@ -819,75 +1155,89 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Chat.chatForbidden(id: _1!, title: _2!) + return Api.Chat.chatForbidden(Cons_chatForbidden(id: _1!, title: _2!)) } else { return nil } } - } } public extension Api { enum ChatAdminRights: TypeConstructorDescription { - case chatAdminRights(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatAdminRights(let flags): - if boxed { - buffer.appendInt32(1605510357) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatAdminRights(let flags): - return ("chatAdminRights", [("flags", flags as Any)]) - } - } - + public class Cons_chatAdminRights { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case chatAdminRights(Cons_chatAdminRights) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatAdminRights(let _data): + if boxed { + buffer.appendInt32(1605510357) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatAdminRights(let _data): + return ("chatAdminRights", [("flags", _data.flags as Any)]) + } + } + public static func parse_chatAdminRights(_ reader: BufferReader) -> ChatAdminRights? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ChatAdminRights.chatAdminRights(flags: _1!) + return Api.ChatAdminRights.chatAdminRights(Cons_chatAdminRights(flags: _1!)) } else { return nil } } - } } public extension Api { enum ChatAdminWithInvites: TypeConstructorDescription { - case chatAdminWithInvites(adminId: Int64, invitesCount: Int32, revokedInvitesCount: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatAdminWithInvites(let adminId, let invitesCount, let revokedInvitesCount): - if boxed { - buffer.appendInt32(-219353309) - } - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt32(invitesCount, buffer: buffer, boxed: false) - serializeInt32(revokedInvitesCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatAdminWithInvites(let adminId, let invitesCount, let revokedInvitesCount): - return ("chatAdminWithInvites", [("adminId", adminId as Any), ("invitesCount", invitesCount as Any), ("revokedInvitesCount", revokedInvitesCount as Any)]) - } - } - + public class Cons_chatAdminWithInvites { + public var adminId: Int64 + public var invitesCount: Int32 + public var revokedInvitesCount: Int32 + public init(adminId: Int64, invitesCount: Int32, revokedInvitesCount: Int32) { + self.adminId = adminId + self.invitesCount = invitesCount + self.revokedInvitesCount = revokedInvitesCount + } + } + case chatAdminWithInvites(Cons_chatAdminWithInvites) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatAdminWithInvites(let _data): + if boxed { + buffer.appendInt32(-219353309) + } + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt32(_data.invitesCount, buffer: buffer, boxed: false) + serializeInt32(_data.revokedInvitesCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatAdminWithInvites(let _data): + return ("chatAdminWithInvites", [("adminId", _data.adminId as Any), ("invitesCount", _data.invitesCount as Any), ("revokedInvitesCount", _data.revokedInvitesCount as Any)]) + } + } + public static func parse_chatAdminWithInvites(_ reader: BufferReader) -> ChatAdminWithInvites? { var _1: Int64? _1 = reader.readInt64() @@ -899,38 +1249,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.ChatAdminWithInvites.chatAdminWithInvites(adminId: _1!, invitesCount: _2!, revokedInvitesCount: _3!) + return Api.ChatAdminWithInvites.chatAdminWithInvites(Cons_chatAdminWithInvites(adminId: _1!, invitesCount: _2!, revokedInvitesCount: _3!)) } else { return nil } } - } } public extension Api { enum ChatBannedRights: TypeConstructorDescription { - case chatBannedRights(flags: Int32, untilDate: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatBannedRights(let flags, let untilDate): - if boxed { - buffer.appendInt32(-1626209256) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(untilDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatBannedRights(let flags, let untilDate): - return ("chatBannedRights", [("flags", flags as Any), ("untilDate", untilDate as Any)]) - } - } - + public class Cons_chatBannedRights { + public var flags: Int32 + public var untilDate: Int32 + public init(flags: Int32, untilDate: Int32) { + self.flags = flags + self.untilDate = untilDate + } + } + case chatBannedRights(Cons_chatBannedRights) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatBannedRights(let _data): + if boxed { + buffer.appendInt32(-1626209256) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.untilDate, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatBannedRights(let _data): + return ("chatBannedRights", [("flags", _data.flags as Any), ("untilDate", _data.untilDate as Any)]) + } + } + public static func parse_chatBannedRights(_ reader: BufferReader) -> ChatBannedRights? { var _1: Int32? _1 = reader.readInt32() @@ -939,129 +1296,364 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChatBannedRights.chatBannedRights(flags: _1!, untilDate: _2!) + return Api.ChatBannedRights.chatBannedRights(Cons_chatBannedRights(flags: _1!, untilDate: _2!)) } else { return nil } } - } } public extension Api { enum ChatFull: TypeConstructorDescription { - case channelFull(flags: Int32, flags2: Int32, id: Int64, about: String, participantsCount: Int32?, adminsCount: Int32?, kickedCount: Int32?, bannedCount: Int32?, onlineCount: Int32?, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, chatPhoto: Api.Photo, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite?, botInfo: [Api.BotInfo], migratedFromChatId: Int64?, migratedFromMaxId: Int32?, pinnedMsgId: Int32?, stickerset: Api.StickerSet?, availableMinId: Int32?, folderId: Int32?, linkedChatId: Int64?, location: Api.ChannelLocation?, slowmodeSeconds: Int32?, slowmodeNextSendDate: Int32?, statsDc: Int32?, pts: Int32, call: Api.InputGroupCall?, ttlPeriod: Int32?, pendingSuggestions: [String]?, groupcallDefaultJoinAs: Api.Peer?, themeEmoticon: String?, requestsPending: Int32?, recentRequesters: [Int64]?, defaultSendAs: Api.Peer?, availableReactions: Api.ChatReactions?, reactionsLimit: Int32?, stories: Api.PeerStories?, wallpaper: Api.WallPaper?, boostsApplied: Int32?, boostsUnrestrict: Int32?, emojiset: Api.StickerSet?, botVerification: Api.BotVerification?, stargiftsCount: Int32?, sendPaidMessagesStars: Int64?, mainTab: Api.ProfileTab?) - case chatFull(flags: Int32, id: Int64, about: String, participants: Api.ChatParticipants, chatPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite?, botInfo: [Api.BotInfo]?, pinnedMsgId: Int32?, folderId: Int32?, call: Api.InputGroupCall?, ttlPeriod: Int32?, groupcallDefaultJoinAs: Api.Peer?, themeEmoticon: String?, requestsPending: Int32?, recentRequesters: [Int64]?, availableReactions: Api.ChatReactions?, reactionsLimit: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelFull(let flags, let flags2, let id, let about, let participantsCount, let adminsCount, let kickedCount, let bannedCount, let onlineCount, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let chatPhoto, let notifySettings, let exportedInvite, let botInfo, let migratedFromChatId, let migratedFromMaxId, let pinnedMsgId, let stickerset, let availableMinId, let folderId, let linkedChatId, let location, let slowmodeSeconds, let slowmodeNextSendDate, let statsDc, let pts, let call, let ttlPeriod, let pendingSuggestions, let groupcallDefaultJoinAs, let themeEmoticon, let requestsPending, let recentRequesters, let defaultSendAs, let availableReactions, let reactionsLimit, let stories, let wallpaper, let boostsApplied, let boostsUnrestrict, let emojiset, let botVerification, let stargiftsCount, let sendPaidMessagesStars, let mainTab): - if boxed { - buffer.appendInt32(-455036259) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(flags2, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(about, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(participantsCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(adminsCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(kickedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(bannedCount!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt32(onlineCount!, buffer: buffer, boxed: false)} - serializeInt32(readInboxMaxId, buffer: buffer, boxed: false) - serializeInt32(readOutboxMaxId, buffer: buffer, boxed: false) - serializeInt32(unreadCount, buffer: buffer, boxed: false) - chatPhoto.serialize(buffer, true) - notifySettings.serialize(buffer, true) - if Int(flags) & Int(1 << 23) != 0 {exportedInvite!.serialize(buffer, true)} + public class Cons_channelFull { + public var flags: Int32 + public var flags2: Int32 + public var id: Int64 + public var about: String + public var participantsCount: Int32? + public var adminsCount: Int32? + public var kickedCount: Int32? + public var bannedCount: Int32? + public var onlineCount: Int32? + public var readInboxMaxId: Int32 + public var readOutboxMaxId: Int32 + public var unreadCount: Int32 + public var chatPhoto: Api.Photo + public var notifySettings: Api.PeerNotifySettings + public var exportedInvite: Api.ExportedChatInvite? + public var botInfo: [Api.BotInfo] + public var migratedFromChatId: Int64? + public var migratedFromMaxId: Int32? + public var pinnedMsgId: Int32? + public var stickerset: Api.StickerSet? + public var availableMinId: Int32? + public var folderId: Int32? + public var linkedChatId: Int64? + public var location: Api.ChannelLocation? + public var slowmodeSeconds: Int32? + public var slowmodeNextSendDate: Int32? + public var statsDc: Int32? + public var pts: Int32 + public var call: Api.InputGroupCall? + public var ttlPeriod: Int32? + public var pendingSuggestions: [String]? + public var groupcallDefaultJoinAs: Api.Peer? + public var themeEmoticon: String? + public var requestsPending: Int32? + public var recentRequesters: [Int64]? + public var defaultSendAs: Api.Peer? + public var availableReactions: Api.ChatReactions? + public var reactionsLimit: Int32? + public var stories: Api.PeerStories? + public var wallpaper: Api.WallPaper? + public var boostsApplied: Int32? + public var boostsUnrestrict: Int32? + public var emojiset: Api.StickerSet? + public var botVerification: Api.BotVerification? + public var stargiftsCount: Int32? + public var sendPaidMessagesStars: Int64? + public var mainTab: Api.ProfileTab? + public init(flags: Int32, flags2: Int32, id: Int64, about: String, participantsCount: Int32?, adminsCount: Int32?, kickedCount: Int32?, bannedCount: Int32?, onlineCount: Int32?, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, chatPhoto: Api.Photo, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite?, botInfo: [Api.BotInfo], migratedFromChatId: Int64?, migratedFromMaxId: Int32?, pinnedMsgId: Int32?, stickerset: Api.StickerSet?, availableMinId: Int32?, folderId: Int32?, linkedChatId: Int64?, location: Api.ChannelLocation?, slowmodeSeconds: Int32?, slowmodeNextSendDate: Int32?, statsDc: Int32?, pts: Int32, call: Api.InputGroupCall?, ttlPeriod: Int32?, pendingSuggestions: [String]?, groupcallDefaultJoinAs: Api.Peer?, themeEmoticon: String?, requestsPending: Int32?, recentRequesters: [Int64]?, defaultSendAs: Api.Peer?, availableReactions: Api.ChatReactions?, reactionsLimit: Int32?, stories: Api.PeerStories?, wallpaper: Api.WallPaper?, boostsApplied: Int32?, boostsUnrestrict: Int32?, emojiset: Api.StickerSet?, botVerification: Api.BotVerification?, stargiftsCount: Int32?, sendPaidMessagesStars: Int64?, mainTab: Api.ProfileTab?) { + self.flags = flags + self.flags2 = flags2 + self.id = id + self.about = about + self.participantsCount = participantsCount + self.adminsCount = adminsCount + self.kickedCount = kickedCount + self.bannedCount = bannedCount + self.onlineCount = onlineCount + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount + self.chatPhoto = chatPhoto + self.notifySettings = notifySettings + self.exportedInvite = exportedInvite + self.botInfo = botInfo + self.migratedFromChatId = migratedFromChatId + self.migratedFromMaxId = migratedFromMaxId + self.pinnedMsgId = pinnedMsgId + self.stickerset = stickerset + self.availableMinId = availableMinId + self.folderId = folderId + self.linkedChatId = linkedChatId + self.location = location + self.slowmodeSeconds = slowmodeSeconds + self.slowmodeNextSendDate = slowmodeNextSendDate + self.statsDc = statsDc + self.pts = pts + self.call = call + self.ttlPeriod = ttlPeriod + self.pendingSuggestions = pendingSuggestions + self.groupcallDefaultJoinAs = groupcallDefaultJoinAs + self.themeEmoticon = themeEmoticon + self.requestsPending = requestsPending + self.recentRequesters = recentRequesters + self.defaultSendAs = defaultSendAs + self.availableReactions = availableReactions + self.reactionsLimit = reactionsLimit + self.stories = stories + self.wallpaper = wallpaper + self.boostsApplied = boostsApplied + self.boostsUnrestrict = boostsUnrestrict + self.emojiset = emojiset + self.botVerification = botVerification + self.stargiftsCount = stargiftsCount + self.sendPaidMessagesStars = sendPaidMessagesStars + self.mainTab = mainTab + } + } + public class Cons_chatFull { + public var flags: Int32 + public var id: Int64 + public var about: String + public var participants: Api.ChatParticipants + public var chatPhoto: Api.Photo? + public var notifySettings: Api.PeerNotifySettings + public var exportedInvite: Api.ExportedChatInvite? + public var botInfo: [Api.BotInfo]? + public var pinnedMsgId: Int32? + public var folderId: Int32? + public var call: Api.InputGroupCall? + public var ttlPeriod: Int32? + public var groupcallDefaultJoinAs: Api.Peer? + public var themeEmoticon: String? + public var requestsPending: Int32? + public var recentRequesters: [Int64]? + public var availableReactions: Api.ChatReactions? + public var reactionsLimit: Int32? + public init(flags: Int32, id: Int64, about: String, participants: Api.ChatParticipants, chatPhoto: Api.Photo?, notifySettings: Api.PeerNotifySettings, exportedInvite: Api.ExportedChatInvite?, botInfo: [Api.BotInfo]?, pinnedMsgId: Int32?, folderId: Int32?, call: Api.InputGroupCall?, ttlPeriod: Int32?, groupcallDefaultJoinAs: Api.Peer?, themeEmoticon: String?, requestsPending: Int32?, recentRequesters: [Int64]?, availableReactions: Api.ChatReactions?, reactionsLimit: Int32?) { + self.flags = flags + self.id = id + self.about = about + self.participants = participants + self.chatPhoto = chatPhoto + self.notifySettings = notifySettings + self.exportedInvite = exportedInvite + self.botInfo = botInfo + self.pinnedMsgId = pinnedMsgId + self.folderId = folderId + self.call = call + self.ttlPeriod = ttlPeriod + self.groupcallDefaultJoinAs = groupcallDefaultJoinAs + self.themeEmoticon = themeEmoticon + self.requestsPending = requestsPending + self.recentRequesters = recentRequesters + self.availableReactions = availableReactions + self.reactionsLimit = reactionsLimit + } + } + case channelFull(Cons_channelFull) + case chatFull(Cons_chatFull) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .channelFull(let _data): + if boxed { + buffer.appendInt32(-455036259) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.flags2, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.about, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.participantsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.adminsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.kickedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.bannedCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt32(_data.onlineCount!, buffer: buffer, boxed: false) + } + serializeInt32(_data.readInboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.readOutboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + _data.chatPhoto.serialize(buffer, true) + _data.notifySettings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 23) != 0 { + _data.exportedInvite!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.botInfo.count)) + for item in _data.botInfo { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.migratedFromChatId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.migratedFromMaxId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.pinnedMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.stickerset!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeInt32(_data.availableMinId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt64(_data.linkedChatId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.location!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + serializeInt32(_data.slowmodeSeconds!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 18) != 0 { + serializeInt32(_data.slowmodeNextSendDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt32(_data.statsDc!, buffer: buffer, boxed: false) + } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 21) != 0 { + _data.call!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 24) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 25) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(botInfo.count)) - for item in botInfo { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 4) != 0 {serializeInt64(migratedFromChatId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(migratedFromMaxId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(pinnedMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {stickerset!.serialize(buffer, true)} - if Int(flags) & Int(1 << 9) != 0 {serializeInt32(availableMinId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt64(linkedChatId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {location!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt32(slowmodeSeconds!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt32(slowmodeNextSendDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt32(statsDc!, buffer: buffer, boxed: false)} - serializeInt32(pts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 21) != 0 {call!.serialize(buffer, true)} - if Int(flags) & Int(1 << 24) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 25) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(pendingSuggestions!.count)) - for item in pendingSuggestions! { + buffer.appendInt32(Int32(_data.pendingSuggestions!.count)) + for item in _data.pendingSuggestions! { serializeString(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 26) != 0 {groupcallDefaultJoinAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 27) != 0 {serializeString(themeEmoticon!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 28) != 0 {serializeInt32(requestsPending!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 28) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentRequesters!.count)) - for item in recentRequesters! { - serializeInt64(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 29) != 0 {defaultSendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 30) != 0 {availableReactions!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 13) != 0 {serializeInt32(reactionsLimit!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 4) != 0 {stories!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 7) != 0 {wallpaper!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 8) != 0 {serializeInt32(boostsApplied!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 9) != 0 {serializeInt32(boostsUnrestrict!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 10) != 0 {emojiset!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 17) != 0 {botVerification!.serialize(buffer, true)} - if Int(flags2) & Int(1 << 18) != 0 {serializeInt32(stargiftsCount!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 21) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - if Int(flags2) & Int(1 << 22) != 0 {mainTab!.serialize(buffer, true)} - break - case .chatFull(let flags, let id, let about, let participants, let chatPhoto, let notifySettings, let exportedInvite, let botInfo, let pinnedMsgId, let folderId, let call, let ttlPeriod, let groupcallDefaultJoinAs, let themeEmoticon, let requestsPending, let recentRequesters, let availableReactions, let reactionsLimit): - if boxed { - buffer.appendInt32(640893467) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeString(about, buffer: buffer, boxed: false) - participants.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {chatPhoto!.serialize(buffer, true)} - notifySettings.serialize(buffer, true) - if Int(flags) & Int(1 << 13) != 0 {exportedInvite!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(botInfo!.count)) - for item in botInfo! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(pinnedMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {call!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {groupcallDefaultJoinAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 16) != 0 {serializeString(themeEmoticon!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt32(requestsPending!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(recentRequesters!.count)) - for item in recentRequesters! { + } + if Int(_data.flags) & Int(1 << 26) != 0 { + _data.groupcallDefaultJoinAs!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 27) != 0 { + serializeString(_data.themeEmoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 28) != 0 { + serializeInt32(_data.requestsPending!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 28) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentRequesters!.count)) + for item in _data.recentRequesters! { serializeInt64(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 18) != 0 {availableReactions!.serialize(buffer, true)} - if Int(flags) & Int(1 << 20) != 0 {serializeInt32(reactionsLimit!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelFull(let flags, let flags2, let id, let about, let participantsCount, let adminsCount, let kickedCount, let bannedCount, let onlineCount, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let chatPhoto, let notifySettings, let exportedInvite, let botInfo, let migratedFromChatId, let migratedFromMaxId, let pinnedMsgId, let stickerset, let availableMinId, let folderId, let linkedChatId, let location, let slowmodeSeconds, let slowmodeNextSendDate, let statsDc, let pts, let call, let ttlPeriod, let pendingSuggestions, let groupcallDefaultJoinAs, let themeEmoticon, let requestsPending, let recentRequesters, let defaultSendAs, let availableReactions, let reactionsLimit, let stories, let wallpaper, let boostsApplied, let boostsUnrestrict, let emojiset, let botVerification, let stargiftsCount, let sendPaidMessagesStars, let mainTab): - return ("channelFull", [("flags", flags as Any), ("flags2", flags2 as Any), ("id", id as Any), ("about", about as Any), ("participantsCount", participantsCount as Any), ("adminsCount", adminsCount as Any), ("kickedCount", kickedCount as Any), ("bannedCount", bannedCount as Any), ("onlineCount", onlineCount as Any), ("readInboxMaxId", readInboxMaxId as Any), ("readOutboxMaxId", readOutboxMaxId as Any), ("unreadCount", unreadCount as Any), ("chatPhoto", chatPhoto as Any), ("notifySettings", notifySettings as Any), ("exportedInvite", exportedInvite as Any), ("botInfo", botInfo as Any), ("migratedFromChatId", migratedFromChatId as Any), ("migratedFromMaxId", migratedFromMaxId as Any), ("pinnedMsgId", pinnedMsgId as Any), ("stickerset", stickerset as Any), ("availableMinId", availableMinId as Any), ("folderId", folderId as Any), ("linkedChatId", linkedChatId as Any), ("location", location as Any), ("slowmodeSeconds", slowmodeSeconds as Any), ("slowmodeNextSendDate", slowmodeNextSendDate as Any), ("statsDc", statsDc as Any), ("pts", pts as Any), ("call", call as Any), ("ttlPeriod", ttlPeriod as Any), ("pendingSuggestions", pendingSuggestions as Any), ("groupcallDefaultJoinAs", groupcallDefaultJoinAs as Any), ("themeEmoticon", themeEmoticon as Any), ("requestsPending", requestsPending as Any), ("recentRequesters", recentRequesters as Any), ("defaultSendAs", defaultSendAs as Any), ("availableReactions", availableReactions as Any), ("reactionsLimit", reactionsLimit as Any), ("stories", stories as Any), ("wallpaper", wallpaper as Any), ("boostsApplied", boostsApplied as Any), ("boostsUnrestrict", boostsUnrestrict as Any), ("emojiset", emojiset as Any), ("botVerification", botVerification as Any), ("stargiftsCount", stargiftsCount as Any), ("sendPaidMessagesStars", sendPaidMessagesStars as Any), ("mainTab", mainTab as Any)]) - case .chatFull(let flags, let id, let about, let participants, let chatPhoto, let notifySettings, let exportedInvite, let botInfo, let pinnedMsgId, let folderId, let call, let ttlPeriod, let groupcallDefaultJoinAs, let themeEmoticon, let requestsPending, let recentRequesters, let availableReactions, let reactionsLimit): - return ("chatFull", [("flags", flags as Any), ("id", id as Any), ("about", about as Any), ("participants", participants as Any), ("chatPhoto", chatPhoto as Any), ("notifySettings", notifySettings as Any), ("exportedInvite", exportedInvite as Any), ("botInfo", botInfo as Any), ("pinnedMsgId", pinnedMsgId as Any), ("folderId", folderId as Any), ("call", call as Any), ("ttlPeriod", ttlPeriod as Any), ("groupcallDefaultJoinAs", groupcallDefaultJoinAs as Any), ("themeEmoticon", themeEmoticon as Any), ("requestsPending", requestsPending as Any), ("recentRequesters", recentRequesters as Any), ("availableReactions", availableReactions as Any), ("reactionsLimit", reactionsLimit as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 29) != 0 { + _data.defaultSendAs!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 30) != 0 { + _data.availableReactions!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 13) != 0 { + serializeInt32(_data.reactionsLimit!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 4) != 0 { + _data.stories!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 7) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 8) != 0 { + serializeInt32(_data.boostsApplied!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 9) != 0 { + serializeInt32(_data.boostsUnrestrict!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 10) != 0 { + _data.emojiset!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 17) != 0 { + _data.botVerification!.serialize(buffer, true) + } + if Int(_data.flags2) & Int(1 << 18) != 0 { + serializeInt32(_data.stargiftsCount!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 21) != 0 { + serializeInt64(_data.sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 22) != 0 { + _data.mainTab!.serialize(buffer, true) + } + break + case .chatFull(let _data): + if boxed { + buffer.appendInt32(640893467) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeString(_data.about, buffer: buffer, boxed: false) + _data.participants.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.chatPhoto!.serialize(buffer, true) + } + _data.notifySettings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 13) != 0 { + _data.exportedInvite!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.botInfo!.count)) + for item in _data.botInfo! { + item.serialize(buffer, true) + } + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt32(_data.pinnedMsgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + _data.call!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.groupcallDefaultJoinAs!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.themeEmoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + serializeInt32(_data.requestsPending!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 17) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentRequesters!.count)) + for item in _data.recentRequesters! { + serializeInt64(item, buffer: buffer, boxed: false) + } + } + if Int(_data.flags) & Int(1 << 18) != 0 { + _data.availableReactions!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 20) != 0 { + serializeInt32(_data.reactionsLimit!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .channelFull(let _data): + return ("channelFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("participantsCount", _data.participantsCount as Any), ("adminsCount", _data.adminsCount as Any), ("kickedCount", _data.kickedCount as Any), ("bannedCount", _data.bannedCount as Any), ("onlineCount", _data.onlineCount as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("chatPhoto", _data.chatPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("exportedInvite", _data.exportedInvite as Any), ("botInfo", _data.botInfo as Any), ("migratedFromChatId", _data.migratedFromChatId as Any), ("migratedFromMaxId", _data.migratedFromMaxId as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("stickerset", _data.stickerset as Any), ("availableMinId", _data.availableMinId as Any), ("folderId", _data.folderId as Any), ("linkedChatId", _data.linkedChatId as Any), ("location", _data.location as Any), ("slowmodeSeconds", _data.slowmodeSeconds as Any), ("slowmodeNextSendDate", _data.slowmodeNextSendDate as Any), ("statsDc", _data.statsDc as Any), ("pts", _data.pts as Any), ("call", _data.call as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("pendingSuggestions", _data.pendingSuggestions as Any), ("groupcallDefaultJoinAs", _data.groupcallDefaultJoinAs as Any), ("themeEmoticon", _data.themeEmoticon as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any), ("defaultSendAs", _data.defaultSendAs as Any), ("availableReactions", _data.availableReactions as Any), ("reactionsLimit", _data.reactionsLimit as Any), ("stories", _data.stories as Any), ("wallpaper", _data.wallpaper as Any), ("boostsApplied", _data.boostsApplied as Any), ("boostsUnrestrict", _data.boostsUnrestrict as Any), ("emojiset", _data.emojiset as Any), ("botVerification", _data.botVerification as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("mainTab", _data.mainTab as Any)]) + case .chatFull(let _data): + return ("chatFull", [("flags", _data.flags as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("participants", _data.participants as Any), ("chatPhoto", _data.chatPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("exportedInvite", _data.exportedInvite as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("folderId", _data.folderId as Any), ("call", _data.call as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("groupcallDefaultJoinAs", _data.groupcallDefaultJoinAs as Any), ("themeEmoticon", _data.themeEmoticon as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any), ("availableReactions", _data.availableReactions as Any), ("reactionsLimit", _data.reactionsLimit as Any)]) + } + } + public static func parse_channelFull(_ reader: BufferReader) -> ChatFull? { var _1: Int32? _1 = reader.readInt32() @@ -1072,15 +1664,25 @@ public extension Api { var _4: String? _4 = parseString(reader) var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } var _7: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _7 = reader.readInt32() + } var _8: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _8 = reader.readInt32() + } var _9: Int32? - if Int(_1!) & Int(1 << 13) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 13) != 0 { + _9 = reader.readInt32() + } var _10: Int32? _10 = reader.readInt32() var _11: Int32? @@ -1096,101 +1698,163 @@ public extension Api { _14 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } var _15: Api.ExportedChatInvite? - if Int(_1!) & Int(1 << 23) != 0 {if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } } + if Int(_1!) & Int(1 << 23) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + } var _16: [Api.BotInfo]? if let _ = reader.readInt32() { _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInfo.self) } var _17: Int64? - if Int(_1!) & Int(1 << 4) != 0 {_17 = reader.readInt64() } + if Int(_1!) & Int(1 << 4) != 0 { + _17 = reader.readInt64() + } var _18: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_18 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _18 = reader.readInt32() + } var _19: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_19 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _19 = reader.readInt32() + } var _20: Api.StickerSet? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.StickerSet - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + } var _21: Int32? - if Int(_1!) & Int(1 << 9) != 0 {_21 = reader.readInt32() } + if Int(_1!) & Int(1 << 9) != 0 { + _21 = reader.readInt32() + } var _22: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_22 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _22 = reader.readInt32() + } var _23: Int64? - if Int(_1!) & Int(1 << 14) != 0 {_23 = reader.readInt64() } + if Int(_1!) & Int(1 << 14) != 0 { + _23 = reader.readInt64() + } var _24: Api.ChannelLocation? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _24 = Api.parse(reader, signature: signature) as? Api.ChannelLocation - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _24 = Api.parse(reader, signature: signature) as? Api.ChannelLocation + } + } var _25: Int32? - if Int(_1!) & Int(1 << 17) != 0 {_25 = reader.readInt32() } + if Int(_1!) & Int(1 << 17) != 0 { + _25 = reader.readInt32() + } var _26: Int32? - if Int(_1!) & Int(1 << 18) != 0 {_26 = reader.readInt32() } + if Int(_1!) & Int(1 << 18) != 0 { + _26 = reader.readInt32() + } var _27: Int32? - if Int(_1!) & Int(1 << 12) != 0 {_27 = reader.readInt32() } + if Int(_1!) & Int(1 << 12) != 0 { + _27 = reader.readInt32() + } var _28: Int32? _28 = reader.readInt32() var _29: Api.InputGroupCall? - if Int(_1!) & Int(1 << 21) != 0 {if let signature = reader.readInt32() { - _29 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } } + if Int(_1!) & Int(1 << 21) != 0 { + if let signature = reader.readInt32() { + _29 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + } var _30: Int32? - if Int(_1!) & Int(1 << 24) != 0 {_30 = reader.readInt32() } + if Int(_1!) & Int(1 << 24) != 0 { + _30 = reader.readInt32() + } var _31: [String]? - if Int(_1!) & Int(1 << 25) != 0 {if let _ = reader.readInt32() { - _31 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } } + if Int(_1!) & Int(1 << 25) != 0 { + if let _ = reader.readInt32() { + _31 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } var _32: Api.Peer? - if Int(_1!) & Int(1 << 26) != 0 {if let signature = reader.readInt32() { - _32 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 26) != 0 { + if let signature = reader.readInt32() { + _32 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _33: String? - if Int(_1!) & Int(1 << 27) != 0 {_33 = parseString(reader) } + if Int(_1!) & Int(1 << 27) != 0 { + _33 = parseString(reader) + } var _34: Int32? - if Int(_1!) & Int(1 << 28) != 0 {_34 = reader.readInt32() } + if Int(_1!) & Int(1 << 28) != 0 { + _34 = reader.readInt32() + } var _35: [Int64]? - if Int(_1!) & Int(1 << 28) != 0 {if let _ = reader.readInt32() { - _35 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 28) != 0 { + if let _ = reader.readInt32() { + _35 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } var _36: Api.Peer? - if Int(_1!) & Int(1 << 29) != 0 {if let signature = reader.readInt32() { - _36 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 29) != 0 { + if let signature = reader.readInt32() { + _36 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _37: Api.ChatReactions? - if Int(_1!) & Int(1 << 30) != 0 {if let signature = reader.readInt32() { - _37 = Api.parse(reader, signature: signature) as? Api.ChatReactions - } } + if Int(_1!) & Int(1 << 30) != 0 { + if let signature = reader.readInt32() { + _37 = Api.parse(reader, signature: signature) as? Api.ChatReactions + } + } var _38: Int32? - if Int(_2!) & Int(1 << 13) != 0 {_38 = reader.readInt32() } + if Int(_2!) & Int(1 << 13) != 0 { + _38 = reader.readInt32() + } var _39: Api.PeerStories? - if Int(_2!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _39 = Api.parse(reader, signature: signature) as? Api.PeerStories - } } + if Int(_2!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _39 = Api.parse(reader, signature: signature) as? Api.PeerStories + } + } var _40: Api.WallPaper? - if Int(_2!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() { - _40 = Api.parse(reader, signature: signature) as? Api.WallPaper - } } + if Int(_2!) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _40 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + } var _41: Int32? - if Int(_2!) & Int(1 << 8) != 0 {_41 = reader.readInt32() } + if Int(_2!) & Int(1 << 8) != 0 { + _41 = reader.readInt32() + } var _42: Int32? - if Int(_2!) & Int(1 << 9) != 0 {_42 = reader.readInt32() } + if Int(_2!) & Int(1 << 9) != 0 { + _42 = reader.readInt32() + } var _43: Api.StickerSet? - if Int(_2!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _43 = Api.parse(reader, signature: signature) as? Api.StickerSet - } } + if Int(_2!) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _43 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + } var _44: Api.BotVerification? - if Int(_2!) & Int(1 << 17) != 0 {if let signature = reader.readInt32() { - _44 = Api.parse(reader, signature: signature) as? Api.BotVerification - } } + if Int(_2!) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _44 = Api.parse(reader, signature: signature) as? Api.BotVerification + } + } var _45: Int32? - if Int(_2!) & Int(1 << 18) != 0 {_45 = reader.readInt32() } + if Int(_2!) & Int(1 << 18) != 0 { + _45 = reader.readInt32() + } var _46: Int64? - if Int(_2!) & Int(1 << 21) != 0 {_46 = reader.readInt64() } + if Int(_2!) & Int(1 << 21) != 0 { + _46 = reader.readInt64() + } var _47: Api.ProfileTab? - if Int(_2!) & Int(1 << 22) != 0 {if let signature = reader.readInt32() { - _47 = Api.parse(reader, signature: signature) as? Api.ProfileTab - } } + if Int(_2!) & Int(1 << 22) != 0 { + if let signature = reader.readInt32() { + _47 = Api.parse(reader, signature: signature) as? Api.ProfileTab + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1239,7 +1903,7 @@ public extension Api { let _c46 = (Int(_2!) & Int(1 << 21) == 0) || _46 != nil let _c47 = (Int(_2!) & Int(1 << 22) == 0) || _47 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 && _c34 && _c35 && _c36 && _c37 && _c38 && _c39 && _c40 && _c41 && _c42 && _c43 && _c44 && _c45 && _c46 && _c47 { - return Api.ChatFull.channelFull(flags: _1!, flags2: _2!, id: _3!, about: _4!, participantsCount: _5, adminsCount: _6, kickedCount: _7, bannedCount: _8, onlineCount: _9, readInboxMaxId: _10!, readOutboxMaxId: _11!, unreadCount: _12!, chatPhoto: _13!, notifySettings: _14!, exportedInvite: _15, botInfo: _16!, migratedFromChatId: _17, migratedFromMaxId: _18, pinnedMsgId: _19, stickerset: _20, availableMinId: _21, folderId: _22, linkedChatId: _23, location: _24, slowmodeSeconds: _25, slowmodeNextSendDate: _26, statsDc: _27, pts: _28!, call: _29, ttlPeriod: _30, pendingSuggestions: _31, groupcallDefaultJoinAs: _32, themeEmoticon: _33, requestsPending: _34, recentRequesters: _35, defaultSendAs: _36, availableReactions: _37, reactionsLimit: _38, stories: _39, wallpaper: _40, boostsApplied: _41, boostsUnrestrict: _42, emojiset: _43, botVerification: _44, stargiftsCount: _45, sendPaidMessagesStars: _46, mainTab: _47) + return Api.ChatFull.channelFull(Cons_channelFull(flags: _1!, flags2: _2!, id: _3!, about: _4!, participantsCount: _5, adminsCount: _6, kickedCount: _7, bannedCount: _8, onlineCount: _9, readInboxMaxId: _10!, readOutboxMaxId: _11!, unreadCount: _12!, chatPhoto: _13!, notifySettings: _14!, exportedInvite: _15, botInfo: _16!, migratedFromChatId: _17, migratedFromMaxId: _18, pinnedMsgId: _19, stickerset: _20, availableMinId: _21, folderId: _22, linkedChatId: _23, location: _24, slowmodeSeconds: _25, slowmodeNextSendDate: _26, statsDc: _27, pts: _28!, call: _29, ttlPeriod: _30, pendingSuggestions: _31, groupcallDefaultJoinAs: _32, themeEmoticon: _33, requestsPending: _34, recentRequesters: _35, defaultSendAs: _36, availableReactions: _37, reactionsLimit: _38, stories: _39, wallpaper: _40, boostsApplied: _41, boostsUnrestrict: _42, emojiset: _43, botVerification: _44, stargiftsCount: _45, sendPaidMessagesStars: _46, mainTab: _47)) } else { return nil @@ -1257,49 +1921,75 @@ public extension Api { _4 = Api.parse(reader, signature: signature) as? Api.ChatParticipants } var _5: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Photo - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Photo + } + } var _6: Api.PeerNotifySettings? if let signature = reader.readInt32() { _6 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } var _7: Api.ExportedChatInvite? - if Int(_1!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } } + if Int(_1!) & Int(1 << 13) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + } var _8: [Api.BotInfo]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInfo.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInfo.self) + } + } var _9: Int32? - if Int(_1!) & Int(1 << 6) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 6) != 0 { + _9 = reader.readInt32() + } var _10: Int32? - if Int(_1!) & Int(1 << 11) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 11) != 0 { + _10 = reader.readInt32() + } var _11: Api.InputGroupCall? - if Int(_1!) & Int(1 << 12) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } } + if Int(_1!) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + } var _12: Int32? - if Int(_1!) & Int(1 << 14) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 14) != 0 { + _12 = reader.readInt32() + } var _13: Api.Peer? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _14: String? - if Int(_1!) & Int(1 << 16) != 0 {_14 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _14 = parseString(reader) + } var _15: Int32? - if Int(_1!) & Int(1 << 17) != 0 {_15 = reader.readInt32() } + if Int(_1!) & Int(1 << 17) != 0 { + _15 = reader.readInt32() + } var _16: [Int64]? - if Int(_1!) & Int(1 << 17) != 0 {if let _ = reader.readInt32() { - _16 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } } + if Int(_1!) & Int(1 << 17) != 0 { + if let _ = reader.readInt32() { + _16 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + } var _17: Api.ChatReactions? - if Int(_1!) & Int(1 << 18) != 0 {if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.ChatReactions - } } + if Int(_1!) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.ChatReactions + } + } var _18: Int32? - if Int(_1!) & Int(1 << 20) != 0 {_18 = reader.readInt32() } + if Int(_1!) & Int(1 << 20) != 0 { + _18 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1319,76 +2009,125 @@ public extension Api { let _c17 = (Int(_1!) & Int(1 << 18) == 0) || _17 != nil let _c18 = (Int(_1!) & Int(1 << 20) == 0) || _18 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 { - return Api.ChatFull.chatFull(flags: _1!, id: _2!, about: _3!, participants: _4!, chatPhoto: _5, notifySettings: _6!, exportedInvite: _7, botInfo: _8, pinnedMsgId: _9, folderId: _10, call: _11, ttlPeriod: _12, groupcallDefaultJoinAs: _13, themeEmoticon: _14, requestsPending: _15, recentRequesters: _16, availableReactions: _17, reactionsLimit: _18) + return Api.ChatFull.chatFull(Cons_chatFull(flags: _1!, id: _2!, about: _3!, participants: _4!, chatPhoto: _5, notifySettings: _6!, exportedInvite: _7, botInfo: _8, pinnedMsgId: _9, folderId: _10, call: _11, ttlPeriod: _12, groupcallDefaultJoinAs: _13, themeEmoticon: _14, requestsPending: _15, recentRequesters: _16, availableReactions: _17, reactionsLimit: _18)) } else { return nil } } - } } public extension Api { indirect enum ChatInvite: TypeConstructorDescription { - case chatInvite(flags: Int32, title: String, about: String?, photo: Api.Photo, participantsCount: Int32, participants: [Api.User]?, color: Int32, subscriptionPricing: Api.StarsSubscriptionPricing?, subscriptionFormId: Int64?, botVerification: Api.BotVerification?) - case chatInviteAlready(chat: Api.Chat) - case chatInvitePeek(chat: Api.Chat, expires: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId, let botVerification): - if boxed { - buffer.appendInt32(1553807106) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - photo.serialize(buffer, true) - serializeInt32(participantsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants!.count)) - for item in participants! { + public class Cons_chatInvite { + public var flags: Int32 + public var title: String + public var about: String? + public var photo: Api.Photo + public var participantsCount: Int32 + public var participants: [Api.User]? + public var color: Int32 + public var subscriptionPricing: Api.StarsSubscriptionPricing? + public var subscriptionFormId: Int64? + public var botVerification: Api.BotVerification? + public init(flags: Int32, title: String, about: String?, photo: Api.Photo, participantsCount: Int32, participants: [Api.User]?, color: Int32, subscriptionPricing: Api.StarsSubscriptionPricing?, subscriptionFormId: Int64?, botVerification: Api.BotVerification?) { + self.flags = flags + self.title = title + self.about = about + self.photo = photo + self.participantsCount = participantsCount + self.participants = participants + self.color = color + self.subscriptionPricing = subscriptionPricing + self.subscriptionFormId = subscriptionFormId + self.botVerification = botVerification + } + } + public class Cons_chatInviteAlready { + public var chat: Api.Chat + public init(chat: Api.Chat) { + self.chat = chat + } + } + public class Cons_chatInvitePeek { + public var chat: Api.Chat + public var expires: Int32 + public init(chat: Api.Chat, expires: Int32) { + self.chat = chat + self.expires = expires + } + } + case chatInvite(Cons_chatInvite) + case chatInviteAlready(Cons_chatInviteAlready) + case chatInvitePeek(Cons_chatInvitePeek) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatInvite(let _data): + if boxed { + buffer.appendInt32(1553807106) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.about!, buffer: buffer, boxed: false) + } + _data.photo.serialize(buffer, true) + serializeInt32(_data.participantsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants!.count)) + for item in _data.participants! { item.serialize(buffer, true) - }} - serializeInt32(color, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 10) != 0 {subscriptionPricing!.serialize(buffer, true)} - if Int(flags) & Int(1 << 12) != 0 {serializeInt64(subscriptionFormId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {botVerification!.serialize(buffer, true)} - break - case .chatInviteAlready(let chat): - if boxed { - buffer.appendInt32(1516793212) } - chat.serialize(buffer, true) - break - case .chatInvitePeek(let chat, let expires): - if boxed { - buffer.appendInt32(1634294960) - } - chat.serialize(buffer, true) - serializeInt32(expires, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatInvite(let flags, let title, let about, let photo, let participantsCount, let participants, let color, let subscriptionPricing, let subscriptionFormId, let botVerification): - return ("chatInvite", [("flags", flags as Any), ("title", title as Any), ("about", about as Any), ("photo", photo as Any), ("participantsCount", participantsCount as Any), ("participants", participants as Any), ("color", color as Any), ("subscriptionPricing", subscriptionPricing as Any), ("subscriptionFormId", subscriptionFormId as Any), ("botVerification", botVerification as Any)]) - case .chatInviteAlready(let chat): - return ("chatInviteAlready", [("chat", chat as Any)]) - case .chatInvitePeek(let chat, let expires): - return ("chatInvitePeek", [("chat", chat as Any), ("expires", expires as Any)]) - } - } - + } + serializeInt32(_data.color, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.subscriptionPricing!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeInt64(_data.subscriptionFormId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + _data.botVerification!.serialize(buffer, true) + } + break + case .chatInviteAlready(let _data): + if boxed { + buffer.appendInt32(1516793212) + } + _data.chat.serialize(buffer, true) + break + case .chatInvitePeek(let _data): + if boxed { + buffer.appendInt32(1634294960) + } + _data.chat.serialize(buffer, true) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatInvite(let _data): + return ("chatInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("about", _data.about as Any), ("photo", _data.photo as Any), ("participantsCount", _data.participantsCount as Any), ("participants", _data.participants as Any), ("color", _data.color as Any), ("subscriptionPricing", _data.subscriptionPricing as Any), ("subscriptionFormId", _data.subscriptionFormId as Any), ("botVerification", _data.botVerification as Any)]) + case .chatInviteAlready(let _data): + return ("chatInviteAlready", [("chat", _data.chat as Any)]) + case .chatInvitePeek(let _data): + return ("chatInvitePeek", [("chat", _data.chat as Any), ("expires", _data.expires as Any)]) + } + } + public static func parse_chatInvite(_ reader: BufferReader) -> ChatInvite? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: String? - if Int(_1!) & Int(1 << 5) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _3 = parseString(reader) + } var _4: Api.Photo? if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.Photo @@ -1396,21 +2135,29 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: [Api.User]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + } var _7: Int32? _7 = reader.readInt32() var _8: Api.StarsSubscriptionPricing? - if Int(_1!) & Int(1 << 10) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing - } } + if Int(_1!) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing + } + } var _9: Int64? - if Int(_1!) & Int(1 << 12) != 0 {_9 = reader.readInt64() } + if Int(_1!) & Int(1 << 12) != 0 { + _9 = reader.readInt64() + } var _10: Api.BotVerification? - if Int(_1!) & Int(1 << 13) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.BotVerification - } } + if Int(_1!) & Int(1 << 13) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.BotVerification + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 5) == 0) || _3 != nil @@ -1422,7 +2169,7 @@ public extension Api { let _c9 = (Int(_1!) & Int(1 << 12) == 0) || _9 != nil let _c10 = (Int(_1!) & Int(1 << 13) == 0) || _10 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.ChatInvite.chatInvite(flags: _1!, title: _2!, about: _3, photo: _4!, participantsCount: _5!, participants: _6, color: _7!, subscriptionPricing: _8, subscriptionFormId: _9, botVerification: _10) + return Api.ChatInvite.chatInvite(Cons_chatInvite(flags: _1!, title: _2!, about: _3, photo: _4!, participantsCount: _5!, participants: _6, color: _7!, subscriptionPricing: _8, subscriptionFormId: _9, botVerification: _10)) } else { return nil @@ -1435,7 +2182,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChatInvite.chatInviteAlready(chat: _1!) + return Api.ChatInvite.chatInviteAlready(Cons_chatInviteAlready(chat: _1!)) } else { return nil @@ -1451,12 +2198,11 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChatInvite.chatInvitePeek(chat: _1!, expires: _2!) + return Api.ChatInvite.chatInvitePeek(Cons_chatInvitePeek(chat: _1!, expires: _2!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index 2b4896c9d6..1cf0af77c4 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -1,12869 +1,13444 @@ public extension Api.functions.account { - static func acceptAuthorization(botId: Int64, scope: String, publicKey: String, valueHashes: [Api.SecureValueHash], credentials: Api.SecureCredentialsEncrypted) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-202552205) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(scope, buffer: buffer, boxed: false) - serializeString(publicKey, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(valueHashes.count)) - for item in valueHashes { - item.serialize(buffer, true) - } - credentials.serialize(buffer, true) - return (FunctionDescription(name: "account.acceptAuthorization", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey)), ("valueHashes", String(describing: valueHashes)), ("credentials", String(describing: credentials))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func cancelPasswordEmail() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1043606090) - - return (FunctionDescription(name: "account.cancelPasswordEmail", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func changeAuthorizationSettings(flags: Int32, hash: Int64, encryptedRequestsDisabled: Api.Bool?, callRequestsDisabled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1089766498) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {encryptedRequestsDisabled!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {callRequestsDisabled!.serialize(buffer, true)} - return (FunctionDescription(name: "account.changeAuthorizationSettings", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash)), ("encryptedRequestsDisabled", String(describing: encryptedRequestsDisabled)), ("callRequestsDisabled", String(describing: callRequestsDisabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func changePhone(phoneNumber: String, phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1891839707) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.changePhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } -} -public extension Api.functions.account { - static func checkUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(655677548) - serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.checkUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func clearRecentEmojiStatuses() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(404757166) - - return (FunctionDescription(name: "account.clearRecentEmojiStatuses", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func confirmPasswordEmail(code: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1881204448) - serializeString(code, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.confirmPasswordEmail", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func confirmPhone(phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1596029123) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.confirmPhone", parameters: [("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func createBusinessChatLink(link: Api.InputBusinessChatLink) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2007898482) - link.serialize(buffer, true) - return (FunctionDescription(name: "account.createBusinessChatLink", parameters: [("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in - let reader = BufferReader(buffer) - var result: Api.BusinessChatLink? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.BusinessChatLink - } - return result - }) - } -} -public extension Api.functions.account { - static func createTheme(flags: Int32, slug: String, title: String, document: Api.InputDocument?, settings: [Api.InputThemeSettings]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1697530880) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(settings!.count)) - for item in settings! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "account.createTheme", parameters: [("flags", String(describing: flags)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in - let reader = BufferReader(buffer) - var result: Api.Theme? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Theme - } - return result - }) - } -} -public extension Api.functions.account { - static func declinePasswordReset() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1284770294) - - return (FunctionDescription(name: "account.declinePasswordReset", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func deleteAccount(flags: Int32, reason: String, password: Api.InputCheckPasswordSRP?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1564422284) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(reason, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {password!.serialize(buffer, true)} - return (FunctionDescription(name: "account.deleteAccount", parameters: [("flags", String(describing: flags)), ("reason", String(describing: reason)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func deleteAutoSaveExceptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1404829728) - - return (FunctionDescription(name: "account.deleteAutoSaveExceptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func deleteBusinessChatLink(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1611085428) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.deleteBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func deletePasskey(id: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-172665281) - serializeString(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.deletePasskey", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func deleteSecureValue(types: [Api.SecureValueType]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1199522741) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(types.count)) - for item in types { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "account.deleteSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func disablePeerConnectedBot(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1581481689) - peer.serialize(buffer, true) - return (FunctionDescription(name: "account.disablePeerConnectedBot", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func editBusinessChatLink(slug: String, link: Api.InputBusinessChatLink) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1942744913) - serializeString(slug, buffer: buffer, boxed: false) - link.serialize(buffer, true) - return (FunctionDescription(name: "account.editBusinessChatLink", parameters: [("slug", String(describing: slug)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in - let reader = BufferReader(buffer) - var result: Api.BusinessChatLink? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.BusinessChatLink - } - return result - }) - } -} -public extension Api.functions.account { - static func finishTakeoutSession(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(489050862) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.finishTakeoutSession", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func getAccountTTL() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(150761757) - - return (FunctionDescription(name: "account.getAccountTTL", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AccountDaysTTL? in - let reader = BufferReader(buffer) - var result: Api.AccountDaysTTL? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AccountDaysTTL - } - return result - }) - } -} -public extension Api.functions.account { - static func getAllSecureValues() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SecureValue]>) { - let buffer = Buffer() - buffer.appendInt32(-1299661699) - - return (FunctionDescription(name: "account.getAllSecureValues", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in - let reader = BufferReader(buffer) - var result: [Api.SecureValue]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) - } - return result - }) - } -} -public extension Api.functions.account { - static func getAuthorizationForm(botId: Int64, scope: String, publicKey: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1456907910) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeString(scope, buffer: buffer, boxed: false) - serializeString(publicKey, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getAuthorizationForm", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AuthorizationForm? in - let reader = BufferReader(buffer) - var result: Api.account.AuthorizationForm? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.AuthorizationForm - } - return result - }) - } -} -public extension Api.functions.account { - static func getAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-484392616) - - return (FunctionDescription(name: "account.getAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Authorizations? in - let reader = BufferReader(buffer) - var result: Api.account.Authorizations? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Authorizations - } - return result - }) - } -} -public extension Api.functions.account { - static func getAutoDownloadSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1457130303) - - return (FunctionDescription(name: "account.getAutoDownloadSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AutoDownloadSettings? in - let reader = BufferReader(buffer) - var result: Api.account.AutoDownloadSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.AutoDownloadSettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getAutoSaveSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1379156774) - - return (FunctionDescription(name: "account.getAutoSaveSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AutoSaveSettings? in - let reader = BufferReader(buffer) - var result: Api.account.AutoSaveSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.AutoSaveSettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getBotBusinessConnection(connectionId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1990746736) - serializeString(connectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getBotBusinessConnection", parameters: [("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.account { - static func getBusinessChatLinks() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1869667809) - - return (FunctionDescription(name: "account.getBusinessChatLinks", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.BusinessChatLinks? in - let reader = BufferReader(buffer) - var result: Api.account.BusinessChatLinks? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.BusinessChatLinks - } - return result - }) - } -} -public extension Api.functions.account { - static func getChannelDefaultEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1999087573) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChannelDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in - let reader = BufferReader(buffer) - var result: Api.account.EmojiStatuses? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses - } - return result - }) - } -} -public extension Api.functions.account { - static func getChannelRestrictedStatusEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(900325589) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChannelRestrictedStatusEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in - let reader = BufferReader(buffer) - var result: Api.EmojiList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiList - } - return result - }) - } -} -public extension Api.functions.account { - static func getChatThemes(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-700916087) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChatThemes", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in - let reader = BufferReader(buffer) - var result: Api.account.Themes? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Themes - } - return result - }) - } -} -public extension Api.functions.account { - static func getCollectibleEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(779830595) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getCollectibleEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in - let reader = BufferReader(buffer) - var result: Api.account.EmojiStatuses? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses - } - return result - }) - } -} -public extension Api.functions.account { - static func getConnectedBots() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1319421967) - - return (FunctionDescription(name: "account.getConnectedBots", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ConnectedBots? in - let reader = BufferReader(buffer) - var result: Api.account.ConnectedBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.ConnectedBots - } - return result - }) - } -} -public extension Api.functions.account { - static func getContactSignUpNotification() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1626880216) - - return (FunctionDescription(name: "account.getContactSignUpNotification", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func getContentSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1952756306) - - return (FunctionDescription(name: "account.getContentSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ContentSettings? in - let reader = BufferReader(buffer) - var result: Api.account.ContentSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.ContentSettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getDefaultBackgroundEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1509246514) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultBackgroundEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in - let reader = BufferReader(buffer) - var result: Api.EmojiList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiList - } - return result - }) - } -} -public extension Api.functions.account { - static func getDefaultEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-696962170) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in - let reader = BufferReader(buffer) - var result: Api.account.EmojiStatuses? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses - } - return result - }) - } -} -public extension Api.functions.account { - static func getDefaultGroupPhotoEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1856479058) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultGroupPhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in - let reader = BufferReader(buffer) - var result: Api.EmojiList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiList - } - return result - }) - } -} -public extension Api.functions.account { - static func getDefaultProfilePhotoEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-495647960) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultProfilePhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in - let reader = BufferReader(buffer) - var result: Api.EmojiList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiList - } - return result - }) - } -} -public extension Api.functions.account { - static func getGlobalPrivacySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-349483786) - - return (FunctionDescription(name: "account.getGlobalPrivacySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.GlobalPrivacySettings? in - let reader = BufferReader(buffer) - var result: Api.GlobalPrivacySettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.GlobalPrivacySettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getMultiWallPapers(wallpapers: [Api.InputWallPaper]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.WallPaper]>) { - let buffer = Buffer() - buffer.appendInt32(1705865692) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(wallpapers.count)) - for item in wallpapers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "account.getMultiWallPapers", parameters: [("wallpapers", String(describing: wallpapers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.WallPaper]? in - let reader = BufferReader(buffer) - var result: [Api.WallPaper]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.WallPaper.self) - } - return result - }) - } -} -public extension Api.functions.account { - static func getNotifyExceptions(flags: Int32, peer: Api.InputNotifyPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1398240377) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {peer!.serialize(buffer, true)} - return (FunctionDescription(name: "account.getNotifyExceptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.account { - static func getNotifySettings(peer: Api.InputNotifyPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(313765169) - peer.serialize(buffer, true) - return (FunctionDescription(name: "account.getNotifySettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.PeerNotifySettings? in - let reader = BufferReader(buffer) - var result: Api.PeerNotifySettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getPaidMessagesRevenue(flags: Int32, parentPeer: Api.InputPeer?, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(431639143) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {parentPeer!.serialize(buffer, true)} - userId.serialize(buffer, true) - return (FunctionDescription(name: "account.getPaidMessagesRevenue", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PaidMessagesRevenue? in - let reader = BufferReader(buffer) - var result: Api.account.PaidMessagesRevenue? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.PaidMessagesRevenue - } - return result - }) - } -} -public extension Api.functions.account { - static func getPasskeys() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-367063982) - - return (FunctionDescription(name: "account.getPasskeys", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Passkeys? in - let reader = BufferReader(buffer) - var result: Api.account.Passkeys? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Passkeys - } - return result - }) - } -} -public extension Api.functions.account { - static func getPassword() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1418342645) - - return (FunctionDescription(name: "account.getPassword", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Password? in - let reader = BufferReader(buffer) - var result: Api.account.Password? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Password - } - return result - }) - } -} -public extension Api.functions.account { - static func getPasswordSettings(password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1663767815) - password.serialize(buffer, true) - return (FunctionDescription(name: "account.getPasswordSettings", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PasswordSettings? in - let reader = BufferReader(buffer) - var result: Api.account.PasswordSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.PasswordSettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getPrivacy(key: Api.InputPrivacyKey) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-623130288) - key.serialize(buffer, true) - return (FunctionDescription(name: "account.getPrivacy", parameters: [("key", String(describing: key))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in - let reader = BufferReader(buffer) - var result: Api.account.PrivacyRules? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.PrivacyRules - } - return result - }) - } -} -public extension Api.functions.account { - static func getReactionsNotifySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(115172684) - - return (FunctionDescription(name: "account.getReactionsNotifySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReactionsNotifySettings? in - let reader = BufferReader(buffer) - var result: Api.ReactionsNotifySettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ReactionsNotifySettings - } - return result - }) - } -} -public extension Api.functions.account { - static func getRecentEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(257392901) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getRecentEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in - let reader = BufferReader(buffer) - var result: Api.account.EmojiStatuses? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses - } - return result - }) - } -} -public extension Api.functions.account { - static func getSavedMusicIds(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-526557265) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getSavedMusicIds", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedMusicIds? in - let reader = BufferReader(buffer) - var result: Api.account.SavedMusicIds? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.SavedMusicIds - } - return result - }) - } -} -public extension Api.functions.account { - static func getSavedRingtones(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-510647672) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getSavedRingtones", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtones? in - let reader = BufferReader(buffer) - var result: Api.account.SavedRingtones? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.SavedRingtones - } - return result - }) - } -} -public extension Api.functions.account { - static func getSecureValue(types: [Api.SecureValueType]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SecureValue]>) { - let buffer = Buffer() - buffer.appendInt32(1936088002) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(types.count)) - for item in types { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "account.getSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in - let reader = BufferReader(buffer) - var result: [Api.SecureValue]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) - } - return result - }) - } -} -public extension Api.functions.account { - static func getTheme(format: String, theme: Api.InputTheme) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(978872812) - serializeString(format, buffer: buffer, boxed: false) - theme.serialize(buffer, true) - return (FunctionDescription(name: "account.getTheme", parameters: [("format", String(describing: format)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in - let reader = BufferReader(buffer) - var result: Api.Theme? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Theme - } - return result - }) - } -} -public extension Api.functions.account { - static func getThemes(format: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1913054296) - serializeString(format, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getThemes", parameters: [("format", String(describing: format)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in - let reader = BufferReader(buffer) - var result: Api.account.Themes? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Themes - } - return result - }) - } -} -public extension Api.functions.account { - static func getTmpPassword(password: Api.InputCheckPasswordSRP, period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1151208273) - password.serialize(buffer, true) - serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getTmpPassword", parameters: [("password", String(describing: password)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.TmpPassword? in - let reader = BufferReader(buffer) - var result: Api.account.TmpPassword? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.TmpPassword - } - return result - }) - } -} -public extension Api.functions.account { - static func getUniqueGiftChatThemes(offset: String, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-466818615) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getUniqueGiftChatThemes", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ChatThemes? in - let reader = BufferReader(buffer) - var result: Api.account.ChatThemes? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.ChatThemes - } - return result - }) - } -} -public extension Api.functions.account { - static func getWallPaper(wallpaper: Api.InputWallPaper) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-57811990) - wallpaper.serialize(buffer, true) - return (FunctionDescription(name: "account.getWallPaper", parameters: [("wallpaper", String(describing: wallpaper))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in - let reader = BufferReader(buffer) - var result: Api.WallPaper? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WallPaper - } - return result - }) - } -} -public extension Api.functions.account { - static func getWallPapers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(127302966) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getWallPapers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WallPapers? in - let reader = BufferReader(buffer) - var result: Api.account.WallPapers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.WallPapers - } - return result - }) - } -} -public extension Api.functions.account { - static func getWebAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(405695855) - - return (FunctionDescription(name: "account.getWebAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WebAuthorizations? in - let reader = BufferReader(buffer) - var result: Api.account.WebAuthorizations? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.WebAuthorizations - } - return result - }) - } -} -public extension Api.functions.account { - static func initPasskeyRegistration() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1117079528) - - return (FunctionDescription(name: "account.initPasskeyRegistration", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PasskeyRegistrationOptions? in - let reader = BufferReader(buffer) - var result: Api.account.PasskeyRegistrationOptions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.PasskeyRegistrationOptions - } - return result - }) - } -} -public extension Api.functions.account { - static func initTakeoutSession(flags: Int32, fileMaxSize: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1896617296) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {serializeInt64(fileMaxSize!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "account.initTakeoutSession", parameters: [("flags", String(describing: flags)), ("fileMaxSize", String(describing: fileMaxSize))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Takeout? in - let reader = BufferReader(buffer) - var result: Api.account.Takeout? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.Takeout - } - return result - }) - } -} -public extension Api.functions.account { - static func installTheme(flags: Int32, theme: Api.InputTheme?, format: String?, baseTheme: Api.BaseTheme?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-953697477) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {theme!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(format!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {baseTheme!.serialize(buffer, true)} - return (FunctionDescription(name: "account.installTheme", parameters: [("flags", String(describing: flags)), ("theme", String(describing: theme)), ("format", String(describing: format)), ("baseTheme", String(describing: baseTheme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func installWallPaper(wallpaper: Api.InputWallPaper, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-18000023) - wallpaper.serialize(buffer, true) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.installWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func invalidateSignInCodes(codes: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-896866118) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(codes.count)) - for item in codes { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "account.invalidateSignInCodes", parameters: [("codes", String(describing: codes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func registerDevice(flags: Int32, tokenType: Int32, token: String, appSandbox: Api.Bool, secret: Buffer, otherUids: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-326762118) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(tokenType, buffer: buffer, boxed: false) - serializeString(token, buffer: buffer, boxed: false) - appSandbox.serialize(buffer, true) - serializeBytes(secret, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherUids.count)) - for item in otherUids { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "account.registerDevice", parameters: [("flags", String(describing: flags)), ("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("appSandbox", String(describing: appSandbox)), ("secret", String(describing: secret)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func registerPasskey(credential: Api.InputPasskeyCredential) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1437867990) - credential.serialize(buffer, true) - return (FunctionDescription(name: "account.registerPasskey", parameters: [("credential", String(describing: credential))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Passkey? in - let reader = BufferReader(buffer) - var result: Api.Passkey? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Passkey - } - return result - }) - } -} -public extension Api.functions.account { - static func reorderUsernames(order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-279966037) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "account.reorderUsernames", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func reportPeer(peer: Api.InputPeer, reason: Api.ReportReason, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-977650298) - peer.serialize(buffer, true) - reason.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.reportPeer", parameters: [("peer", String(describing: peer)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func reportProfilePhoto(peer: Api.InputPeer, photoId: Api.InputPhoto, reason: Api.ReportReason, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-91437323) - peer.serialize(buffer, true) - photoId.serialize(buffer, true) - reason.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.reportProfilePhoto", parameters: [("peer", String(describing: peer)), ("photoId", String(describing: photoId)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resendPasswordEmail() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2055154197) - - return (FunctionDescription(name: "account.resendPasswordEmail", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resetAuthorization(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-545786948) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resetAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resetNotifySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-612493497) - - return (FunctionDescription(name: "account.resetNotifySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resetPassword() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1828139493) - - return (FunctionDescription(name: "account.resetPassword", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ResetPasswordResult? in - let reader = BufferReader(buffer) - var result: Api.account.ResetPasswordResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.ResetPasswordResult - } - return result - }) - } -} -public extension Api.functions.account { - static func resetWallPapers() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1153722364) - - return (FunctionDescription(name: "account.resetWallPapers", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resetWebAuthorization(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(755087855) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resetWebAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resetWebAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1747789204) - - return (FunctionDescription(name: "account.resetWebAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func resolveBusinessChatLink(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1418913262) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resolveBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ResolvedBusinessChatLinks? in - let reader = BufferReader(buffer) - var result: Api.account.ResolvedBusinessChatLinks? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.ResolvedBusinessChatLinks - } - return result - }) - } -} -public extension Api.functions.account { - static func saveAutoDownloadSettings(flags: Int32, settings: Api.AutoDownloadSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1995661875) - serializeInt32(flags, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveAutoDownloadSettings", parameters: [("flags", String(describing: flags)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func saveAutoSaveSettings(flags: Int32, peer: Api.InputPeer?, settings: Api.AutoSaveSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-694451359) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {peer!.serialize(buffer, true)} - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveAutoSaveSettings", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func saveMusic(flags: Int32, id: Api.InputDocument, afterId: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1301859671) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {afterId!.serialize(buffer, true)} - return (FunctionDescription(name: "account.saveMusic", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("afterId", String(describing: afterId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func saveRingtone(id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1038768899) - id.serialize(buffer, true) - unsave.serialize(buffer, true) - return (FunctionDescription(name: "account.saveRingtone", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtone? in - let reader = BufferReader(buffer) - var result: Api.account.SavedRingtone? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.SavedRingtone - } - return result - }) - } -} -public extension Api.functions.account { - static func saveSecureValue(value: Api.InputSecureValue, secureSecretId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1986010339) - value.serialize(buffer, true) - serializeInt64(secureSecretId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.saveSecureValue", parameters: [("value", String(describing: value)), ("secureSecretId", String(describing: secureSecretId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SecureValue? in - let reader = BufferReader(buffer) - var result: Api.SecureValue? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.SecureValue - } - return result - }) - } -} -public extension Api.functions.account { - static func saveTheme(theme: Api.InputTheme, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-229175188) - theme.serialize(buffer, true) - unsave.serialize(buffer, true) - return (FunctionDescription(name: "account.saveTheme", parameters: [("theme", String(describing: theme)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func saveWallPaper(wallpaper: Api.InputWallPaper, unsave: Api.Bool, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1817860919) - wallpaper.serialize(buffer, true) - unsave.serialize(buffer, true) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("unsave", String(describing: unsave)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func sendChangePhoneCode(phoneNumber: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2108208411) - serializeString(phoneNumber, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendChangePhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } -} -public extension Api.functions.account { - static func sendConfirmPhoneCode(hash: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(457157256) - serializeString(hash, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendConfirmPhoneCode", parameters: [("hash", String(describing: hash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } -} -public extension Api.functions.account { - static func sendVerifyEmailCode(purpose: Api.EmailVerifyPurpose, email: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1730136133) - purpose.serialize(buffer, true) - serializeString(email, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.sendVerifyEmailCode", parameters: [("purpose", String(describing: purpose)), ("email", String(describing: email))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SentEmailCode? in - let reader = BufferReader(buffer) - var result: Api.account.SentEmailCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.SentEmailCode - } - return result - }) - } -} -public extension Api.functions.account { - static func sendVerifyPhoneCode(phoneNumber: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1516022023) - serializeString(phoneNumber, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendVerifyPhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } -} -public extension Api.functions.account { - static func setAccountTTL(ttl: Api.AccountDaysTTL) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(608323678) - ttl.serialize(buffer, true) - return (FunctionDescription(name: "account.setAccountTTL", parameters: [("ttl", String(describing: ttl))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func setAuthorizationTTL(authorizationTtlDays: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1081501024) - serializeInt32(authorizationTtlDays, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.setAuthorizationTTL", parameters: [("authorizationTtlDays", String(describing: authorizationTtlDays))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func setContactSignUpNotification(silent: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-806076575) - silent.serialize(buffer, true) - return (FunctionDescription(name: "account.setContactSignUpNotification", parameters: [("silent", String(describing: silent))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func setContentSettings(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1250643605) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.setContentSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func setGlobalPrivacySettings(settings: Api.GlobalPrivacySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(517647042) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.setGlobalPrivacySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.GlobalPrivacySettings? in - let reader = BufferReader(buffer) - var result: Api.GlobalPrivacySettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.GlobalPrivacySettings - } - return result - }) - } -} -public extension Api.functions.account { - static func setMainProfileTab(tab: Api.ProfileTab) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1575909552) - tab.serialize(buffer, true) - return (FunctionDescription(name: "account.setMainProfileTab", parameters: [("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func setPrivacy(key: Api.InputPrivacyKey, rules: [Api.InputPrivacyRule]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-906486552) - key.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(rules.count)) - for item in rules { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "account.setPrivacy", parameters: [("key", String(describing: key)), ("rules", String(describing: rules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in - let reader = BufferReader(buffer) - var result: Api.account.PrivacyRules? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.PrivacyRules - } - return result - }) - } -} -public extension Api.functions.account { - static func setReactionsNotifySettings(settings: Api.ReactionsNotifySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(829220168) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.setReactionsNotifySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReactionsNotifySettings? in - let reader = BufferReader(buffer) - var result: Api.ReactionsNotifySettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ReactionsNotifySettings - } - return result - }) - } -} -public extension Api.functions.account { - static func toggleConnectedBotPaused(peer: Api.InputPeer, paused: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1684934807) - peer.serialize(buffer, true) - paused.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleConnectedBotPaused", parameters: [("peer", String(describing: peer)), ("paused", String(describing: paused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func toggleNoPaidMessagesException(flags: Int32, parentPeer: Api.InputPeer?, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-30483850) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {parentPeer!.serialize(buffer, true)} - userId.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleNoPaidMessagesException", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func toggleSponsoredMessages(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1176919155) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleSponsoredMessages", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func toggleUsername(username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1490465654) - serializeString(username, buffer: buffer, boxed: false) - active.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleUsername", parameters: [("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func unregisterDevice(tokenType: Int32, token: String, otherUids: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1779249670) - serializeInt32(tokenType, buffer: buffer, boxed: false) - serializeString(token, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(otherUids.count)) - for item in otherUids { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "account.unregisterDevice", parameters: [("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBirthday(flags: Int32, birthday: Api.Birthday?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-865203183) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {birthday!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateBirthday", parameters: [("flags", String(describing: flags)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBusinessAwayMessage(flags: Int32, message: Api.InputBusinessAwayMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1570078811) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {message!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateBusinessAwayMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBusinessGreetingMessage(flags: Int32, message: Api.InputBusinessGreetingMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1724755908) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {message!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateBusinessGreetingMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBusinessIntro(flags: Int32, intro: Api.InputBusinessIntro?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1508585420) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {intro!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateBusinessIntro", parameters: [("flags", String(describing: flags)), ("intro", String(describing: intro))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBusinessLocation(flags: Int32, geoPoint: Api.InputGeoPoint?, address: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1637149926) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {geoPoint!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(address!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "account.updateBusinessLocation", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateBusinessWorkHours(flags: Int32, businessWorkHours: Api.BusinessWorkHours?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1258348646) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {businessWorkHours!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateBusinessWorkHours", parameters: [("flags", String(describing: flags)), ("businessWorkHours", String(describing: businessWorkHours))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateColor(flags: Int32, color: Api.PeerColor?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1749885262) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {color!.serialize(buffer, true)} - return (FunctionDescription(name: "account.updateColor", parameters: [("flags", String(describing: flags)), ("color", String(describing: color))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateConnectedBot(flags: Int32, rights: Api.BusinessBotRights?, bot: Api.InputUser, recipients: Api.InputBusinessBotRecipients) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1721797758) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {rights!.serialize(buffer, true)} - bot.serialize(buffer, true) - recipients.serialize(buffer, true) - return (FunctionDescription(name: "account.updateConnectedBot", parameters: [("flags", String(describing: flags)), ("rights", String(describing: rights)), ("bot", String(describing: bot)), ("recipients", String(describing: recipients))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.account { - static func updateDeviceLocked(period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(954152242) - serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.updateDeviceLocked", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateEmojiStatus(emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-70001045) - emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "account.updateEmojiStatus", parameters: [("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateNotifySettings(peer: Api.InputNotifyPeer, settings: Api.InputPeerNotifySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2067899501) - peer.serialize(buffer, true) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.updateNotifySettings", parameters: [("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updatePasswordSettings(password: Api.InputCheckPasswordSRP, newSettings: Api.account.PasswordInputSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1516564433) - password.serialize(buffer, true) - newSettings.serialize(buffer, true) - return (FunctionDescription(name: "account.updatePasswordSettings", parameters: [("password", String(describing: password)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updatePersonalChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-649919008) - channel.serialize(buffer, true) - return (FunctionDescription(name: "account.updatePersonalChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateProfile(flags: Int32, firstName: String?, lastName: String?, about: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2018596725) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(firstName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(lastName!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "account.updateProfile", parameters: [("flags", String(describing: flags)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } -} -public extension Api.functions.account { - static func updateStatus(offline: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1713919532) - offline.serialize(buffer, true) - return (FunctionDescription(name: "account.updateStatus", parameters: [("offline", String(describing: offline))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.account { - static func updateTheme(flags: Int32, format: String, theme: Api.InputTheme, slug: String?, title: String?, document: Api.InputDocument?, settings: [Api.InputThemeSettings]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(737414348) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(format, buffer: buffer, boxed: false) - theme.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(slug!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {document!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(settings!.count)) - for item in settings! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "account.updateTheme", parameters: [("flags", String(describing: flags)), ("format", String(describing: format)), ("theme", String(describing: theme)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in - let reader = BufferReader(buffer) - var result: Api.Theme? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Theme - } - return result - }) - } -} -public extension Api.functions.account { - static func updateUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1040964988) - serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.updateUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } -} -public extension Api.functions.account { - static func uploadRingtone(file: Api.InputFile, fileName: String, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2095414366) - file.serialize(buffer, true) - serializeString(fileName, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.uploadRingtone", parameters: [("file", String(describing: file)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in - let reader = BufferReader(buffer) - var result: Api.Document? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Document - } - return result - }) - } -} -public extension Api.functions.account { - static func uploadTheme(flags: Int32, file: Api.InputFile, thumb: Api.InputFile?, fileName: String, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(473805619) - serializeInt32(flags, buffer: buffer, boxed: false) - file.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {thumb!.serialize(buffer, true)} - serializeString(fileName, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.uploadTheme", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("thumb", String(describing: thumb)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in - let reader = BufferReader(buffer) - var result: Api.Document? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Document - } - return result - }) - } -} -public extension Api.functions.account { - static func uploadWallPaper(flags: Int32, file: Api.InputFile, mimeType: String, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-476410109) - serializeInt32(flags, buffer: buffer, boxed: false) - file.serialize(buffer, true) - serializeString(mimeType, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "account.uploadWallPaper", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("mimeType", String(describing: mimeType)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in - let reader = BufferReader(buffer) - var result: Api.WallPaper? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WallPaper - } - return result - }) - } -} -public extension Api.functions.account { - static func verifyEmail(purpose: Api.EmailVerifyPurpose, verification: Api.EmailVerification) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(53322959) - purpose.serialize(buffer, true) - verification.serialize(buffer, true) - return (FunctionDescription(name: "account.verifyEmail", parameters: [("purpose", String(describing: purpose)), ("verification", String(describing: verification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmailVerified? in - let reader = BufferReader(buffer) - var result: Api.account.EmailVerified? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.account.EmailVerified - } - return result - }) - } -} -public extension Api.functions.account { - static func verifyPhone(phoneNumber: String, phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1305716726) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.verifyPhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func acceptAuthorization(botId: Int64, scope: String, publicKey: String, valueHashes: [Api.SecureValueHash], credentials: Api.SecureCredentialsEncrypted) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-202552205) + serializeInt64(botId, buffer: buffer, boxed: false) + serializeString(scope, buffer: buffer, boxed: false) + serializeString(publicKey, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(valueHashes.count)) + for item in valueHashes { + item.serialize(buffer, true) + } + credentials.serialize(buffer, true) + return (FunctionDescription(name: "account.acceptAuthorization", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey)), ("valueHashes", String(describing: valueHashes)), ("credentials", String(describing: credentials))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func cancelPasswordEmail() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1043606090) + return (FunctionDescription(name: "account.cancelPasswordEmail", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func changeAuthorizationSettings(flags: Int32, hash: Int64, encryptedRequestsDisabled: Api.Bool?, callRequestsDisabled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1089766498) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + encryptedRequestsDisabled!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + callRequestsDisabled!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.changeAuthorizationSettings", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash)), ("encryptedRequestsDisabled", String(describing: encryptedRequestsDisabled)), ("callRequestsDisabled", String(describing: callRequestsDisabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func changePhone(phoneNumber: String, phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1891839707) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeString(phoneCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.changePhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } +} +public extension Api.functions.account { + static func checkUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(655677548) + serializeString(username, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.checkUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func clearRecentEmojiStatuses() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(404757166) + return (FunctionDescription(name: "account.clearRecentEmojiStatuses", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func confirmPasswordEmail(code: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1881204448) + serializeString(code, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.confirmPasswordEmail", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func confirmPhone(phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1596029123) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeString(phoneCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.confirmPhone", parameters: [("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func createBusinessChatLink(link: Api.InputBusinessChatLink) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2007898482) + link.serialize(buffer, true) + return (FunctionDescription(name: "account.createBusinessChatLink", parameters: [("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in + let reader = BufferReader(buffer) + var result: Api.BusinessChatLink? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.BusinessChatLink + } + return result + }) + } +} +public extension Api.functions.account { + static func createTheme(flags: Int32, slug: String, title: String, document: Api.InputDocument?, settings: [Api.InputThemeSettings]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1697530880) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(slug, buffer: buffer, boxed: false) + serializeString(title, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + document!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(settings!.count)) + for item in settings! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "account.createTheme", parameters: [("flags", String(describing: flags)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + let reader = BufferReader(buffer) + var result: Api.Theme? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Theme + } + return result + }) + } +} +public extension Api.functions.account { + static func declinePasswordReset() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1284770294) + return (FunctionDescription(name: "account.declinePasswordReset", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func deleteAccount(flags: Int32, reason: String, password: Api.InputCheckPasswordSRP?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1564422284) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(reason, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + password!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.deleteAccount", parameters: [("flags", String(describing: flags)), ("reason", String(describing: reason)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func deleteAutoSaveExceptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1404829728) + return (FunctionDescription(name: "account.deleteAutoSaveExceptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func deleteBusinessChatLink(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1611085428) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.deleteBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func deletePasskey(id: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-172665281) + serializeString(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.deletePasskey", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func deleteSecureValue(types: [Api.SecureValueType]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1199522741) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(types.count)) + for item in types { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "account.deleteSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func disablePeerConnectedBot(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1581481689) + peer.serialize(buffer, true) + return (FunctionDescription(name: "account.disablePeerConnectedBot", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func editBusinessChatLink(slug: String, link: Api.InputBusinessChatLink) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1942744913) + serializeString(slug, buffer: buffer, boxed: false) + link.serialize(buffer, true) + return (FunctionDescription(name: "account.editBusinessChatLink", parameters: [("slug", String(describing: slug)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in + let reader = BufferReader(buffer) + var result: Api.BusinessChatLink? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.BusinessChatLink + } + return result + }) + } +} +public extension Api.functions.account { + static func finishTakeoutSession(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(489050862) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.finishTakeoutSession", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func getAccountTTL() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(150761757) + return (FunctionDescription(name: "account.getAccountTTL", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AccountDaysTTL? in + let reader = BufferReader(buffer) + var result: Api.AccountDaysTTL? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AccountDaysTTL + } + return result + }) + } +} +public extension Api.functions.account { + static func getAllSecureValues() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SecureValue]>) { + let buffer = Buffer() + buffer.appendInt32(-1299661699) + return (FunctionDescription(name: "account.getAllSecureValues", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in + let reader = BufferReader(buffer) + var result: [Api.SecureValue]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + } + return result + }) + } +} +public extension Api.functions.account { + static func getAuthorizationForm(botId: Int64, scope: String, publicKey: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1456907910) + serializeInt64(botId, buffer: buffer, boxed: false) + serializeString(scope, buffer: buffer, boxed: false) + serializeString(publicKey, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getAuthorizationForm", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AuthorizationForm? in + let reader = BufferReader(buffer) + var result: Api.account.AuthorizationForm? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.AuthorizationForm + } + return result + }) + } +} +public extension Api.functions.account { + static func getAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-484392616) + return (FunctionDescription(name: "account.getAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Authorizations? in + let reader = BufferReader(buffer) + var result: Api.account.Authorizations? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Authorizations + } + return result + }) + } +} +public extension Api.functions.account { + static func getAutoDownloadSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1457130303) + return (FunctionDescription(name: "account.getAutoDownloadSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AutoDownloadSettings? in + let reader = BufferReader(buffer) + var result: Api.account.AutoDownloadSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.AutoDownloadSettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getAutoSaveSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1379156774) + return (FunctionDescription(name: "account.getAutoSaveSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AutoSaveSettings? in + let reader = BufferReader(buffer) + var result: Api.account.AutoSaveSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.AutoSaveSettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getBotBusinessConnection(connectionId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1990746736) + serializeString(connectionId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getBotBusinessConnection", parameters: [("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.account { + static func getBusinessChatLinks() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1869667809) + return (FunctionDescription(name: "account.getBusinessChatLinks", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.BusinessChatLinks? in + let reader = BufferReader(buffer) + var result: Api.account.BusinessChatLinks? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.BusinessChatLinks + } + return result + }) + } +} +public extension Api.functions.account { + static func getChannelDefaultEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1999087573) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getChannelDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + let reader = BufferReader(buffer) + var result: Api.account.EmojiStatuses? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses + } + return result + }) + } +} +public extension Api.functions.account { + static func getChannelRestrictedStatusEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(900325589) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getChannelRestrictedStatusEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + let reader = BufferReader(buffer) + var result: Api.EmojiList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiList + } + return result + }) + } +} +public extension Api.functions.account { + static func getChatThemes(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-700916087) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getChatThemes", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in + let reader = BufferReader(buffer) + var result: Api.account.Themes? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Themes + } + return result + }) + } +} +public extension Api.functions.account { + static func getCollectibleEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(779830595) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getCollectibleEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + let reader = BufferReader(buffer) + var result: Api.account.EmojiStatuses? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses + } + return result + }) + } +} +public extension Api.functions.account { + static func getConnectedBots() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1319421967) + return (FunctionDescription(name: "account.getConnectedBots", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ConnectedBots? in + let reader = BufferReader(buffer) + var result: Api.account.ConnectedBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.ConnectedBots + } + return result + }) + } +} +public extension Api.functions.account { + static func getContactSignUpNotification() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1626880216) + return (FunctionDescription(name: "account.getContactSignUpNotification", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func getContentSettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1952756306) + return (FunctionDescription(name: "account.getContentSettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ContentSettings? in + let reader = BufferReader(buffer) + var result: Api.account.ContentSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.ContentSettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getDefaultBackgroundEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1509246514) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getDefaultBackgroundEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + let reader = BufferReader(buffer) + var result: Api.EmojiList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiList + } + return result + }) + } +} +public extension Api.functions.account { + static func getDefaultEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-696962170) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + let reader = BufferReader(buffer) + var result: Api.account.EmojiStatuses? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses + } + return result + }) + } +} +public extension Api.functions.account { + static func getDefaultGroupPhotoEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1856479058) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getDefaultGroupPhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + let reader = BufferReader(buffer) + var result: Api.EmojiList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiList + } + return result + }) + } +} +public extension Api.functions.account { + static func getDefaultProfilePhotoEmojis(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-495647960) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getDefaultProfilePhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + let reader = BufferReader(buffer) + var result: Api.EmojiList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiList + } + return result + }) + } +} +public extension Api.functions.account { + static func getGlobalPrivacySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-349483786) + return (FunctionDescription(name: "account.getGlobalPrivacySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.GlobalPrivacySettings? in + let reader = BufferReader(buffer) + var result: Api.GlobalPrivacySettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.GlobalPrivacySettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getMultiWallPapers(wallpapers: [Api.InputWallPaper]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.WallPaper]>) { + let buffer = Buffer() + buffer.appendInt32(1705865692) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(wallpapers.count)) + for item in wallpapers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "account.getMultiWallPapers", parameters: [("wallpapers", String(describing: wallpapers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.WallPaper]? in + let reader = BufferReader(buffer) + var result: [Api.WallPaper]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.WallPaper.self) + } + return result + }) + } +} +public extension Api.functions.account { + static func getNotifyExceptions(flags: Int32, peer: Api.InputNotifyPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1398240377) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + peer!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.getNotifyExceptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.account { + static func getNotifySettings(peer: Api.InputNotifyPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(313765169) + peer.serialize(buffer, true) + return (FunctionDescription(name: "account.getNotifySettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.PeerNotifySettings? in + let reader = BufferReader(buffer) + var result: Api.PeerNotifySettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getPaidMessagesRevenue(flags: Int32, parentPeer: Api.InputPeer?, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(431639143) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + parentPeer!.serialize(buffer, true) + } + userId.serialize(buffer, true) + return (FunctionDescription(name: "account.getPaidMessagesRevenue", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PaidMessagesRevenue? in + let reader = BufferReader(buffer) + var result: Api.account.PaidMessagesRevenue? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.PaidMessagesRevenue + } + return result + }) + } +} +public extension Api.functions.account { + static func getPasskeys() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-367063982) + return (FunctionDescription(name: "account.getPasskeys", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Passkeys? in + let reader = BufferReader(buffer) + var result: Api.account.Passkeys? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Passkeys + } + return result + }) + } +} +public extension Api.functions.account { + static func getPassword() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1418342645) + return (FunctionDescription(name: "account.getPassword", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Password? in + let reader = BufferReader(buffer) + var result: Api.account.Password? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Password + } + return result + }) + } +} +public extension Api.functions.account { + static func getPasswordSettings(password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1663767815) + password.serialize(buffer, true) + return (FunctionDescription(name: "account.getPasswordSettings", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PasswordSettings? in + let reader = BufferReader(buffer) + var result: Api.account.PasswordSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.PasswordSettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getPrivacy(key: Api.InputPrivacyKey) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-623130288) + key.serialize(buffer, true) + return (FunctionDescription(name: "account.getPrivacy", parameters: [("key", String(describing: key))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in + let reader = BufferReader(buffer) + var result: Api.account.PrivacyRules? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.PrivacyRules + } + return result + }) + } +} +public extension Api.functions.account { + static func getReactionsNotifySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(115172684) + return (FunctionDescription(name: "account.getReactionsNotifySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReactionsNotifySettings? in + let reader = BufferReader(buffer) + var result: Api.ReactionsNotifySettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ReactionsNotifySettings + } + return result + }) + } +} +public extension Api.functions.account { + static func getRecentEmojiStatuses(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(257392901) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getRecentEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + let reader = BufferReader(buffer) + var result: Api.account.EmojiStatuses? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.EmojiStatuses + } + return result + }) + } +} +public extension Api.functions.account { + static func getSavedMusicIds(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-526557265) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getSavedMusicIds", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedMusicIds? in + let reader = BufferReader(buffer) + var result: Api.account.SavedMusicIds? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.SavedMusicIds + } + return result + }) + } +} +public extension Api.functions.account { + static func getSavedRingtones(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-510647672) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getSavedRingtones", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtones? in + let reader = BufferReader(buffer) + var result: Api.account.SavedRingtones? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.SavedRingtones + } + return result + }) + } +} +public extension Api.functions.account { + static func getSecureValue(types: [Api.SecureValueType]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SecureValue]>) { + let buffer = Buffer() + buffer.appendInt32(1936088002) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(types.count)) + for item in types { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "account.getSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in + let reader = BufferReader(buffer) + var result: [Api.SecureValue]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + } + return result + }) + } +} +public extension Api.functions.account { + static func getTheme(format: String, theme: Api.InputTheme) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(978872812) + serializeString(format, buffer: buffer, boxed: false) + theme.serialize(buffer, true) + return (FunctionDescription(name: "account.getTheme", parameters: [("format", String(describing: format)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + let reader = BufferReader(buffer) + var result: Api.Theme? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Theme + } + return result + }) + } +} +public extension Api.functions.account { + static func getThemes(format: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1913054296) + serializeString(format, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getThemes", parameters: [("format", String(describing: format)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in + let reader = BufferReader(buffer) + var result: Api.account.Themes? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Themes + } + return result + }) + } +} +public extension Api.functions.account { + static func getTmpPassword(password: Api.InputCheckPasswordSRP, period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1151208273) + password.serialize(buffer, true) + serializeInt32(period, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getTmpPassword", parameters: [("password", String(describing: password)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.TmpPassword? in + let reader = BufferReader(buffer) + var result: Api.account.TmpPassword? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.TmpPassword + } + return result + }) + } +} +public extension Api.functions.account { + static func getUniqueGiftChatThemes(offset: String, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-466818615) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getUniqueGiftChatThemes", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ChatThemes? in + let reader = BufferReader(buffer) + var result: Api.account.ChatThemes? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.ChatThemes + } + return result + }) + } +} +public extension Api.functions.account { + static func getWallPaper(wallpaper: Api.InputWallPaper) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-57811990) + wallpaper.serialize(buffer, true) + return (FunctionDescription(name: "account.getWallPaper", parameters: [("wallpaper", String(describing: wallpaper))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in + let reader = BufferReader(buffer) + var result: Api.WallPaper? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WallPaper + } + return result + }) + } +} +public extension Api.functions.account { + static func getWallPapers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(127302966) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getWallPapers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WallPapers? in + let reader = BufferReader(buffer) + var result: Api.account.WallPapers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.WallPapers + } + return result + }) + } +} +public extension Api.functions.account { + static func getWebAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(405695855) + return (FunctionDescription(name: "account.getWebAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WebAuthorizations? in + let reader = BufferReader(buffer) + var result: Api.account.WebAuthorizations? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.WebAuthorizations + } + return result + }) + } +} +public extension Api.functions.account { + static func initPasskeyRegistration() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1117079528) + return (FunctionDescription(name: "account.initPasskeyRegistration", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PasskeyRegistrationOptions? in + let reader = BufferReader(buffer) + var result: Api.account.PasskeyRegistrationOptions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.PasskeyRegistrationOptions + } + return result + }) + } +} +public extension Api.functions.account { + static func initTakeoutSession(flags: Int32, fileMaxSize: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1896617296) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 5) != 0 { + serializeInt64(fileMaxSize!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.initTakeoutSession", parameters: [("flags", String(describing: flags)), ("fileMaxSize", String(describing: fileMaxSize))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Takeout? in + let reader = BufferReader(buffer) + var result: Api.account.Takeout? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.Takeout + } + return result + }) + } +} +public extension Api.functions.account { + static func installTheme(flags: Int32, theme: Api.InputTheme?, format: String?, baseTheme: Api.BaseTheme?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-953697477) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + theme!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(format!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + baseTheme!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.installTheme", parameters: [("flags", String(describing: flags)), ("theme", String(describing: theme)), ("format", String(describing: format)), ("baseTheme", String(describing: baseTheme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func installWallPaper(wallpaper: Api.InputWallPaper, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-18000023) + wallpaper.serialize(buffer, true) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.installWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func invalidateSignInCodes(codes: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-896866118) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(codes.count)) + for item in codes { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.invalidateSignInCodes", parameters: [("codes", String(describing: codes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func registerDevice(flags: Int32, tokenType: Int32, token: String, appSandbox: Api.Bool, secret: Buffer, otherUids: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-326762118) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(tokenType, buffer: buffer, boxed: false) + serializeString(token, buffer: buffer, boxed: false) + appSandbox.serialize(buffer, true) + serializeBytes(secret, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(otherUids.count)) + for item in otherUids { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.registerDevice", parameters: [("flags", String(describing: flags)), ("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("appSandbox", String(describing: appSandbox)), ("secret", String(describing: secret)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func registerPasskey(credential: Api.InputPasskeyCredential) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1437867990) + credential.serialize(buffer, true) + return (FunctionDescription(name: "account.registerPasskey", parameters: [("credential", String(describing: credential))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Passkey? in + let reader = BufferReader(buffer) + var result: Api.Passkey? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Passkey + } + return result + }) + } +} +public extension Api.functions.account { + static func reorderUsernames(order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-279966037) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.reorderUsernames", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func reportPeer(peer: Api.InputPeer, reason: Api.ReportReason, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-977650298) + peer.serialize(buffer, true) + reason.serialize(buffer, true) + serializeString(message, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.reportPeer", parameters: [("peer", String(describing: peer)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func reportProfilePhoto(peer: Api.InputPeer, photoId: Api.InputPhoto, reason: Api.ReportReason, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-91437323) + peer.serialize(buffer, true) + photoId.serialize(buffer, true) + reason.serialize(buffer, true) + serializeString(message, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.reportProfilePhoto", parameters: [("peer", String(describing: peer)), ("photoId", String(describing: photoId)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resendPasswordEmail() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2055154197) + return (FunctionDescription(name: "account.resendPasswordEmail", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resetAuthorization(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-545786948) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.resetAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resetNotifySettings() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-612493497) + return (FunctionDescription(name: "account.resetNotifySettings", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resetPassword() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1828139493) + return (FunctionDescription(name: "account.resetPassword", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ResetPasswordResult? in + let reader = BufferReader(buffer) + var result: Api.account.ResetPasswordResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.ResetPasswordResult + } + return result + }) + } +} +public extension Api.functions.account { + static func resetWallPapers() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1153722364) + return (FunctionDescription(name: "account.resetWallPapers", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resetWebAuthorization(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(755087855) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.resetWebAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resetWebAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1747789204) + return (FunctionDescription(name: "account.resetWebAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func resolveBusinessChatLink(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1418913262) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.resolveBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ResolvedBusinessChatLinks? in + let reader = BufferReader(buffer) + var result: Api.account.ResolvedBusinessChatLinks? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.ResolvedBusinessChatLinks + } + return result + }) + } +} +public extension Api.functions.account { + static func saveAutoDownloadSettings(flags: Int32, settings: Api.AutoDownloadSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1995661875) + serializeInt32(flags, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.saveAutoDownloadSettings", parameters: [("flags", String(describing: flags)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func saveAutoSaveSettings(flags: Int32, peer: Api.InputPeer?, settings: Api.AutoSaveSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-694451359) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + peer!.serialize(buffer, true) + } + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.saveAutoSaveSettings", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func saveMusic(flags: Int32, id: Api.InputDocument, afterId: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1301859671) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + afterId!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.saveMusic", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("afterId", String(describing: afterId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func saveRingtone(id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1038768899) + id.serialize(buffer, true) + unsave.serialize(buffer, true) + return (FunctionDescription(name: "account.saveRingtone", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtone? in + let reader = BufferReader(buffer) + var result: Api.account.SavedRingtone? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.SavedRingtone + } + return result + }) + } +} +public extension Api.functions.account { + static func saveSecureValue(value: Api.InputSecureValue, secureSecretId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1986010339) + value.serialize(buffer, true) + serializeInt64(secureSecretId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.saveSecureValue", parameters: [("value", String(describing: value)), ("secureSecretId", String(describing: secureSecretId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SecureValue? in + let reader = BufferReader(buffer) + var result: Api.SecureValue? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.SecureValue + } + return result + }) + } +} +public extension Api.functions.account { + static func saveTheme(theme: Api.InputTheme, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-229175188) + theme.serialize(buffer, true) + unsave.serialize(buffer, true) + return (FunctionDescription(name: "account.saveTheme", parameters: [("theme", String(describing: theme)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func saveWallPaper(wallpaper: Api.InputWallPaper, unsave: Api.Bool, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1817860919) + wallpaper.serialize(buffer, true) + unsave.serialize(buffer, true) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.saveWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("unsave", String(describing: unsave)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func sendChangePhoneCode(phoneNumber: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2108208411) + serializeString(phoneNumber, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.sendChangePhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } +} +public extension Api.functions.account { + static func sendConfirmPhoneCode(hash: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(457157256) + serializeString(hash, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.sendConfirmPhoneCode", parameters: [("hash", String(describing: hash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } +} +public extension Api.functions.account { + static func sendVerifyEmailCode(purpose: Api.EmailVerifyPurpose, email: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1730136133) + purpose.serialize(buffer, true) + serializeString(email, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.sendVerifyEmailCode", parameters: [("purpose", String(describing: purpose)), ("email", String(describing: email))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SentEmailCode? in + let reader = BufferReader(buffer) + var result: Api.account.SentEmailCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.SentEmailCode + } + return result + }) + } +} +public extension Api.functions.account { + static func sendVerifyPhoneCode(phoneNumber: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1516022023) + serializeString(phoneNumber, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.sendVerifyPhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } +} +public extension Api.functions.account { + static func setAccountTTL(ttl: Api.AccountDaysTTL) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(608323678) + ttl.serialize(buffer, true) + return (FunctionDescription(name: "account.setAccountTTL", parameters: [("ttl", String(describing: ttl))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func setAuthorizationTTL(authorizationTtlDays: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1081501024) + serializeInt32(authorizationTtlDays, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.setAuthorizationTTL", parameters: [("authorizationTtlDays", String(describing: authorizationTtlDays))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func setContactSignUpNotification(silent: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-806076575) + silent.serialize(buffer, true) + return (FunctionDescription(name: "account.setContactSignUpNotification", parameters: [("silent", String(describing: silent))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func setContentSettings(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1250643605) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.setContentSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func setGlobalPrivacySettings(settings: Api.GlobalPrivacySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(517647042) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.setGlobalPrivacySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.GlobalPrivacySettings? in + let reader = BufferReader(buffer) + var result: Api.GlobalPrivacySettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.GlobalPrivacySettings + } + return result + }) + } +} +public extension Api.functions.account { + static func setMainProfileTab(tab: Api.ProfileTab) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1575909552) + tab.serialize(buffer, true) + return (FunctionDescription(name: "account.setMainProfileTab", parameters: [("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func setPrivacy(key: Api.InputPrivacyKey, rules: [Api.InputPrivacyRule]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-906486552) + key.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(rules.count)) + for item in rules { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "account.setPrivacy", parameters: [("key", String(describing: key)), ("rules", String(describing: rules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in + let reader = BufferReader(buffer) + var result: Api.account.PrivacyRules? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.PrivacyRules + } + return result + }) + } +} +public extension Api.functions.account { + static func setReactionsNotifySettings(settings: Api.ReactionsNotifySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(829220168) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.setReactionsNotifySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReactionsNotifySettings? in + let reader = BufferReader(buffer) + var result: Api.ReactionsNotifySettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ReactionsNotifySettings + } + return result + }) + } +} +public extension Api.functions.account { + static func toggleConnectedBotPaused(peer: Api.InputPeer, paused: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1684934807) + peer.serialize(buffer, true) + paused.serialize(buffer, true) + return (FunctionDescription(name: "account.toggleConnectedBotPaused", parameters: [("peer", String(describing: peer)), ("paused", String(describing: paused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func toggleNoPaidMessagesException(flags: Int32, parentPeer: Api.InputPeer?, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-30483850) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + parentPeer!.serialize(buffer, true) + } + userId.serialize(buffer, true) + return (FunctionDescription(name: "account.toggleNoPaidMessagesException", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func toggleSponsoredMessages(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1176919155) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "account.toggleSponsoredMessages", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func toggleUsername(username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1490465654) + serializeString(username, buffer: buffer, boxed: false) + active.serialize(buffer, true) + return (FunctionDescription(name: "account.toggleUsername", parameters: [("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func unregisterDevice(tokenType: Int32, token: String, otherUids: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1779249670) + serializeInt32(tokenType, buffer: buffer, boxed: false) + serializeString(token, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(otherUids.count)) + for item in otherUids { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.unregisterDevice", parameters: [("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBirthday(flags: Int32, birthday: Api.Birthday?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-865203183) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + birthday!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateBirthday", parameters: [("flags", String(describing: flags)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBusinessAwayMessage(flags: Int32, message: Api.InputBusinessAwayMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1570078811) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + message!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateBusinessAwayMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBusinessGreetingMessage(flags: Int32, message: Api.InputBusinessGreetingMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1724755908) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + message!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateBusinessGreetingMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBusinessIntro(flags: Int32, intro: Api.InputBusinessIntro?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1508585420) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + intro!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateBusinessIntro", parameters: [("flags", String(describing: flags)), ("intro", String(describing: intro))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBusinessLocation(flags: Int32, geoPoint: Api.InputGeoPoint?, address: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1637149926) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + geoPoint!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeString(address!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.updateBusinessLocation", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateBusinessWorkHours(flags: Int32, businessWorkHours: Api.BusinessWorkHours?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1258348646) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + businessWorkHours!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateBusinessWorkHours", parameters: [("flags", String(describing: flags)), ("businessWorkHours", String(describing: businessWorkHours))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateColor(flags: Int32, color: Api.PeerColor?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1749885262) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + color!.serialize(buffer, true) + } + return (FunctionDescription(name: "account.updateColor", parameters: [("flags", String(describing: flags)), ("color", String(describing: color))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateConnectedBot(flags: Int32, rights: Api.BusinessBotRights?, bot: Api.InputUser, recipients: Api.InputBusinessBotRecipients) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1721797758) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + rights!.serialize(buffer, true) + } + bot.serialize(buffer, true) + recipients.serialize(buffer, true) + return (FunctionDescription(name: "account.updateConnectedBot", parameters: [("flags", String(describing: flags)), ("rights", String(describing: rights)), ("bot", String(describing: bot)), ("recipients", String(describing: recipients))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.account { + static func updateDeviceLocked(period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(954152242) + serializeInt32(period, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.updateDeviceLocked", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateEmojiStatus(emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-70001045) + emojiStatus.serialize(buffer, true) + return (FunctionDescription(name: "account.updateEmojiStatus", parameters: [("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateNotifySettings(peer: Api.InputNotifyPeer, settings: Api.InputPeerNotifySettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2067899501) + peer.serialize(buffer, true) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.updateNotifySettings", parameters: [("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updatePasswordSettings(password: Api.InputCheckPasswordSRP, newSettings: Api.account.PasswordInputSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1516564433) + password.serialize(buffer, true) + newSettings.serialize(buffer, true) + return (FunctionDescription(name: "account.updatePasswordSettings", parameters: [("password", String(describing: password)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updatePersonalChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-649919008) + channel.serialize(buffer, true) + return (FunctionDescription(name: "account.updatePersonalChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateProfile(flags: Int32, firstName: String?, lastName: String?, about: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2018596725) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(firstName!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(lastName!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(about!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "account.updateProfile", parameters: [("flags", String(describing: flags)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } +} +public extension Api.functions.account { + static func updateStatus(offline: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1713919532) + offline.serialize(buffer, true) + return (FunctionDescription(name: "account.updateStatus", parameters: [("offline", String(describing: offline))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.account { + static func updateTheme(flags: Int32, format: String, theme: Api.InputTheme, slug: String?, title: String?, document: Api.InputDocument?, settings: [Api.InputThemeSettings]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(737414348) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(format, buffer: buffer, boxed: false) + theme.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(slug!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + document!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(settings!.count)) + for item in settings! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "account.updateTheme", parameters: [("flags", String(describing: flags)), ("format", String(describing: format)), ("theme", String(describing: theme)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + let reader = BufferReader(buffer) + var result: Api.Theme? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Theme + } + return result + }) + } +} +public extension Api.functions.account { + static func updateUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1040964988) + serializeString(username, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.updateUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } +} +public extension Api.functions.account { + static func uploadRingtone(file: Api.InputFile, fileName: String, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2095414366) + file.serialize(buffer, true) + serializeString(fileName, buffer: buffer, boxed: false) + serializeString(mimeType, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.uploadRingtone", parameters: [("file", String(describing: file)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + let reader = BufferReader(buffer) + var result: Api.Document? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Document + } + return result + }) + } +} +public extension Api.functions.account { + static func uploadTheme(flags: Int32, file: Api.InputFile, thumb: Api.InputFile?, fileName: String, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(473805619) + serializeInt32(flags, buffer: buffer, boxed: false) + file.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + thumb!.serialize(buffer, true) + } + serializeString(fileName, buffer: buffer, boxed: false) + serializeString(mimeType, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.uploadTheme", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("thumb", String(describing: thumb)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + let reader = BufferReader(buffer) + var result: Api.Document? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Document + } + return result + }) + } +} +public extension Api.functions.account { + static func uploadWallPaper(flags: Int32, file: Api.InputFile, mimeType: String, settings: Api.WallPaperSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-476410109) + serializeInt32(flags, buffer: buffer, boxed: false) + file.serialize(buffer, true) + serializeString(mimeType, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "account.uploadWallPaper", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("mimeType", String(describing: mimeType)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in + let reader = BufferReader(buffer) + var result: Api.WallPaper? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WallPaper + } + return result + }) + } +} +public extension Api.functions.account { + static func verifyEmail(purpose: Api.EmailVerifyPurpose, verification: Api.EmailVerification) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(53322959) + purpose.serialize(buffer, true) + verification.serialize(buffer, true) + return (FunctionDescription(name: "account.verifyEmail", parameters: [("purpose", String(describing: purpose)), ("verification", String(describing: verification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmailVerified? in + let reader = BufferReader(buffer) + var result: Api.account.EmailVerified? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.EmailVerified + } + return result + }) + } +} +public extension Api.functions.account { + static func verifyPhone(phoneNumber: String, phoneCodeHash: String, phoneCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1305716726) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeString(phoneCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.verifyPhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func acceptLoginToken(token: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-392909491) - serializeBytes(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.acceptLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Authorization? in - let reader = BufferReader(buffer) - var result: Api.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Authorization - } - return result - }) - } + static func acceptLoginToken(token: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-392909491) + serializeBytes(token, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.acceptLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Authorization? in + let reader = BufferReader(buffer) + var result: Api.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func bindTempAuthKey(permAuthKeyId: Int64, nonce: Int64, expiresAt: Int32, encryptedMessage: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-841733627) - serializeInt64(permAuthKeyId, buffer: buffer, boxed: false) - serializeInt64(nonce, buffer: buffer, boxed: false) - serializeInt32(expiresAt, buffer: buffer, boxed: false) - serializeBytes(encryptedMessage, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.bindTempAuthKey", parameters: [("permAuthKeyId", String(describing: permAuthKeyId)), ("nonce", String(describing: nonce)), ("expiresAt", String(describing: expiresAt)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func bindTempAuthKey(permAuthKeyId: Int64, nonce: Int64, expiresAt: Int32, encryptedMessage: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-841733627) + serializeInt64(permAuthKeyId, buffer: buffer, boxed: false) + serializeInt64(nonce, buffer: buffer, boxed: false) + serializeInt32(expiresAt, buffer: buffer, boxed: false) + serializeBytes(encryptedMessage, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.bindTempAuthKey", parameters: [("permAuthKeyId", String(describing: permAuthKeyId)), ("nonce", String(describing: nonce)), ("expiresAt", String(describing: expiresAt)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func cancelCode(phoneNumber: String, phoneCodeHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(520357240) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.cancelCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func cancelCode(phoneNumber: String, phoneCodeHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(520357240) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.cancelCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func checkPaidAuth(phoneNumber: String, phoneCodeHash: String, formId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1457889180) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeInt64(formId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.checkPaidAuth", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("formId", String(describing: formId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } + static func checkPaidAuth(phoneNumber: String, phoneCodeHash: String, formId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1457889180) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeInt64(formId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.checkPaidAuth", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("formId", String(describing: formId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } } public extension Api.functions.auth { - static func checkPassword(password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-779399914) - password.serialize(buffer, true) - return (FunctionDescription(name: "auth.checkPassword", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func checkPassword(password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-779399914) + password.serialize(buffer, true) + return (FunctionDescription(name: "auth.checkPassword", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func checkRecoveryPassword(code: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(221691769) - serializeString(code, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.checkRecoveryPassword", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func checkRecoveryPassword(code: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(221691769) + serializeString(code, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.checkRecoveryPassword", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func dropTempAuthKeys(exceptAuthKeys: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1907842680) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(exceptAuthKeys.count)) - for item in exceptAuthKeys { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "auth.dropTempAuthKeys", parameters: [("exceptAuthKeys", String(describing: exceptAuthKeys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func dropTempAuthKeys(exceptAuthKeys: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1907842680) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(exceptAuthKeys.count)) + for item in exceptAuthKeys { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "auth.dropTempAuthKeys", parameters: [("exceptAuthKeys", String(describing: exceptAuthKeys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func exportAuthorization(dcId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-440401971) - serializeInt32(dcId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.exportAuthorization", parameters: [("dcId", String(describing: dcId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.ExportedAuthorization? in - let reader = BufferReader(buffer) - var result: Api.auth.ExportedAuthorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.ExportedAuthorization - } - return result - }) - } + static func exportAuthorization(dcId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-440401971) + serializeInt32(dcId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.exportAuthorization", parameters: [("dcId", String(describing: dcId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.ExportedAuthorization? in + let reader = BufferReader(buffer) + var result: Api.auth.ExportedAuthorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.ExportedAuthorization + } + return result + }) + } } public extension Api.functions.auth { - static func exportLoginToken(apiId: Int32, apiHash: String, exceptIds: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1210022402) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(apiHash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(exceptIds.count)) - for item in exceptIds { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "auth.exportLoginToken", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("exceptIds", String(describing: exceptIds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in - let reader = BufferReader(buffer) - var result: Api.auth.LoginToken? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.LoginToken - } - return result - }) - } + static func exportLoginToken(apiId: Int32, apiHash: String, exceptIds: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1210022402) + serializeInt32(apiId, buffer: buffer, boxed: false) + serializeString(apiHash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(exceptIds.count)) + for item in exceptIds { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "auth.exportLoginToken", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("exceptIds", String(describing: exceptIds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in + let reader = BufferReader(buffer) + var result: Api.auth.LoginToken? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.LoginToken + } + return result + }) + } } public extension Api.functions.auth { - static func finishPasskeyLogin(flags: Int32, credential: Api.InputPasskeyCredential, fromDcId: Int32?, fromAuthKeyId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1739084537) - serializeInt32(flags, buffer: buffer, boxed: false) - credential.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(fromDcId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(fromAuthKeyId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "auth.finishPasskeyLogin", parameters: [("flags", String(describing: flags)), ("credential", String(describing: credential)), ("fromDcId", String(describing: fromDcId)), ("fromAuthKeyId", String(describing: fromAuthKeyId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func finishPasskeyLogin(flags: Int32, credential: Api.InputPasskeyCredential, fromDcId: Int32?, fromAuthKeyId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1739084537) + serializeInt32(flags, buffer: buffer, boxed: false) + credential.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(fromDcId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(fromAuthKeyId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "auth.finishPasskeyLogin", parameters: [("flags", String(describing: flags)), ("credential", String(describing: credential)), ("fromDcId", String(describing: fromDcId)), ("fromAuthKeyId", String(describing: fromAuthKeyId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func importAuthorization(id: Int64, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1518699091) - serializeInt64(id, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importAuthorization", parameters: [("id", String(describing: id)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func importAuthorization(id: Int64, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1518699091) + serializeInt64(id, buffer: buffer, boxed: false) + serializeBytes(bytes, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.importAuthorization", parameters: [("id", String(describing: id)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func importBotAuthorization(flags: Int32, apiId: Int32, apiHash: String, botAuthToken: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1738800940) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(apiHash, buffer: buffer, boxed: false) - serializeString(botAuthToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importBotAuthorization", parameters: [("flags", String(describing: flags)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("botAuthToken", String(describing: botAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func importBotAuthorization(flags: Int32, apiId: Int32, apiHash: String, botAuthToken: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1738800940) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(apiId, buffer: buffer, boxed: false) + serializeString(apiHash, buffer: buffer, boxed: false) + serializeString(botAuthToken, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.importBotAuthorization", parameters: [("flags", String(describing: flags)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("botAuthToken", String(describing: botAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func importLoginToken(token: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1783866140) - serializeBytes(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in - let reader = BufferReader(buffer) - var result: Api.auth.LoginToken? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.LoginToken - } - return result - }) - } + static func importLoginToken(token: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1783866140) + serializeBytes(token, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.importLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in + let reader = BufferReader(buffer) + var result: Api.auth.LoginToken? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.LoginToken + } + return result + }) + } } public extension Api.functions.auth { - static func importWebTokenAuthorization(apiId: Int32, apiHash: String, webAuthToken: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(767062953) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(apiHash, buffer: buffer, boxed: false) - serializeString(webAuthToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importWebTokenAuthorization", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("webAuthToken", String(describing: webAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func importWebTokenAuthorization(apiId: Int32, apiHash: String, webAuthToken: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(767062953) + serializeInt32(apiId, buffer: buffer, boxed: false) + serializeString(apiHash, buffer: buffer, boxed: false) + serializeString(webAuthToken, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.importWebTokenAuthorization", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("webAuthToken", String(describing: webAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func initPasskeyLogin(apiId: Int32, apiHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1368051895) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(apiHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.initPasskeyLogin", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.PasskeyLoginOptions? in - let reader = BufferReader(buffer) - var result: Api.auth.PasskeyLoginOptions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.PasskeyLoginOptions - } - return result - }) - } + static func initPasskeyLogin(apiId: Int32, apiHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1368051895) + serializeInt32(apiId, buffer: buffer, boxed: false) + serializeString(apiHash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.initPasskeyLogin", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.PasskeyLoginOptions? in + let reader = BufferReader(buffer) + var result: Api.auth.PasskeyLoginOptions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.PasskeyLoginOptions + } + return result + }) + } } public extension Api.functions.auth { - static func logOut() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1047706137) - - return (FunctionDescription(name: "auth.logOut", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoggedOut? in - let reader = BufferReader(buffer) - var result: Api.auth.LoggedOut? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.LoggedOut - } - return result - }) - } + static func logOut() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1047706137) + return (FunctionDescription(name: "auth.logOut", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoggedOut? in + let reader = BufferReader(buffer) + var result: Api.auth.LoggedOut? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.LoggedOut + } + return result + }) + } } public extension Api.functions.auth { - static func recoverPassword(flags: Int32, code: String, newSettings: Api.account.PasswordInputSettings?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(923364464) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(code, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {newSettings!.serialize(buffer, true)} - return (FunctionDescription(name: "auth.recoverPassword", parameters: [("flags", String(describing: flags)), ("code", String(describing: code)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func recoverPassword(flags: Int32, code: String, newSettings: Api.account.PasswordInputSettings?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(923364464) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(code, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + newSettings!.serialize(buffer, true) + } + return (FunctionDescription(name: "auth.recoverPassword", parameters: [("flags", String(describing: flags)), ("code", String(describing: code)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func reportMissingCode(phoneNumber: String, phoneCodeHash: String, mnc: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-878841866) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(mnc, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.reportMissingCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("mnc", String(describing: mnc))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reportMissingCode(phoneNumber: String, phoneCodeHash: String, mnc: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-878841866) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeString(mnc, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.reportMissingCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("mnc", String(describing: mnc))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func requestFirebaseSms(flags: Int32, phoneNumber: String, phoneCodeHash: String, safetyNetToken: String?, playIntegrityToken: String?, iosPushSecret: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1908857314) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(safetyNetToken!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(playIntegrityToken!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(iosPushSecret!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "auth.requestFirebaseSms", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("safetyNetToken", String(describing: safetyNetToken)), ("playIntegrityToken", String(describing: playIntegrityToken)), ("iosPushSecret", String(describing: iosPushSecret))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func requestFirebaseSms(flags: Int32, phoneNumber: String, phoneCodeHash: String, safetyNetToken: String?, playIntegrityToken: String?, iosPushSecret: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1908857314) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(safetyNetToken!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(playIntegrityToken!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(iosPushSecret!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "auth.requestFirebaseSms", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("safetyNetToken", String(describing: safetyNetToken)), ("playIntegrityToken", String(describing: playIntegrityToken)), ("iosPushSecret", String(describing: iosPushSecret))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func requestPasswordRecovery() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-661144474) - - return (FunctionDescription(name: "auth.requestPasswordRecovery", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.PasswordRecovery? in - let reader = BufferReader(buffer) - var result: Api.auth.PasswordRecovery? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.PasswordRecovery - } - return result - }) - } + static func requestPasswordRecovery() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-661144474) + return (FunctionDescription(name: "auth.requestPasswordRecovery", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.PasswordRecovery? in + let reader = BufferReader(buffer) + var result: Api.auth.PasswordRecovery? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.PasswordRecovery + } + return result + }) + } } public extension Api.functions.auth { - static func resendCode(flags: Int32, phoneNumber: String, phoneCodeHash: String, reason: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-890997469) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(reason!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "auth.resendCode", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("reason", String(describing: reason))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } + static func resendCode(flags: Int32, phoneNumber: String, phoneCodeHash: String, reason: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-890997469) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(reason!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "auth.resendCode", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("reason", String(describing: reason))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } } public extension Api.functions.auth { - static func resetAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1616179942) - - return (FunctionDescription(name: "auth.resetAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func resetAuthorizations() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1616179942) + return (FunctionDescription(name: "auth.resetAuthorizations", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.auth { - static func resetLoginEmail(phoneNumber: String, phoneCodeHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2123760019) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.resetLoginEmail", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } + static func resetLoginEmail(phoneNumber: String, phoneCodeHash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2123760019) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.resetLoginEmail", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } } public extension Api.functions.auth { - static func sendCode(phoneNumber: String, apiId: Int32, apiHash: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1502141361) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeInt32(apiId, buffer: buffer, boxed: false) - serializeString(apiHash, buffer: buffer, boxed: false) - settings.serialize(buffer, true) - return (FunctionDescription(name: "auth.sendCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in - let reader = BufferReader(buffer) - var result: Api.auth.SentCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - return result - }) - } + static func sendCode(phoneNumber: String, apiId: Int32, apiHash: String, settings: Api.CodeSettings) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1502141361) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeInt32(apiId, buffer: buffer, boxed: false) + serializeString(apiHash, buffer: buffer, boxed: false) + settings.serialize(buffer, true) + return (FunctionDescription(name: "auth.sendCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + let reader = BufferReader(buffer) + var result: Api.auth.SentCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + return result + }) + } } public extension Api.functions.auth { - static func signIn(flags: Int32, phoneNumber: String, phoneCodeHash: String, phoneCode: String?, emailVerification: Api.EmailVerification?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1923962543) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(phoneCode!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {emailVerification!.serialize(buffer, true)} - return (FunctionDescription(name: "auth.signIn", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode)), ("emailVerification", String(describing: emailVerification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func signIn(flags: Int32, phoneNumber: String, phoneCodeHash: String, phoneCode: String?, emailVerification: Api.EmailVerification?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1923962543) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(phoneCode!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + emailVerification!.serialize(buffer, true) + } + return (FunctionDescription(name: "auth.signIn", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode)), ("emailVerification", String(describing: emailVerification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.auth { - static func signUp(flags: Int32, phoneNumber: String, phoneCodeHash: String, firstName: String, lastName: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1429752041) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.signUp", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in - let reader = BufferReader(buffer) - var result: Api.auth.Authorization? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } - return result - }) - } + static func signUp(flags: Int32, phoneNumber: String, phoneCodeHash: String, firstName: String, lastName: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1429752041) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(phoneNumber, buffer: buffer, boxed: false) + serializeString(phoneCodeHash, buffer: buffer, boxed: false) + serializeString(firstName, buffer: buffer, boxed: false) + serializeString(lastName, buffer: buffer, boxed: false) + return (FunctionDescription(name: "auth.signUp", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + let reader = BufferReader(buffer) + var result: Api.auth.Authorization? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + return result + }) + } } public extension Api.functions.bots { - static func addPreviewMedia(bot: Api.InputUser, langCode: String, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(397326170) - bot.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - media.serialize(buffer, true) - return (FunctionDescription(name: "bots.addPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in - let reader = BufferReader(buffer) - var result: Api.BotPreviewMedia? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.BotPreviewMedia - } - return result - }) - } + static func addPreviewMedia(bot: Api.InputUser, langCode: String, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(397326170) + bot.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + media.serialize(buffer, true) + return (FunctionDescription(name: "bots.addPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in + let reader = BufferReader(buffer) + var result: Api.BotPreviewMedia? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.BotPreviewMedia + } + return result + }) + } } public extension Api.functions.bots { - static func allowSendMessage(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-248323089) - bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.allowSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func allowSendMessage(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-248323089) + bot.serialize(buffer, true) + return (FunctionDescription(name: "bots.allowSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.bots { - static func answerWebhookJSONQuery(queryId: Int64, data: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-434028723) - serializeInt64(queryId, buffer: buffer, boxed: false) - data.serialize(buffer, true) - return (FunctionDescription(name: "bots.answerWebhookJSONQuery", parameters: [("queryId", String(describing: queryId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func answerWebhookJSONQuery(queryId: Int64, data: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-434028723) + serializeInt64(queryId, buffer: buffer, boxed: false) + data.serialize(buffer, true) + return (FunctionDescription(name: "bots.answerWebhookJSONQuery", parameters: [("queryId", String(describing: queryId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func canSendMessage(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(324662502) - bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.canSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func canSendMessage(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(324662502) + bot.serialize(buffer, true) + return (FunctionDescription(name: "bots.canSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func checkDownloadFileParams(bot: Api.InputUser, fileName: String, url: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1342666121) - bot.serialize(buffer, true) - serializeString(fileName, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.checkDownloadFileParams", parameters: [("bot", String(describing: bot)), ("fileName", String(describing: fileName)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func checkDownloadFileParams(bot: Api.InputUser, fileName: String, url: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1342666121) + bot.serialize(buffer, true) + serializeString(fileName, buffer: buffer, boxed: false) + serializeString(url, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.checkDownloadFileParams", parameters: [("bot", String(describing: bot)), ("fileName", String(describing: fileName)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func deletePreviewMedia(bot: Api.InputUser, langCode: String, media: [Api.InputMedia]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(755054003) - bot.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(media.count)) - for item in media { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "bots.deletePreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deletePreviewMedia(bot: Api.InputUser, langCode: String, media: [Api.InputMedia]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(755054003) + bot.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(media.count)) + for item in media { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "bots.deletePreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func editPreviewMedia(bot: Api.InputUser, langCode: String, media: Api.InputMedia, newMedia: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2061148049) - bot.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - media.serialize(buffer, true) - newMedia.serialize(buffer, true) - return (FunctionDescription(name: "bots.editPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media)), ("newMedia", String(describing: newMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in - let reader = BufferReader(buffer) - var result: Api.BotPreviewMedia? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.BotPreviewMedia - } - return result - }) - } + static func editPreviewMedia(bot: Api.InputUser, langCode: String, media: Api.InputMedia, newMedia: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2061148049) + bot.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + media.serialize(buffer, true) + newMedia.serialize(buffer, true) + return (FunctionDescription(name: "bots.editPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media)), ("newMedia", String(describing: newMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in + let reader = BufferReader(buffer) + var result: Api.BotPreviewMedia? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.BotPreviewMedia + } + return result + }) + } } public extension Api.functions.bots { - static func getAdminedBots() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) { - let buffer = Buffer() - buffer.appendInt32(-1334764157) - - return (FunctionDescription(name: "bots.getAdminedBots", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.User]? in - let reader = BufferReader(buffer) - var result: [Api.User]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - return result - }) - } + static func getAdminedBots() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) { + let buffer = Buffer() + buffer.appendInt32(-1334764157) + return (FunctionDescription(name: "bots.getAdminedBots", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.User]? in + let reader = BufferReader(buffer) + var result: [Api.User]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + return result + }) + } } public extension Api.functions.bots { - static func getBotCommands(scope: Api.BotCommandScope, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.BotCommand]>) { - let buffer = Buffer() - buffer.appendInt32(-481554986) - scope.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotCommand]? in - let reader = BufferReader(buffer) - var result: [Api.BotCommand]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) - } - return result - }) - } + static func getBotCommands(scope: Api.BotCommandScope, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.BotCommand]>) { + let buffer = Buffer() + buffer.appendInt32(-481554986) + scope.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotCommand]? in + let reader = BufferReader(buffer) + var result: [Api.BotCommand]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) + } + return result + }) + } } public extension Api.functions.bots { - static func getBotInfo(flags: Int32, bot: Api.InputUser?, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-589753091) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {bot!.serialize(buffer, true)} - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.BotInfo? in - let reader = BufferReader(buffer) - var result: Api.bots.BotInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.BotInfo - } - return result - }) - } + static func getBotInfo(flags: Int32, bot: Api.InputUser?, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-589753091) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + bot!.serialize(buffer, true) + } + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.BotInfo? in + let reader = BufferReader(buffer) + var result: Api.bots.BotInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.BotInfo + } + return result + }) + } } public extension Api.functions.bots { - static func getBotMenuButton(userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1671369944) - userId.serialize(buffer, true) - return (FunctionDescription(name: "bots.getBotMenuButton", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotMenuButton? in - let reader = BufferReader(buffer) - var result: Api.BotMenuButton? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.BotMenuButton - } - return result - }) - } + static func getBotMenuButton(userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1671369944) + userId.serialize(buffer, true) + return (FunctionDescription(name: "bots.getBotMenuButton", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotMenuButton? in + let reader = BufferReader(buffer) + var result: Api.BotMenuButton? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.BotMenuButton + } + return result + }) + } } public extension Api.functions.bots { - static func getBotRecommendations(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1581840363) - bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.getBotRecommendations", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.Users? in - let reader = BufferReader(buffer) - var result: Api.users.Users? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.users.Users - } - return result - }) - } + static func getBotRecommendations(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1581840363) + bot.serialize(buffer, true) + return (FunctionDescription(name: "bots.getBotRecommendations", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.Users? in + let reader = BufferReader(buffer) + var result: Api.users.Users? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.users.Users + } + return result + }) + } } public extension Api.functions.bots { - static func getPopularAppBots(offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1034878574) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getPopularAppBots", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PopularAppBots? in - let reader = BufferReader(buffer) - var result: Api.bots.PopularAppBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.PopularAppBots - } - return result - }) - } + static func getPopularAppBots(offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1034878574) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getPopularAppBots", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PopularAppBots? in + let reader = BufferReader(buffer) + var result: Api.bots.PopularAppBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.PopularAppBots + } + return result + }) + } } public extension Api.functions.bots { - static func getPreviewInfo(bot: Api.InputUser, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1111143341) - bot.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getPreviewInfo", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PreviewInfo? in - let reader = BufferReader(buffer) - var result: Api.bots.PreviewInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.PreviewInfo - } - return result - }) - } + static func getPreviewInfo(bot: Api.InputUser, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1111143341) + bot.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getPreviewInfo", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PreviewInfo? in + let reader = BufferReader(buffer) + var result: Api.bots.PreviewInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.PreviewInfo + } + return result + }) + } } public extension Api.functions.bots { - static func getPreviewMedias(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.BotPreviewMedia]>) { - let buffer = Buffer() - buffer.appendInt32(-1566222003) - bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.getPreviewMedias", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotPreviewMedia]? in - let reader = BufferReader(buffer) - var result: [Api.BotPreviewMedia]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotPreviewMedia.self) - } - return result - }) - } + static func getPreviewMedias(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.BotPreviewMedia]>) { + let buffer = Buffer() + buffer.appendInt32(-1566222003) + bot.serialize(buffer, true) + return (FunctionDescription(name: "bots.getPreviewMedias", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotPreviewMedia]? in + let reader = BufferReader(buffer) + var result: [Api.BotPreviewMedia]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotPreviewMedia.self) + } + return result + }) + } } public extension Api.functions.bots { - static func invokeWebViewCustomMethod(bot: Api.InputUser, customMethod: String, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(142591463) - bot.serialize(buffer, true) - serializeString(customMethod, buffer: buffer, boxed: false) - params.serialize(buffer, true) - return (FunctionDescription(name: "bots.invokeWebViewCustomMethod", parameters: [("bot", String(describing: bot)), ("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in - let reader = BufferReader(buffer) - var result: Api.DataJSON? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.DataJSON - } - return result - }) - } + static func invokeWebViewCustomMethod(bot: Api.InputUser, customMethod: String, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(142591463) + bot.serialize(buffer, true) + serializeString(customMethod, buffer: buffer, boxed: false) + params.serialize(buffer, true) + return (FunctionDescription(name: "bots.invokeWebViewCustomMethod", parameters: [("bot", String(describing: bot)), ("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in + let reader = BufferReader(buffer) + var result: Api.DataJSON? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.DataJSON + } + return result + }) + } } public extension Api.functions.bots { - static func reorderPreviewMedias(bot: Api.InputUser, langCode: String, order: [Api.InputMedia]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1238895702) - bot.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "bots.reorderPreviewMedias", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reorderPreviewMedias(bot: Api.InputUser, langCode: String, order: [Api.InputMedia]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1238895702) + bot.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "bots.reorderPreviewMedias", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func reorderUsernames(bot: Api.InputUser, order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1760972350) - bot.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "bots.reorderUsernames", parameters: [("bot", String(describing: bot)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reorderUsernames(bot: Api.InputUser, order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1760972350) + bot.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "bots.reorderUsernames", parameters: [("bot", String(describing: bot)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func resetBotCommands(scope: Api.BotCommandScope, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1032708345) - scope.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.resetBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func resetBotCommands(scope: Api.BotCommandScope, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1032708345) + scope.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.resetBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func sendCustomRequest(customMethod: String, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1440257555) - serializeString(customMethod, buffer: buffer, boxed: false) - params.serialize(buffer, true) - return (FunctionDescription(name: "bots.sendCustomRequest", parameters: [("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in - let reader = BufferReader(buffer) - var result: Api.DataJSON? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.DataJSON - } - return result - }) - } + static func sendCustomRequest(customMethod: String, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1440257555) + serializeString(customMethod, buffer: buffer, boxed: false) + params.serialize(buffer, true) + return (FunctionDescription(name: "bots.sendCustomRequest", parameters: [("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in + let reader = BufferReader(buffer) + var result: Api.DataJSON? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.DataJSON + } + return result + }) + } } public extension Api.functions.bots { - static func setBotBroadcastDefaultAdminRights(adminRights: Api.ChatAdminRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2021942497) - adminRights.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotBroadcastDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotBroadcastDefaultAdminRights(adminRights: Api.ChatAdminRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2021942497) + adminRights.serialize(buffer, true) + return (FunctionDescription(name: "bots.setBotBroadcastDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func setBotCommands(scope: Api.BotCommandScope, langCode: String, commands: [Api.BotCommand]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(85399130) - scope.serialize(buffer, true) - serializeString(langCode, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(commands.count)) - for item in commands { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "bots.setBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode)), ("commands", String(describing: commands))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotCommands(scope: Api.BotCommandScope, langCode: String, commands: [Api.BotCommand]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(85399130) + scope.serialize(buffer, true) + serializeString(langCode, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(commands.count)) + for item in commands { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "bots.setBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode)), ("commands", String(describing: commands))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func setBotGroupDefaultAdminRights(adminRights: Api.ChatAdminRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1839281686) - adminRights.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotGroupDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotGroupDefaultAdminRights(adminRights: Api.ChatAdminRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1839281686) + adminRights.serialize(buffer, true) + return (FunctionDescription(name: "bots.setBotGroupDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func setBotInfo(flags: Int32, bot: Api.InputUser?, langCode: String, name: String?, about: String?, description: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(282013987) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {bot!.serialize(buffer, true)} - serializeString(langCode, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(name!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "bots.setBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("name", String(describing: name)), ("about", String(describing: about)), ("description", String(describing: description))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotInfo(flags: Int32, bot: Api.InputUser?, langCode: String, name: String?, about: String?, description: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(282013987) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + bot!.serialize(buffer, true) + } + serializeString(langCode, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + serializeString(name!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeString(about!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(description!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "bots.setBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("name", String(describing: name)), ("about", String(describing: about)), ("description", String(describing: description))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func setBotMenuButton(userId: Api.InputUser, button: Api.BotMenuButton) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1157944655) - userId.serialize(buffer, true) - button.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotMenuButton", parameters: [("userId", String(describing: userId)), ("button", String(describing: button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotMenuButton(userId: Api.InputUser, button: Api.BotMenuButton) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1157944655) + userId.serialize(buffer, true) + button.serialize(buffer, true) + return (FunctionDescription(name: "bots.setBotMenuButton", parameters: [("userId", String(describing: userId)), ("button", String(describing: button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func setCustomVerification(flags: Int32, bot: Api.InputUser?, peer: Api.InputPeer, customDescription: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1953898563) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {bot!.serialize(buffer, true)} - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeString(customDescription!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "bots.setCustomVerification", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("customDescription", String(describing: customDescription))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setCustomVerification(flags: Int32, bot: Api.InputUser?, peer: Api.InputPeer, customDescription: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1953898563) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + bot!.serialize(buffer, true) + } + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + serializeString(customDescription!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "bots.setCustomVerification", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("customDescription", String(describing: customDescription))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func toggleUserEmojiStatusPermission(bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(115237778) - bot.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "bots.toggleUserEmojiStatusPermission", parameters: [("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleUserEmojiStatusPermission(bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(115237778) + bot.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "bots.toggleUserEmojiStatusPermission", parameters: [("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func toggleUsername(bot: Api.InputUser, username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(87861619) - bot.serialize(buffer, true) - serializeString(username, buffer: buffer, boxed: false) - active.serialize(buffer, true) - return (FunctionDescription(name: "bots.toggleUsername", parameters: [("bot", String(describing: bot)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleUsername(bot: Api.InputUser, username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(87861619) + bot.serialize(buffer, true) + serializeString(username, buffer: buffer, boxed: false) + active.serialize(buffer, true) + return (FunctionDescription(name: "bots.toggleUsername", parameters: [("bot", String(describing: bot)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.bots { - static func updateStarRefProgram(flags: Int32, bot: Api.InputUser, commissionPermille: Int32, durationMonths: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2005621427) - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - serializeInt32(commissionPermille, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(durationMonths!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "bots.updateStarRefProgram", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("commissionPermille", String(describing: commissionPermille)), ("durationMonths", String(describing: durationMonths))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarRefProgram? in - let reader = BufferReader(buffer) - var result: Api.StarRefProgram? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StarRefProgram - } - return result - }) - } + static func updateStarRefProgram(flags: Int32, bot: Api.InputUser, commissionPermille: Int32, durationMonths: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2005621427) + serializeInt32(flags, buffer: buffer, boxed: false) + bot.serialize(buffer, true) + serializeInt32(commissionPermille, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(durationMonths!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "bots.updateStarRefProgram", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("commissionPermille", String(describing: commissionPermille)), ("durationMonths", String(describing: durationMonths))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarRefProgram? in + let reader = BufferReader(buffer) + var result: Api.StarRefProgram? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StarRefProgram + } + return result + }) + } } public extension Api.functions.bots { - static func updateUserEmojiStatus(userId: Api.InputUser, emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-308334395) - userId.serialize(buffer, true) - emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "bots.updateUserEmojiStatus", parameters: [("userId", String(describing: userId)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func updateUserEmojiStatus(userId: Api.InputUser, emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-308334395) + userId.serialize(buffer, true) + emojiStatus.serialize(buffer, true) + return (FunctionDescription(name: "bots.updateUserEmojiStatus", parameters: [("userId", String(describing: userId)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func checkSearchPostsFlood(flags: Int32, query: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(576090389) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(query!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "channels.checkSearchPostsFlood", parameters: [("flags", String(describing: flags)), ("query", String(describing: query))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SearchPostsFlood? in - let reader = BufferReader(buffer) - var result: Api.SearchPostsFlood? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.SearchPostsFlood - } - return result - }) - } + static func checkSearchPostsFlood(flags: Int32, query: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(576090389) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(query!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.checkSearchPostsFlood", parameters: [("flags", String(describing: flags)), ("query", String(describing: query))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SearchPostsFlood? in + let reader = BufferReader(buffer) + var result: Api.SearchPostsFlood? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.SearchPostsFlood + } + return result + }) + } } public extension Api.functions.channels { - static func checkUsername(channel: Api.InputChannel, username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(283557164) - channel.serialize(buffer, true) - serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.checkUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func checkUsername(channel: Api.InputChannel, username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(283557164) + channel.serialize(buffer, true) + serializeString(username, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.checkUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func convertToGigagroup(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(187239529) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.convertToGigagroup", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func convertToGigagroup(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(187239529) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.convertToGigagroup", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func createChannel(flags: Int32, title: String, about: String, geoPoint: Api.InputGeoPoint?, address: String?, ttlPeriod: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1862244601) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(about, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {geoPoint!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(address!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "channels.createChannel", parameters: [("flags", String(describing: flags)), ("title", String(describing: title)), ("about", String(describing: about)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func createChannel(flags: Int32, title: String, about: String, geoPoint: Api.InputGeoPoint?, address: String?, ttlPeriod: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1862244601) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(title, buffer: buffer, boxed: false) + serializeString(about, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + geoPoint!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(address!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 4) != 0 { + serializeInt32(ttlPeriod!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.createChannel", parameters: [("flags", String(describing: flags)), ("title", String(describing: title)), ("about", String(describing: about)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func deactivateAllUsernames(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(170155475) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.deactivateAllUsernames", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deactivateAllUsernames(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(170155475) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.deactivateAllUsernames", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func deleteChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1072619549) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.deleteChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1072619549) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.deleteChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func deleteHistory(flags: Int32, channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1683319225) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.deleteHistory", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteHistory(flags: Int32, channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1683319225) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.deleteHistory", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func deleteMessages(channel: Api.InputChannel, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2067661490) - channel.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "channels.deleteMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages - } - return result - }) - } + static func deleteMessages(channel: Api.InputChannel, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2067661490) + channel.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.deleteMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages + } + return result + }) + } } public extension Api.functions.channels { - static func deleteParticipantHistory(channel: Api.InputChannel, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(913655003) - channel.serialize(buffer, true) - participant.serialize(buffer, true) - return (FunctionDescription(name: "channels.deleteParticipantHistory", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } + static func deleteParticipantHistory(channel: Api.InputChannel, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(913655003) + channel.serialize(buffer, true) + participant.serialize(buffer, true) + return (FunctionDescription(name: "channels.deleteParticipantHistory", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } } public extension Api.functions.channels { - static func editAdmin(channel: Api.InputChannel, userId: Api.InputUser, adminRights: Api.ChatAdminRights, rank: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-751007486) - channel.serialize(buffer, true) - userId.serialize(buffer, true) - adminRights.serialize(buffer, true) - serializeString(rank, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.editAdmin", parameters: [("channel", String(describing: channel)), ("userId", String(describing: userId)), ("adminRights", String(describing: adminRights)), ("rank", String(describing: rank))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editAdmin(channel: Api.InputChannel, userId: Api.InputUser, adminRights: Api.ChatAdminRights, rank: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-751007486) + channel.serialize(buffer, true) + userId.serialize(buffer, true) + adminRights.serialize(buffer, true) + serializeString(rank, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.editAdmin", parameters: [("channel", String(describing: channel)), ("userId", String(describing: userId)), ("adminRights", String(describing: adminRights)), ("rank", String(describing: rank))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func editBanned(channel: Api.InputChannel, participant: Api.InputPeer, bannedRights: Api.ChatBannedRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1763259007) - channel.serialize(buffer, true) - participant.serialize(buffer, true) - bannedRights.serialize(buffer, true) - return (FunctionDescription(name: "channels.editBanned", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editBanned(channel: Api.InputChannel, participant: Api.InputPeer, bannedRights: Api.ChatBannedRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1763259007) + channel.serialize(buffer, true) + participant.serialize(buffer, true) + bannedRights.serialize(buffer, true) + return (FunctionDescription(name: "channels.editBanned", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func editCreator(channel: Api.InputChannel, userId: Api.InputUser, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1892102881) - channel.serialize(buffer, true) - userId.serialize(buffer, true) - password.serialize(buffer, true) - return (FunctionDescription(name: "channels.editCreator", parameters: [("channel", String(describing: channel)), ("userId", String(describing: userId)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editCreator(channel: Api.InputChannel, userId: Api.InputUser, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1892102881) + channel.serialize(buffer, true) + userId.serialize(buffer, true) + password.serialize(buffer, true) + return (FunctionDescription(name: "channels.editCreator", parameters: [("channel", String(describing: channel)), ("userId", String(describing: userId)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func editLocation(channel: Api.InputChannel, geoPoint: Api.InputGeoPoint, address: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1491484525) - channel.serialize(buffer, true) - geoPoint.serialize(buffer, true) - serializeString(address, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.editLocation", parameters: [("channel", String(describing: channel)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func editLocation(channel: Api.InputChannel, geoPoint: Api.InputGeoPoint, address: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1491484525) + channel.serialize(buffer, true) + geoPoint.serialize(buffer, true) + serializeString(address, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.editLocation", parameters: [("channel", String(describing: channel)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func editPhoto(channel: Api.InputChannel, photo: Api.InputChatPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-248621111) - channel.serialize(buffer, true) - photo.serialize(buffer, true) - return (FunctionDescription(name: "channels.editPhoto", parameters: [("channel", String(describing: channel)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editPhoto(channel: Api.InputChannel, photo: Api.InputChatPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-248621111) + channel.serialize(buffer, true) + photo.serialize(buffer, true) + return (FunctionDescription(name: "channels.editPhoto", parameters: [("channel", String(describing: channel)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func editTitle(channel: Api.InputChannel, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1450044624) - channel.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.editTitle", parameters: [("channel", String(describing: channel)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editTitle(channel: Api.InputChannel, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1450044624) + channel.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.editTitle", parameters: [("channel", String(describing: channel)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func exportMessageLink(flags: Int32, channel: Api.InputChannel, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-432034325) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.exportMessageLink", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedMessageLink? in - let reader = BufferReader(buffer) - var result: Api.ExportedMessageLink? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ExportedMessageLink - } - return result - }) - } + static func exportMessageLink(flags: Int32, channel: Api.InputChannel, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-432034325) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.exportMessageLink", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedMessageLink? in + let reader = BufferReader(buffer) + var result: Api.ExportedMessageLink? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ExportedMessageLink + } + return result + }) + } } public extension Api.functions.channels { - static func getAdminLog(flags: Int32, channel: Api.InputChannel, q: String, eventsFilter: Api.ChannelAdminLogEventsFilter?, admins: [Api.InputUser]?, maxId: Int64, minId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(870184064) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - serializeString(q, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {eventsFilter!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(admins!.count)) - for item in admins! { - item.serialize(buffer, true) - }} - serializeInt64(maxId, buffer: buffer, boxed: false) - serializeInt64(minId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getAdminLog", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("q", String(describing: q)), ("eventsFilter", String(describing: eventsFilter)), ("admins", String(describing: admins)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.AdminLogResults? in - let reader = BufferReader(buffer) - var result: Api.channels.AdminLogResults? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.AdminLogResults - } - return result - }) - } + static func getAdminLog(flags: Int32, channel: Api.InputChannel, q: String, eventsFilter: Api.ChannelAdminLogEventsFilter?, admins: [Api.InputUser]?, maxId: Int64, minId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(870184064) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + serializeString(q, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + eventsFilter!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(admins!.count)) + for item in admins! { + item.serialize(buffer, true) + } + } + serializeInt64(maxId, buffer: buffer, boxed: false) + serializeInt64(minId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.getAdminLog", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("q", String(describing: q)), ("eventsFilter", String(describing: eventsFilter)), ("admins", String(describing: admins)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.AdminLogResults? in + let reader = BufferReader(buffer) + var result: Api.channels.AdminLogResults? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.channels.AdminLogResults + } + return result + }) + } } public extension Api.functions.channels { - static func getAdminedPublicChannels(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-122669393) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getAdminedPublicChannels", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getAdminedPublicChannels(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-122669393) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.getAdminedPublicChannels", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.channels { - static func getChannelRecommendations(flags: Int32, channel: Api.InputChannel?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(631707458) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {channel!.serialize(buffer, true)} - return (FunctionDescription(name: "channels.getChannelRecommendations", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getChannelRecommendations(flags: Int32, channel: Api.InputChannel?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(631707458) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + channel!.serialize(buffer, true) + } + return (FunctionDescription(name: "channels.getChannelRecommendations", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.channels { - static func getChannels(id: [Api.InputChannel]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(176122811) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "channels.getChannels", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getChannels(id: [Api.InputChannel]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(176122811) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "channels.getChannels", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.channels { - static func getFullChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(141781513) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.getFullChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in - let reader = BufferReader(buffer) - var result: Api.messages.ChatFull? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ChatFull - } - return result - }) - } + static func getFullChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(141781513) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.getFullChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatFull? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatFull + } + return result + }) + } } public extension Api.functions.channels { - static func getFutureCreatorAfterLeave(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1610016593) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.getFutureCreatorAfterLeave", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } + static func getFutureCreatorAfterLeave(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1610016593) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.getFutureCreatorAfterLeave", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } } public extension Api.functions.channels { - static func getGroupsForDiscussion() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-170208392) - - return (FunctionDescription(name: "channels.getGroupsForDiscussion", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getGroupsForDiscussion() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-170208392) + return (FunctionDescription(name: "channels.getGroupsForDiscussion", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.channels { - static func getInactiveChannels() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(300429806) - - return (FunctionDescription(name: "channels.getInactiveChannels", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InactiveChats? in - let reader = BufferReader(buffer) - var result: Api.messages.InactiveChats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.InactiveChats - } - return result - }) - } + static func getInactiveChannels() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(300429806) + return (FunctionDescription(name: "channels.getInactiveChannels", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InactiveChats? in + let reader = BufferReader(buffer) + var result: Api.messages.InactiveChats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.InactiveChats + } + return result + }) + } } public extension Api.functions.channels { - static func getLeftChannels(offset: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2092831552) - serializeInt32(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getLeftChannels", parameters: [("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getLeftChannels(offset: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2092831552) + serializeInt32(offset, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.getLeftChannels", parameters: [("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.channels { - static func getMessageAuthor(channel: Api.InputChannel, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-320691994) - channel.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getMessageAuthor", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } + static func getMessageAuthor(channel: Api.InputChannel, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-320691994) + channel.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.getMessageAuthor", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } } public extension Api.functions.channels { - static func getMessages(channel: Api.InputChannel, id: [Api.InputMessage]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1383294429) - channel.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "channels.getMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } + static func getMessages(channel: Api.InputChannel, id: [Api.InputMessage]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1383294429) + channel.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "channels.getMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } } public extension Api.functions.channels { - static func getParticipant(channel: Api.InputChannel, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1599378234) - channel.serialize(buffer, true) - participant.serialize(buffer, true) - return (FunctionDescription(name: "channels.getParticipant", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipant? in - let reader = BufferReader(buffer) - var result: Api.channels.ChannelParticipant? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.ChannelParticipant - } - return result - }) - } + static func getParticipant(channel: Api.InputChannel, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1599378234) + channel.serialize(buffer, true) + participant.serialize(buffer, true) + return (FunctionDescription(name: "channels.getParticipant", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipant? in + let reader = BufferReader(buffer) + var result: Api.channels.ChannelParticipant? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.channels.ChannelParticipant + } + return result + }) + } } public extension Api.functions.channels { - static func getParticipants(channel: Api.InputChannel, filter: Api.ChannelParticipantsFilter, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2010044880) - channel.serialize(buffer, true) - filter.serialize(buffer, true) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getParticipants", parameters: [("channel", String(describing: channel)), ("filter", String(describing: filter)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipants? in - let reader = BufferReader(buffer) - var result: Api.channels.ChannelParticipants? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.ChannelParticipants - } - return result - }) - } + static func getParticipants(channel: Api.InputChannel, filter: Api.ChannelParticipantsFilter, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2010044880) + channel.serialize(buffer, true) + filter.serialize(buffer, true) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.getParticipants", parameters: [("channel", String(describing: channel)), ("filter", String(describing: filter)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipants? in + let reader = BufferReader(buffer) + var result: Api.channels.ChannelParticipants? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.channels.ChannelParticipants + } + return result + }) + } } public extension Api.functions.channels { - static func getSendAs(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-410672065) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "channels.getSendAs", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SendAsPeers? in - let reader = BufferReader(buffer) - var result: Api.channels.SendAsPeers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.SendAsPeers - } - return result - }) - } + static func getSendAs(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-410672065) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "channels.getSendAs", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SendAsPeers? in + let reader = BufferReader(buffer) + var result: Api.channels.SendAsPeers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.channels.SendAsPeers + } + return result + }) + } } public extension Api.functions.channels { - static func inviteToChannel(channel: Api.InputChannel, users: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-907854508) - channel.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "channels.inviteToChannel", parameters: [("channel", String(describing: channel)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in - let reader = BufferReader(buffer) - var result: Api.messages.InvitedUsers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers - } - return result - }) - } + static func inviteToChannel(channel: Api.InputChannel, users: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-907854508) + channel.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(users.count)) + for item in users { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "channels.inviteToChannel", parameters: [("channel", String(describing: channel)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + let reader = BufferReader(buffer) + var result: Api.messages.InvitedUsers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers + } + return result + }) + } } public extension Api.functions.channels { - static func joinChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(615851205) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.joinChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func joinChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(615851205) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.joinChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func leaveChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-130635115) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.leaveChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func leaveChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-130635115) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.leaveChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func readHistory(channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-871347913) - channel.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.readHistory", parameters: [("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func readHistory(channel: Api.InputChannel, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-871347913) + channel.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.readHistory", parameters: [("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func readMessageContents(channel: Api.InputChannel, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-357180360) - channel.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "channels.readMessageContents", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func readMessageContents(channel: Api.InputChannel, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-357180360) + channel.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.readMessageContents", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func reorderUsernames(channel: Api.InputChannel, order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1268978403) - channel.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "channels.reorderUsernames", parameters: [("channel", String(describing: channel)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reorderUsernames(channel: Api.InputChannel, order: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1268978403) + channel.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.reorderUsernames", parameters: [("channel", String(describing: channel)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func reportAntiSpamFalsePositive(channel: Api.InputChannel, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1471109485) - channel.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.reportAntiSpamFalsePositive", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reportAntiSpamFalsePositive(channel: Api.InputChannel, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1471109485) + channel.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.reportAntiSpamFalsePositive", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func reportSpam(channel: Api.InputChannel, participant: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-196443371) - channel.serialize(buffer, true) - participant.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "channels.reportSpam", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reportSpam(channel: Api.InputChannel, participant: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-196443371) + channel.serialize(buffer, true) + participant.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.reportSpam", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func restrictSponsoredMessages(channel: Api.InputChannel, restricted: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1696000743) - channel.serialize(buffer, true) - restricted.serialize(buffer, true) - return (FunctionDescription(name: "channels.restrictSponsoredMessages", parameters: [("channel", String(describing: channel)), ("restricted", String(describing: restricted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func restrictSponsoredMessages(channel: Api.InputChannel, restricted: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1696000743) + channel.serialize(buffer, true) + restricted.serialize(buffer, true) + return (FunctionDescription(name: "channels.restrictSponsoredMessages", parameters: [("channel", String(describing: channel)), ("restricted", String(describing: restricted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func searchPosts(flags: Int32, hashtag: String?, query: String?, offsetRate: Int32, offsetPeer: Api.InputPeer, offsetId: Int32, limit: Int32, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-221973939) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(hashtag!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(query!, buffer: buffer, boxed: false)} - serializeInt32(offsetRate, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "channels.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("query", String(describing: query)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } + static func searchPosts(flags: Int32, hashtag: String?, query: String?, offsetRate: Int32, offsetPeer: Api.InputPeer, offsetId: Int32, limit: Int32, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-221973939) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(hashtag!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(query!, buffer: buffer, boxed: false) + } + serializeInt32(offsetRate, buffer: buffer, boxed: false) + offsetPeer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("query", String(describing: query)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } } public extension Api.functions.channels { - static func setBoostsToUnblockRestrictions(channel: Api.InputChannel, boosts: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1388733202) - channel.serialize(buffer, true) - serializeInt32(boosts, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.setBoostsToUnblockRestrictions", parameters: [("channel", String(describing: channel)), ("boosts", String(describing: boosts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func setBoostsToUnblockRestrictions(channel: Api.InputChannel, boosts: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1388733202) + channel.serialize(buffer, true) + serializeInt32(boosts, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.setBoostsToUnblockRestrictions", parameters: [("channel", String(describing: channel)), ("boosts", String(describing: boosts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func setDiscussionGroup(broadcast: Api.InputChannel, group: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1079520178) - broadcast.serialize(buffer, true) - group.serialize(buffer, true) - return (FunctionDescription(name: "channels.setDiscussionGroup", parameters: [("broadcast", String(describing: broadcast)), ("group", String(describing: group))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setDiscussionGroup(broadcast: Api.InputChannel, group: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1079520178) + broadcast.serialize(buffer, true) + group.serialize(buffer, true) + return (FunctionDescription(name: "channels.setDiscussionGroup", parameters: [("broadcast", String(describing: broadcast)), ("group", String(describing: group))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func setEmojiStickers(channel: Api.InputChannel, stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1020866743) - channel.serialize(buffer, true) - stickerset.serialize(buffer, true) - return (FunctionDescription(name: "channels.setEmojiStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setEmojiStickers(channel: Api.InputChannel, stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1020866743) + channel.serialize(buffer, true) + stickerset.serialize(buffer, true) + return (FunctionDescription(name: "channels.setEmojiStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func setMainProfileTab(channel: Api.InputChannel, tab: Api.ProfileTab) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(897842353) - channel.serialize(buffer, true) - tab.serialize(buffer, true) - return (FunctionDescription(name: "channels.setMainProfileTab", parameters: [("channel", String(describing: channel)), ("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setMainProfileTab(channel: Api.InputChannel, tab: Api.ProfileTab) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(897842353) + channel.serialize(buffer, true) + tab.serialize(buffer, true) + return (FunctionDescription(name: "channels.setMainProfileTab", parameters: [("channel", String(describing: channel)), ("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func setStickers(channel: Api.InputChannel, stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-359881479) - channel.serialize(buffer, true) - stickerset.serialize(buffer, true) - return (FunctionDescription(name: "channels.setStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setStickers(channel: Api.InputChannel, stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-359881479) + channel.serialize(buffer, true) + stickerset.serialize(buffer, true) + return (FunctionDescription(name: "channels.setStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func toggleAntiSpam(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1760814315) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleAntiSpam", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleAntiSpam(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1760814315) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleAntiSpam", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleAutotranslation(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(377471137) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleAutotranslation", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleAutotranslation(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(377471137) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleAutotranslation", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleForum(channel: Api.InputChannel, enabled: Api.Bool, tabs: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1073174324) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - tabs.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleForum", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled)), ("tabs", String(describing: tabs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleForum(channel: Api.InputChannel, enabled: Api.Bool, tabs: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1073174324) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + tabs.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleForum", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled)), ("tabs", String(describing: tabs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleJoinRequest(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1277789622) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleJoinRequest", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleJoinRequest(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1277789622) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleJoinRequest", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleJoinToSend(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-456419968) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleJoinToSend", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleJoinToSend(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-456419968) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleJoinToSend", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleParticipantsHidden(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1785624660) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleParticipantsHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleParticipantsHidden(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1785624660) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleParticipantsHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func togglePreHistoryHidden(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-356796084) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.togglePreHistoryHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func togglePreHistoryHidden(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-356796084) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.togglePreHistoryHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleSignatures(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1099781276) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleSignatures", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleSignatures(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1099781276) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleSignatures", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleSlowMode(channel: Api.InputChannel, seconds: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-304832784) - channel.serialize(buffer, true) - serializeInt32(seconds, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.toggleSlowMode", parameters: [("channel", String(describing: channel)), ("seconds", String(describing: seconds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleSlowMode(channel: Api.InputChannel, seconds: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-304832784) + channel.serialize(buffer, true) + serializeInt32(seconds, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.toggleSlowMode", parameters: [("channel", String(describing: channel)), ("seconds", String(describing: seconds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func toggleUsername(channel: Api.InputChannel, username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1358053637) - channel.serialize(buffer, true) - serializeString(username, buffer: buffer, boxed: false) - active.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleUsername(channel: Api.InputChannel, username: String, active: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1358053637) + channel.serialize(buffer, true) + serializeString(username, buffer: buffer, boxed: false) + active.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.channels { - static func toggleViewForumAsMessages(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1757889771) - channel.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleViewForumAsMessages", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleViewForumAsMessages(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1757889771) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "channels.toggleViewForumAsMessages", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func updateColor(flags: Int32, channel: Api.InputChannel, color: Int32?, backgroundEmojiId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-659933583) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "channels.updateColor", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("color", String(describing: color)), ("backgroundEmojiId", String(describing: backgroundEmojiId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func updateColor(flags: Int32, channel: Api.InputChannel, color: Int32?, backgroundEmojiId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-659933583) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(color!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.updateColor", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("color", String(describing: color)), ("backgroundEmojiId", String(describing: backgroundEmojiId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func updateEmojiStatus(channel: Api.InputChannel, emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-254548312) - channel.serialize(buffer, true) - emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "channels.updateEmojiStatus", parameters: [("channel", String(describing: channel)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func updateEmojiStatus(channel: Api.InputChannel, emojiStatus: Api.EmojiStatus) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-254548312) + channel.serialize(buffer, true) + emojiStatus.serialize(buffer, true) + return (FunctionDescription(name: "channels.updateEmojiStatus", parameters: [("channel", String(describing: channel)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func updatePaidMessagesPrice(flags: Int32, channel: Api.InputChannel, sendPaidMessagesStars: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1259483771) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - serializeInt64(sendPaidMessagesStars, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.updatePaidMessagesPrice", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func updatePaidMessagesPrice(flags: Int32, channel: Api.InputChannel, sendPaidMessagesStars: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1259483771) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + serializeInt64(sendPaidMessagesStars, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.updatePaidMessagesPrice", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.channels { - static func updateUsername(channel: Api.InputChannel, username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(890549214) - channel.serialize(buffer, true) - serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.updateUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func updateUsername(channel: Api.InputChannel, username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(890549214) + channel.serialize(buffer, true) + serializeString(username, buffer: buffer, boxed: false) + return (FunctionDescription(name: "channels.updateUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.chatlists { - static func checkChatlistInvite(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1103171583) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "chatlists.checkChatlistInvite", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistInvite? in - let reader = BufferReader(buffer) - var result: Api.chatlists.ChatlistInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.chatlists.ChatlistInvite - } - return result - }) - } + static func checkChatlistInvite(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1103171583) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "chatlists.checkChatlistInvite", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistInvite? in + let reader = BufferReader(buffer) + var result: Api.chatlists.ChatlistInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.chatlists.ChatlistInvite + } + return result + }) + } } public extension Api.functions.chatlists { - static func deleteExportedInvite(chatlist: Api.InputChatlist, slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1906072670) - chatlist.serialize(buffer, true) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "chatlists.deleteExportedInvite", parameters: [("chatlist", String(describing: chatlist)), ("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deleteExportedInvite(chatlist: Api.InputChatlist, slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1906072670) + chatlist.serialize(buffer, true) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "chatlists.deleteExportedInvite", parameters: [("chatlist", String(describing: chatlist)), ("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.chatlists { - static func editExportedInvite(flags: Int32, chatlist: Api.InputChatlist, slug: String, title: String?, peers: [Api.InputPeer]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1698543165) - serializeInt32(flags, buffer: buffer, boxed: false) - chatlist.serialize(buffer, true) - serializeString(slug, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers!.count)) - for item in peers! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "chatlists.editExportedInvite", parameters: [("flags", String(describing: flags)), ("chatlist", String(describing: chatlist)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatlistInvite? in - let reader = BufferReader(buffer) - var result: Api.ExportedChatlistInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ExportedChatlistInvite - } - return result - }) - } + static func editExportedInvite(flags: Int32, chatlist: Api.InputChatlist, slug: String, title: String?, peers: [Api.InputPeer]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1698543165) + serializeInt32(flags, buffer: buffer, boxed: false) + chatlist.serialize(buffer, true) + serializeString(slug, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers!.count)) + for item in peers! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "chatlists.editExportedInvite", parameters: [("flags", String(describing: flags)), ("chatlist", String(describing: chatlist)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatlistInvite? in + let reader = BufferReader(buffer) + var result: Api.ExportedChatlistInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ExportedChatlistInvite + } + return result + }) + } } public extension Api.functions.chatlists { - static func exportChatlistInvite(chatlist: Api.InputChatlist, title: String, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2072885362) - chatlist.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "chatlists.exportChatlistInvite", parameters: [("chatlist", String(describing: chatlist)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedChatlistInvite? in - let reader = BufferReader(buffer) - var result: Api.chatlists.ExportedChatlistInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.chatlists.ExportedChatlistInvite - } - return result - }) - } + static func exportChatlistInvite(chatlist: Api.InputChatlist, title: String, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2072885362) + chatlist.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers.count)) + for item in peers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "chatlists.exportChatlistInvite", parameters: [("chatlist", String(describing: chatlist)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedChatlistInvite? in + let reader = BufferReader(buffer) + var result: Api.chatlists.ExportedChatlistInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.chatlists.ExportedChatlistInvite + } + return result + }) + } } public extension Api.functions.chatlists { - static func getChatlistUpdates(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1992190687) - chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistUpdates? in - let reader = BufferReader(buffer) - var result: Api.chatlists.ChatlistUpdates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.chatlists.ChatlistUpdates - } - return result - }) - } + static func getChatlistUpdates(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1992190687) + chatlist.serialize(buffer, true) + return (FunctionDescription(name: "chatlists.getChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistUpdates? in + let reader = BufferReader(buffer) + var result: Api.chatlists.ChatlistUpdates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.chatlists.ChatlistUpdates + } + return result + }) + } } public extension Api.functions.chatlists { - static func getExportedInvites(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-838608253) - chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getExportedInvites", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedInvites? in - let reader = BufferReader(buffer) - var result: Api.chatlists.ExportedInvites? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.chatlists.ExportedInvites - } - return result - }) - } + static func getExportedInvites(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-838608253) + chatlist.serialize(buffer, true) + return (FunctionDescription(name: "chatlists.getExportedInvites", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedInvites? in + let reader = BufferReader(buffer) + var result: Api.chatlists.ExportedInvites? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.chatlists.ExportedInvites + } + return result + }) + } } public extension Api.functions.chatlists { - static func getLeaveChatlistSuggestions(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Peer]>) { - let buffer = Buffer() - buffer.appendInt32(-37955820) - chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getLeaveChatlistSuggestions", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Peer]? in - let reader = BufferReader(buffer) - var result: [Api.Peer]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - return result - }) - } + static func getLeaveChatlistSuggestions(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Peer]>) { + let buffer = Buffer() + buffer.appendInt32(-37955820) + chatlist.serialize(buffer, true) + return (FunctionDescription(name: "chatlists.getLeaveChatlistSuggestions", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Peer]? in + let reader = BufferReader(buffer) + var result: [Api.Peer]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + return result + }) + } } public extension Api.functions.chatlists { - static func hideChatlistUpdates(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1726252795) - chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.hideChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func hideChatlistUpdates(chatlist: Api.InputChatlist) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1726252795) + chatlist.serialize(buffer, true) + return (FunctionDescription(name: "chatlists.hideChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.chatlists { - static func joinChatlistInvite(slug: String, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1498291302) - serializeString(slug, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "chatlists.joinChatlistInvite", parameters: [("slug", String(describing: slug)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func joinChatlistInvite(slug: String, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1498291302) + serializeString(slug, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers.count)) + for item in peers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "chatlists.joinChatlistInvite", parameters: [("slug", String(describing: slug)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.chatlists { - static func joinChatlistUpdates(chatlist: Api.InputChatlist, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-527828747) - chatlist.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "chatlists.joinChatlistUpdates", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func joinChatlistUpdates(chatlist: Api.InputChatlist, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-527828747) + chatlist.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers.count)) + for item in peers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "chatlists.joinChatlistUpdates", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.chatlists { - static func leaveChatlist(chatlist: Api.InputChatlist, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1962598714) - chatlist.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "chatlists.leaveChatlist", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func leaveChatlist(chatlist: Api.InputChatlist, peers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1962598714) + chatlist.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers.count)) + for item in peers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "chatlists.leaveChatlist", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func acceptContact(id: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-130964977) - id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.acceptContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func acceptContact(id: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-130964977) + id.serialize(buffer, true) + return (FunctionDescription(name: "contacts.acceptContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func addContact(flags: Int32, id: Api.InputUser, firstName: String, lastName: String, phone: String, note: Api.TextWithEntities?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-642109868) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeString(phone, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {note!.serialize(buffer, true)} - return (FunctionDescription(name: "contacts.addContact", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("phone", String(describing: phone)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func addContact(flags: Int32, id: Api.InputUser, firstName: String, lastName: String, phone: String, note: Api.TextWithEntities?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-642109868) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + serializeString(firstName, buffer: buffer, boxed: false) + serializeString(lastName, buffer: buffer, boxed: false) + serializeString(phone, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + note!.serialize(buffer, true) + } + return (FunctionDescription(name: "contacts.addContact", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("phone", String(describing: phone)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func block(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(774801204) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.block", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func block(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(774801204) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + return (FunctionDescription(name: "contacts.block", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func blockFromReplies(flags: Int32, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(698914348) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.blockFromReplies", parameters: [("flags", String(describing: flags)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func blockFromReplies(flags: Int32, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(698914348) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.blockFromReplies", parameters: [("flags", String(describing: flags)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func deleteByPhones(phones: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(269745566) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(phones.count)) - for item in phones { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "contacts.deleteByPhones", parameters: [("phones", String(describing: phones))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deleteByPhones(phones: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(269745566) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(phones.count)) + for item in phones { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "contacts.deleteByPhones", parameters: [("phones", String(describing: phones))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func deleteContacts(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(157945344) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "contacts.deleteContacts", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteContacts(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(157945344) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "contacts.deleteContacts", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func editCloseFriends(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1167653392) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "contacts.editCloseFriends", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func editCloseFriends(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1167653392) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "contacts.editCloseFriends", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func exportContactToken() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-127582169) - - return (FunctionDescription(name: "contacts.exportContactToken", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedContactToken? in - let reader = BufferReader(buffer) - var result: Api.ExportedContactToken? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ExportedContactToken - } - return result - }) - } + static func exportContactToken() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-127582169) + return (FunctionDescription(name: "contacts.exportContactToken", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedContactToken? in + let reader = BufferReader(buffer) + var result: Api.ExportedContactToken? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ExportedContactToken + } + return result + }) + } } public extension Api.functions.contacts { - static func getBirthdays() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-621959068) - - return (FunctionDescription(name: "contacts.getBirthdays", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ContactBirthdays? in - let reader = BufferReader(buffer) - var result: Api.contacts.ContactBirthdays? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.ContactBirthdays - } - return result - }) - } + static func getBirthdays() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-621959068) + return (FunctionDescription(name: "contacts.getBirthdays", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ContactBirthdays? in + let reader = BufferReader(buffer) + var result: Api.contacts.ContactBirthdays? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.ContactBirthdays + } + return result + }) + } } public extension Api.functions.contacts { - static func getBlocked(flags: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1702457472) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getBlocked", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Blocked? in - let reader = BufferReader(buffer) - var result: Api.contacts.Blocked? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.Blocked - } - return result - }) - } + static func getBlocked(flags: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1702457472) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.getBlocked", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Blocked? in + let reader = BufferReader(buffer) + var result: Api.contacts.Blocked? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.Blocked + } + return result + }) + } } public extension Api.functions.contacts { - static func getContactIDs(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { - let buffer = Buffer() - buffer.appendInt32(2061264541) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getContactIDs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - return result - }) - } + static func getContactIDs(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { + let buffer = Buffer() + buffer.appendInt32(2061264541) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.getContactIDs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + let reader = BufferReader(buffer) + var result: [Int32]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + return result + }) + } } public extension Api.functions.contacts { - static func getContacts(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1574346258) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getContacts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Contacts? in - let reader = BufferReader(buffer) - var result: Api.contacts.Contacts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.Contacts - } - return result - }) - } + static func getContacts(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1574346258) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.getContacts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Contacts? in + let reader = BufferReader(buffer) + var result: Api.contacts.Contacts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.Contacts + } + return result + }) + } } public extension Api.functions.contacts { - static func getLocated(flags: Int32, geoPoint: Api.InputGeoPoint, selfExpires: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-750207932) - serializeInt32(flags, buffer: buffer, boxed: false) - geoPoint.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(selfExpires!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "contacts.getLocated", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("selfExpires", String(describing: selfExpires))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func getLocated(flags: Int32, geoPoint: Api.InputGeoPoint, selfExpires: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-750207932) + serializeInt32(flags, buffer: buffer, boxed: false) + geoPoint.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(selfExpires!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "contacts.getLocated", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("selfExpires", String(describing: selfExpires))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.contacts { - static func getSaved() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SavedContact]>) { - let buffer = Buffer() - buffer.appendInt32(-2098076769) - - return (FunctionDescription(name: "contacts.getSaved", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SavedContact]? in - let reader = BufferReader(buffer) - var result: [Api.SavedContact]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedContact.self) - } - return result - }) - } + static func getSaved() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.SavedContact]>) { + let buffer = Buffer() + buffer.appendInt32(-2098076769) + return (FunctionDescription(name: "contacts.getSaved", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SavedContact]? in + let reader = BufferReader(buffer) + var result: [Api.SavedContact]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedContact.self) + } + return result + }) + } } public extension Api.functions.contacts { - static func getSponsoredPeers(q: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1228356717) - serializeString(q, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getSponsoredPeers", parameters: [("q", String(describing: q))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.SponsoredPeers? in - let reader = BufferReader(buffer) - var result: Api.contacts.SponsoredPeers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.SponsoredPeers - } - return result - }) - } + static func getSponsoredPeers(q: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1228356717) + serializeString(q, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.getSponsoredPeers", parameters: [("q", String(describing: q))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.SponsoredPeers? in + let reader = BufferReader(buffer) + var result: Api.contacts.SponsoredPeers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.SponsoredPeers + } + return result + }) + } } public extension Api.functions.contacts { - static func getStatuses() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ContactStatus]>) { - let buffer = Buffer() - buffer.appendInt32(-995929106) - - return (FunctionDescription(name: "contacts.getStatuses", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ContactStatus]? in - let reader = BufferReader(buffer) - var result: [Api.ContactStatus]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ContactStatus.self) - } - return result - }) - } + static func getStatuses() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ContactStatus]>) { + let buffer = Buffer() + buffer.appendInt32(-995929106) + return (FunctionDescription(name: "contacts.getStatuses", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ContactStatus]? in + let reader = BufferReader(buffer) + var result: [Api.ContactStatus]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ContactStatus.self) + } + return result + }) + } } public extension Api.functions.contacts { - static func getTopPeers(flags: Int32, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1758168906) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getTopPeers", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.TopPeers? in - let reader = BufferReader(buffer) - var result: Api.contacts.TopPeers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.TopPeers - } - return result - }) - } + static func getTopPeers(flags: Int32, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1758168906) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.getTopPeers", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.TopPeers? in + let reader = BufferReader(buffer) + var result: Api.contacts.TopPeers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.TopPeers + } + return result + }) + } } public extension Api.functions.contacts { - static func importContactToken(token: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(318789512) - serializeString(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.importContactToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in - let reader = BufferReader(buffer) - var result: Api.User? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.User - } - return result - }) - } + static func importContactToken(token: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(318789512) + serializeString(token, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.importContactToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + let reader = BufferReader(buffer) + var result: Api.User? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.User + } + return result + }) + } } public extension Api.functions.contacts { - static func importContacts(contacts: [Api.InputContact]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(746589157) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(contacts.count)) - for item in contacts { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "contacts.importContacts", parameters: [("contacts", String(describing: contacts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ImportedContacts? in - let reader = BufferReader(buffer) - var result: Api.contacts.ImportedContacts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.ImportedContacts - } - return result - }) - } + static func importContacts(contacts: [Api.InputContact]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(746589157) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(contacts.count)) + for item in contacts { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "contacts.importContacts", parameters: [("contacts", String(describing: contacts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ImportedContacts? in + let reader = BufferReader(buffer) + var result: Api.contacts.ImportedContacts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.ImportedContacts + } + return result + }) + } } public extension Api.functions.contacts { - static func resetSaved() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2020263951) - - return (FunctionDescription(name: "contacts.resetSaved", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func resetSaved() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2020263951) + return (FunctionDescription(name: "contacts.resetSaved", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func resetTopPeerRating(category: Api.TopPeerCategory, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(451113900) - category.serialize(buffer, true) - peer.serialize(buffer, true) - return (FunctionDescription(name: "contacts.resetTopPeerRating", parameters: [("category", String(describing: category)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func resetTopPeerRating(category: Api.TopPeerCategory, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(451113900) + category.serialize(buffer, true) + peer.serialize(buffer, true) + return (FunctionDescription(name: "contacts.resetTopPeerRating", parameters: [("category", String(describing: category)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func resolvePhone(phone: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1963375804) - serializeString(phone, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.resolvePhone", parameters: [("phone", String(describing: phone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in - let reader = BufferReader(buffer) - var result: Api.contacts.ResolvedPeer? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.ResolvedPeer - } - return result - }) - } + static func resolvePhone(phone: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1963375804) + serializeString(phone, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.resolvePhone", parameters: [("phone", String(describing: phone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in + let reader = BufferReader(buffer) + var result: Api.contacts.ResolvedPeer? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.ResolvedPeer + } + return result + }) + } } public extension Api.functions.contacts { - static func resolveUsername(flags: Int32, username: String, referer: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1918565308) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(username, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(referer!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "contacts.resolveUsername", parameters: [("flags", String(describing: flags)), ("username", String(describing: username)), ("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in - let reader = BufferReader(buffer) - var result: Api.contacts.ResolvedPeer? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.ResolvedPeer - } - return result - }) - } + static func resolveUsername(flags: Int32, username: String, referer: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1918565308) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(username, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(referer!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "contacts.resolveUsername", parameters: [("flags", String(describing: flags)), ("username", String(describing: username)), ("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in + let reader = BufferReader(buffer) + var result: Api.contacts.ResolvedPeer? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.ResolvedPeer + } + return result + }) + } } public extension Api.functions.contacts { - static func search(q: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(301470424) - serializeString(q, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.search", parameters: [("q", String(describing: q)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Found? in - let reader = BufferReader(buffer) - var result: Api.contacts.Found? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.contacts.Found - } - return result - }) - } + static func search(q: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(301470424) + serializeString(q, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.search", parameters: [("q", String(describing: q)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Found? in + let reader = BufferReader(buffer) + var result: Api.contacts.Found? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.contacts.Found + } + return result + }) + } } public extension Api.functions.contacts { - static func setBlocked(flags: Int32, id: [Api.InputPeer], limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1798939530) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.setBlocked", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBlocked(flags: Int32, id: [Api.InputPeer], limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1798939530) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "contacts.setBlocked", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func toggleTopPeers(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2062238246) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "contacts.toggleTopPeers", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleTopPeers(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2062238246) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "contacts.toggleTopPeers", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func unblock(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1252994264) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.unblock", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func unblock(flags: Int32, id: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1252994264) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + return (FunctionDescription(name: "contacts.unblock", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.contacts { - static func updateContactNote(id: Api.InputUser, note: Api.TextWithEntities) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(329212923) - id.serialize(buffer, true) - note.serialize(buffer, true) - return (FunctionDescription(name: "contacts.updateContactNote", parameters: [("id", String(describing: id)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func updateContactNote(id: Api.InputUser, note: Api.TextWithEntities) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(329212923) + id.serialize(buffer, true) + note.serialize(buffer, true) + return (FunctionDescription(name: "contacts.updateContactNote", parameters: [("id", String(describing: id)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.folders { - static func editPeerFolders(folderPeers: [Api.InputFolderPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1749536939) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(folderPeers.count)) - for item in folderPeers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "folders.editPeerFolders", parameters: [("folderPeers", String(describing: folderPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editPeerFolders(folderPeers: [Api.InputFolderPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1749536939) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(folderPeers.count)) + for item in folderPeers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "folders.editPeerFolders", parameters: [("folderPeers", String(describing: folderPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.fragment { - static func getCollectibleInfo(collectible: Api.InputCollectible) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1105295942) - collectible.serialize(buffer, true) - return (FunctionDescription(name: "fragment.getCollectibleInfo", parameters: [("collectible", String(describing: collectible))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.fragment.CollectibleInfo? in - let reader = BufferReader(buffer) - var result: Api.fragment.CollectibleInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.fragment.CollectibleInfo - } - return result - }) - } + static func getCollectibleInfo(collectible: Api.InputCollectible) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1105295942) + collectible.serialize(buffer, true) + return (FunctionDescription(name: "fragment.getCollectibleInfo", parameters: [("collectible", String(describing: collectible))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.fragment.CollectibleInfo? in + let reader = BufferReader(buffer) + var result: Api.fragment.CollectibleInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.fragment.CollectibleInfo + } + return result + }) + } } public extension Api.functions.help { - static func acceptTermsOfService(id: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-294455398) - id.serialize(buffer, true) - return (FunctionDescription(name: "help.acceptTermsOfService", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func acceptTermsOfService(id: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-294455398) + id.serialize(buffer, true) + return (FunctionDescription(name: "help.acceptTermsOfService", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.help { - static func dismissSuggestion(peer: Api.InputPeer, suggestion: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-183649631) - peer.serialize(buffer, true) - serializeString(suggestion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.dismissSuggestion", parameters: [("peer", String(describing: peer)), ("suggestion", String(describing: suggestion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func dismissSuggestion(peer: Api.InputPeer, suggestion: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-183649631) + peer.serialize(buffer, true) + serializeString(suggestion, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.dismissSuggestion", parameters: [("peer", String(describing: peer)), ("suggestion", String(describing: suggestion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.help { - static func editUserInfo(userId: Api.InputUser, message: String, entities: [Api.MessageEntity]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1723407216) - userId.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities.count)) - for item in entities { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "help.editUserInfo", parameters: [("userId", String(describing: userId)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in - let reader = BufferReader(buffer) - var result: Api.help.UserInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.UserInfo - } - return result - }) - } + static func editUserInfo(userId: Api.InputUser, message: String, entities: [Api.MessageEntity]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1723407216) + userId.serialize(buffer, true) + serializeString(message, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities.count)) + for item in entities { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "help.editUserInfo", parameters: [("userId", String(describing: userId)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in + let reader = BufferReader(buffer) + var result: Api.help.UserInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.UserInfo + } + return result + }) + } } public extension Api.functions.help { - static func getAppConfig(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1642330196) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getAppConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppConfig? in - let reader = BufferReader(buffer) - var result: Api.help.AppConfig? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.AppConfig - } - return result - }) - } + static func getAppConfig(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1642330196) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getAppConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppConfig? in + let reader = BufferReader(buffer) + var result: Api.help.AppConfig? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.AppConfig + } + return result + }) + } } public extension Api.functions.help { - static func getAppUpdate(source: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1378703997) - serializeString(source, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getAppUpdate", parameters: [("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppUpdate? in - let reader = BufferReader(buffer) - var result: Api.help.AppUpdate? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.AppUpdate - } - return result - }) - } + static func getAppUpdate(source: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1378703997) + serializeString(source, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getAppUpdate", parameters: [("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppUpdate? in + let reader = BufferReader(buffer) + var result: Api.help.AppUpdate? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.AppUpdate + } + return result + }) + } } public extension Api.functions.help { - static func getCdnConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1375900482) - - return (FunctionDescription(name: "help.getCdnConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.CdnConfig? in - let reader = BufferReader(buffer) - var result: Api.CdnConfig? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.CdnConfig - } - return result - }) - } + static func getCdnConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1375900482) + return (FunctionDescription(name: "help.getCdnConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.CdnConfig? in + let reader = BufferReader(buffer) + var result: Api.CdnConfig? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.CdnConfig + } + return result + }) + } } public extension Api.functions.help { - static func getConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-990308245) - - return (FunctionDescription(name: "help.getConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Config? in - let reader = BufferReader(buffer) - var result: Api.Config? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Config - } - return result - }) - } + static func getConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-990308245) + return (FunctionDescription(name: "help.getConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Config? in + let reader = BufferReader(buffer) + var result: Api.Config? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Config + } + return result + }) + } } public extension Api.functions.help { - static func getCountriesList(langCode: String, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1935116200) - serializeString(langCode, buffer: buffer, boxed: false) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getCountriesList", parameters: [("langCode", String(describing: langCode)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.CountriesList? in - let reader = BufferReader(buffer) - var result: Api.help.CountriesList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.CountriesList - } - return result - }) - } + static func getCountriesList(langCode: String, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1935116200) + serializeString(langCode, buffer: buffer, boxed: false) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getCountriesList", parameters: [("langCode", String(describing: langCode)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.CountriesList? in + let reader = BufferReader(buffer) + var result: Api.help.CountriesList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.CountriesList + } + return result + }) + } } public extension Api.functions.help { - static func getDeepLinkInfo(path: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1072547679) - serializeString(path, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getDeepLinkInfo", parameters: [("path", String(describing: path))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.DeepLinkInfo? in - let reader = BufferReader(buffer) - var result: Api.help.DeepLinkInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.DeepLinkInfo - } - return result - }) - } + static func getDeepLinkInfo(path: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1072547679) + serializeString(path, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getDeepLinkInfo", parameters: [("path", String(describing: path))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.DeepLinkInfo? in + let reader = BufferReader(buffer) + var result: Api.help.DeepLinkInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.DeepLinkInfo + } + return result + }) + } } public extension Api.functions.help { - static func getInviteText() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1295590211) - - return (FunctionDescription(name: "help.getInviteText", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.InviteText? in - let reader = BufferReader(buffer) - var result: Api.help.InviteText? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.InviteText - } - return result - }) - } + static func getInviteText() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1295590211) + return (FunctionDescription(name: "help.getInviteText", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.InviteText? in + let reader = BufferReader(buffer) + var result: Api.help.InviteText? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.InviteText + } + return result + }) + } } public extension Api.functions.help { - static func getNearestDc() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(531836966) - - return (FunctionDescription(name: "help.getNearestDc", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.NearestDc? in - let reader = BufferReader(buffer) - var result: Api.NearestDc? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.NearestDc - } - return result - }) - } + static func getNearestDc() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(531836966) + return (FunctionDescription(name: "help.getNearestDc", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.NearestDc? in + let reader = BufferReader(buffer) + var result: Api.NearestDc? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.NearestDc + } + return result + }) + } } public extension Api.functions.help { - static func getPassportConfig(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-966677240) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPassportConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PassportConfig? in - let reader = BufferReader(buffer) - var result: Api.help.PassportConfig? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.PassportConfig - } - return result - }) - } + static func getPassportConfig(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-966677240) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getPassportConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PassportConfig? in + let reader = BufferReader(buffer) + var result: Api.help.PassportConfig? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.PassportConfig + } + return result + }) + } } public extension Api.functions.help { - static func getPeerColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-629083089) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPeerColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in - let reader = BufferReader(buffer) - var result: Api.help.PeerColors? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.PeerColors - } - return result - }) - } + static func getPeerColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-629083089) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getPeerColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in + let reader = BufferReader(buffer) + var result: Api.help.PeerColors? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.PeerColors + } + return result + }) + } } public extension Api.functions.help { - static func getPeerProfileColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1412453891) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPeerProfileColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in - let reader = BufferReader(buffer) - var result: Api.help.PeerColors? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.PeerColors - } - return result - }) - } + static func getPeerProfileColors(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1412453891) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getPeerProfileColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in + let reader = BufferReader(buffer) + var result: Api.help.PeerColors? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.PeerColors + } + return result + }) + } } public extension Api.functions.help { - static func getPremiumPromo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1206152236) - - return (FunctionDescription(name: "help.getPremiumPromo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PremiumPromo? in - let reader = BufferReader(buffer) - var result: Api.help.PremiumPromo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.PremiumPromo - } - return result - }) - } + static func getPremiumPromo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1206152236) + return (FunctionDescription(name: "help.getPremiumPromo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PremiumPromo? in + let reader = BufferReader(buffer) + var result: Api.help.PremiumPromo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.PremiumPromo + } + return result + }) + } } public extension Api.functions.help { - static func getPromoData() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1063816159) - - return (FunctionDescription(name: "help.getPromoData", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PromoData? in - let reader = BufferReader(buffer) - var result: Api.help.PromoData? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.PromoData - } - return result - }) - } + static func getPromoData() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1063816159) + return (FunctionDescription(name: "help.getPromoData", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PromoData? in + let reader = BufferReader(buffer) + var result: Api.help.PromoData? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.PromoData + } + return result + }) + } } public extension Api.functions.help { - static func getRecentMeUrls(referer: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1036054804) - serializeString(referer, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getRecentMeUrls", parameters: [("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.RecentMeUrls? in - let reader = BufferReader(buffer) - var result: Api.help.RecentMeUrls? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.RecentMeUrls - } - return result - }) - } + static func getRecentMeUrls(referer: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1036054804) + serializeString(referer, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getRecentMeUrls", parameters: [("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.RecentMeUrls? in + let reader = BufferReader(buffer) + var result: Api.help.RecentMeUrls? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.RecentMeUrls + } + return result + }) + } } public extension Api.functions.help { - static func getSupport() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1663104819) - - return (FunctionDescription(name: "help.getSupport", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.Support? in - let reader = BufferReader(buffer) - var result: Api.help.Support? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.Support - } - return result - }) - } + static func getSupport() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1663104819) + return (FunctionDescription(name: "help.getSupport", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.Support? in + let reader = BufferReader(buffer) + var result: Api.help.Support? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.Support + } + return result + }) + } } public extension Api.functions.help { - static func getSupportName() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-748624084) - - return (FunctionDescription(name: "help.getSupportName", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.SupportName? in - let reader = BufferReader(buffer) - var result: Api.help.SupportName? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.SupportName - } - return result - }) - } + static func getSupportName() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-748624084) + return (FunctionDescription(name: "help.getSupportName", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.SupportName? in + let reader = BufferReader(buffer) + var result: Api.help.SupportName? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.SupportName + } + return result + }) + } } public extension Api.functions.help { - static func getTermsOfServiceUpdate() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(749019089) - - return (FunctionDescription(name: "help.getTermsOfServiceUpdate", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.TermsOfServiceUpdate? in - let reader = BufferReader(buffer) - var result: Api.help.TermsOfServiceUpdate? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.TermsOfServiceUpdate - } - return result - }) - } + static func getTermsOfServiceUpdate() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(749019089) + return (FunctionDescription(name: "help.getTermsOfServiceUpdate", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.TermsOfServiceUpdate? in + let reader = BufferReader(buffer) + var result: Api.help.TermsOfServiceUpdate? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.TermsOfServiceUpdate + } + return result + }) + } } public extension Api.functions.help { - static func getTimezonesList(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1236468288) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getTimezonesList", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.TimezonesList? in - let reader = BufferReader(buffer) - var result: Api.help.TimezonesList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.TimezonesList - } - return result - }) - } + static func getTimezonesList(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1236468288) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.getTimezonesList", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.TimezonesList? in + let reader = BufferReader(buffer) + var result: Api.help.TimezonesList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.TimezonesList + } + return result + }) + } } public extension Api.functions.help { - static func getUserInfo(userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(59377875) - userId.serialize(buffer, true) - return (FunctionDescription(name: "help.getUserInfo", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in - let reader = BufferReader(buffer) - var result: Api.help.UserInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.help.UserInfo - } - return result - }) - } + static func getUserInfo(userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(59377875) + userId.serialize(buffer, true) + return (FunctionDescription(name: "help.getUserInfo", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in + let reader = BufferReader(buffer) + var result: Api.help.UserInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.help.UserInfo + } + return result + }) + } } public extension Api.functions.help { - static func hidePromoData(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(505748629) - peer.serialize(buffer, true) - return (FunctionDescription(name: "help.hidePromoData", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func hidePromoData(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(505748629) + peer.serialize(buffer, true) + return (FunctionDescription(name: "help.hidePromoData", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.help { - static func saveAppLog(events: [Api.InputAppEvent]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1862465352) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(events.count)) - for item in events { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "help.saveAppLog", parameters: [("events", String(describing: events))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveAppLog(events: [Api.InputAppEvent]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1862465352) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(events.count)) + for item in events { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "help.saveAppLog", parameters: [("events", String(describing: events))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.help { - static func setBotUpdatesStatus(pendingUpdatesCount: Int32, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-333262899) - serializeInt32(pendingUpdatesCount, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.setBotUpdatesStatus", parameters: [("pendingUpdatesCount", String(describing: pendingUpdatesCount)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setBotUpdatesStatus(pendingUpdatesCount: Int32, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-333262899) + serializeInt32(pendingUpdatesCount, buffer: buffer, boxed: false) + serializeString(message, buffer: buffer, boxed: false) + return (FunctionDescription(name: "help.setBotUpdatesStatus", parameters: [("pendingUpdatesCount", String(describing: pendingUpdatesCount)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.help { - static func test() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1058929929) - - return (FunctionDescription(name: "help.test", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func test() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1058929929) + return (FunctionDescription(name: "help.test", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.langpack { - static func getDifference(langPack: String, langCode: String, fromVersion: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-845657435) - serializeString(langPack, buffer: buffer, boxed: false) - serializeString(langCode, buffer: buffer, boxed: false) - serializeInt32(fromVersion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getDifference", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in - let reader = BufferReader(buffer) - var result: Api.LangPackDifference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.LangPackDifference - } - return result - }) - } + static func getDifference(langPack: String, langCode: String, fromVersion: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-845657435) + serializeString(langPack, buffer: buffer, boxed: false) + serializeString(langCode, buffer: buffer, boxed: false) + serializeInt32(fromVersion, buffer: buffer, boxed: false) + return (FunctionDescription(name: "langpack.getDifference", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in + let reader = BufferReader(buffer) + var result: Api.LangPackDifference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.LangPackDifference + } + return result + }) + } } public extension Api.functions.langpack { - static func getLangPack(langPack: String, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-219008246) - serializeString(langPack, buffer: buffer, boxed: false) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLangPack", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in - let reader = BufferReader(buffer) - var result: Api.LangPackDifference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.LangPackDifference - } - return result - }) - } + static func getLangPack(langPack: String, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-219008246) + serializeString(langPack, buffer: buffer, boxed: false) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "langpack.getLangPack", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in + let reader = BufferReader(buffer) + var result: Api.LangPackDifference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.LangPackDifference + } + return result + }) + } } public extension Api.functions.langpack { - static func getLanguage(langPack: String, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1784243458) - serializeString(langPack, buffer: buffer, boxed: false) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLanguage", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackLanguage? in - let reader = BufferReader(buffer) - var result: Api.LangPackLanguage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.LangPackLanguage - } - return result - }) - } + static func getLanguage(langPack: String, langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1784243458) + serializeString(langPack, buffer: buffer, boxed: false) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "langpack.getLanguage", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackLanguage? in + let reader = BufferReader(buffer) + var result: Api.LangPackLanguage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.LangPackLanguage + } + return result + }) + } } public extension Api.functions.langpack { - static func getLanguages(langPack: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.LangPackLanguage]>) { - let buffer = Buffer() - buffer.appendInt32(1120311183) - serializeString(langPack, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLanguages", parameters: [("langPack", String(describing: langPack))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackLanguage]? in - let reader = BufferReader(buffer) - var result: [Api.LangPackLanguage]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackLanguage.self) - } - return result - }) - } + static func getLanguages(langPack: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.LangPackLanguage]>) { + let buffer = Buffer() + buffer.appendInt32(1120311183) + serializeString(langPack, buffer: buffer, boxed: false) + return (FunctionDescription(name: "langpack.getLanguages", parameters: [("langPack", String(describing: langPack))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackLanguage]? in + let reader = BufferReader(buffer) + var result: [Api.LangPackLanguage]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackLanguage.self) + } + return result + }) + } } public extension Api.functions.langpack { - static func getStrings(langPack: String, langCode: String, keys: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.LangPackString]>) { - let buffer = Buffer() - buffer.appendInt32(-269862909) - serializeString(langPack, buffer: buffer, boxed: false) - serializeString(langCode, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(keys.count)) - for item in keys { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "langpack.getStrings", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("keys", String(describing: keys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackString]? in - let reader = BufferReader(buffer) - var result: [Api.LangPackString]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackString.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func acceptEncryption(peer: Api.InputEncryptedChat, gB: Buffer, keyFingerprint: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1035731989) - peer.serialize(buffer, true) - serializeBytes(gB, buffer: buffer, boxed: false) - serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.acceptEncryption", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("keyFingerprint", String(describing: keyFingerprint))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in - let reader = BufferReader(buffer) - var result: Api.EncryptedChat? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EncryptedChat - } - return result - }) - } -} -public extension Api.functions.messages { - static func acceptUrlAuth(flags: Int32, peer: Api.InputPeer?, msgId: Int32?, buttonId: Int32?, url: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1322487515) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(msgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(buttonId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.acceptUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in - let reader = BufferReader(buffer) - var result: Api.UrlAuthResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.UrlAuthResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func addChatUser(chatId: Int64, userId: Api.InputUser, fwdLimit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-876162809) - serializeInt64(chatId, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeInt32(fwdLimit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.addChatUser", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("fwdLimit", String(describing: fwdLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in - let reader = BufferReader(buffer) - var result: Api.messages.InvitedUsers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers - } - return result - }) - } -} -public extension Api.functions.messages { - static func appendTodoList(peer: Api.InputPeer, msgId: Int32, list: [Api.TodoItem]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(564531287) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(list.count)) - for item in list { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.appendTodoList", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("list", String(describing: list))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func checkChatInvite(hash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1051570619) - serializeString(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatInvite? in - let reader = BufferReader(buffer) - var result: Api.ChatInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ChatInvite - } - return result - }) - } -} -public extension Api.functions.messages { - static func checkHistoryImport(importHead: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1140726259) - serializeString(importHead, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkHistoryImport", parameters: [("importHead", String(describing: importHead))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImportParsed? in - let reader = BufferReader(buffer) - var result: Api.messages.HistoryImportParsed? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.HistoryImportParsed - } - return result - }) - } -} -public extension Api.functions.messages { - static func checkHistoryImportPeer(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1573261059) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.checkHistoryImportPeer", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.CheckedHistoryImportPeer? in - let reader = BufferReader(buffer) - var result: Api.messages.CheckedHistoryImportPeer? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.CheckedHistoryImportPeer - } - return result - }) - } -} -public extension Api.functions.messages { - static func checkQuickReplyShortcut(shortcut: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-237962285) - serializeString(shortcut, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkQuickReplyShortcut", parameters: [("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func clearAllDrafts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2119757468) - - return (FunctionDescription(name: "messages.clearAllDrafts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func clearRecentReactions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1644236876) - - return (FunctionDescription(name: "messages.clearRecentReactions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func clearRecentStickers(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1986437075) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.clearRecentStickers", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func clickSponsoredMessage(flags: Int32, randomId: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2110454402) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeBytes(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.clickSponsoredMessage", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func createChat(flags: Int32, users: [Api.InputUser], title: String, ttlPeriod: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1831936556) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.createChat", parameters: [("flags", String(describing: flags)), ("users", String(describing: users)), ("title", String(describing: title)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in - let reader = BufferReader(buffer) - var result: Api.messages.InvitedUsers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers - } - return result - }) - } -} -public extension Api.functions.messages { - static func createForumTopic(flags: Int32, peer: Api.InputPeer, title: String, iconColor: Int32?, iconEmojiId: Int64?, randomId: Int64, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(798540757) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(iconColor!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(iconEmojiId!, buffer: buffer, boxed: false)} - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {sendAs!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.createForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("title", String(describing: title)), ("iconColor", String(describing: iconColor)), ("iconEmojiId", String(describing: iconEmojiId)), ("randomId", String(describing: randomId)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1540419152) - serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteChatUser(flags: Int32, chatId: Int64, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1575461717) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteChatUser", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteExportedChatInvite(peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-731601877) - peer.serialize(buffer, true) - serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteFactCheck(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-774204404) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteHistory(flags: Int32, peer: Api.InputPeer, maxId: Int32, minDate: Int32?, maxDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1332768214) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(minDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(maxDate!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.deleteHistory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteMessages(flags: Int32, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-443640366) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.deleteMessages", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages - } - return result - }) - } -} -public extension Api.functions.messages { - static func deletePhoneCallHistory(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-104078327) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deletePhoneCallHistory", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedFoundMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedFoundMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedFoundMessages - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteQuickReplyMessages(shortcutId: Int32, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-519706352) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.deleteQuickReplyMessages", parameters: [("shortcutId", String(describing: shortcutId)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteQuickReplyShortcut(shortcutId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1019234112) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteRevokedExportedChatInvites(peer: Api.InputPeer, adminId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1452833749) - peer.serialize(buffer, true) - adminId.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteRevokedExportedChatInvites", parameters: [("peer", String(describing: peer)), ("adminId", String(describing: adminId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteSavedHistory(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputPeer, maxId: Int32, minDate: Int32?, maxDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1304758367) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {parentPeer!.serialize(buffer, true)} - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(minDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(maxDate!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.deleteSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1504586518) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.deleteScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func deleteTopicHistory(peer: Api.InputPeer, topMsgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-763269360) - peer.serialize(buffer, true) - serializeInt32(topMsgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteTopicHistory", parameters: [("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func discardEncryption(flags: Int32, chatId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-208425312) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.discardEncryption", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func editChatAbout(peer: Api.InputPeer, about: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-554301545) - peer.serialize(buffer, true) - serializeString(about, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatAbout", parameters: [("peer", String(describing: peer)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func editChatAdmin(chatId: Int64, userId: Api.InputUser, isAdmin: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1470377534) - serializeInt64(chatId, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - isAdmin.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatAdmin", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("isAdmin", String(describing: isAdmin))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func editChatDefaultBannedRights(peer: Api.InputPeer, bannedRights: Api.ChatBannedRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1517917375) - peer.serialize(buffer, true) - bannedRights.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatDefaultBannedRights", parameters: [("peer", String(describing: peer)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editChatPhoto(chatId: Int64, photo: Api.InputChatPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(903730804) - serializeInt64(chatId, buffer: buffer, boxed: false) - photo.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatPhoto", parameters: [("chatId", String(describing: chatId)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editChatTitle(chatId: Int64, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1937260541) - serializeInt64(chatId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatTitle", parameters: [("chatId", String(describing: chatId)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editExportedChatInvite(flags: Int32, peer: Api.InputPeer, link: String, expireDate: Int32?, usageLimit: Int32?, requestNeeded: Api.Bool?, title: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1110823051) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(link, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(expireDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(usageLimit!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {requestNeeded!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.editExportedChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("requestNeeded", String(describing: requestNeeded)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in - let reader = BufferReader(buffer) - var result: Api.messages.ExportedChatInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvite - } - return result - }) - } -} -public extension Api.functions.messages { - static func editFactCheck(peer: Api.InputPeer, msgId: Int32, text: Api.TextWithEntities) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(92925557) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - text.serialize(buffer, true) - return (FunctionDescription(name: "messages.editFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("text", String(describing: text))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editForumTopic(flags: Int32, peer: Api.InputPeer, topicId: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-825487052) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topicId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(iconEmojiId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {closed!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {hidden!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.editForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("title", String(describing: title)), ("iconEmojiId", String(describing: iconEmojiId)), ("closed", String(describing: closed)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editInlineBotMessage(flags: Int32, id: Api.InputBotInlineMessageID, message: String?, media: Api.InputMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2091549254) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - if Int(flags) & Int(1 << 11) != 0 {serializeString(message!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "messages.editInlineBotMessage", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func editMessage(flags: Int32, peer: Api.InputPeer, id: Int32, message: String?, media: Api.InputMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, quickReplyShortcutId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1374175969) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 11) != 0 {serializeString(message!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 14) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 15) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 17) != 0 {serializeInt32(quickReplyShortcutId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.editMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("quickReplyShortcutId", String(describing: quickReplyShortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func editQuickReplyShortcut(shortcutId: Int32, shortcut: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1543519471) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - serializeString(shortcut, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId)), ("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func exportChatInvite(flags: Int32, peer: Api.InputPeer, expireDate: Int32?, usageLimit: Int32?, title: String?, subscriptionPricing: Api.StarsSubscriptionPricing?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1537876336) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(expireDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(usageLimit!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {subscriptionPricing!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.exportChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("title", String(describing: title)), ("subscriptionPricing", String(describing: subscriptionPricing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatInvite? in - let reader = BufferReader(buffer) - var result: Api.ExportedChatInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } - return result - }) - } -} -public extension Api.functions.messages { - static func faveSticker(id: Api.InputDocument, unfave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1174420133) - id.serialize(buffer, true) - unfave.serialize(buffer, true) - return (FunctionDescription(name: "messages.faveSticker", parameters: [("id", String(describing: id)), ("unfave", String(describing: unfave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func forwardMessages(flags: Int32, fromPeer: Api.InputPeer, id: [Int32], randomId: [Int64], toPeer: Api.InputPeer, topMsgId: Int32?, replyTo: Api.InputReplyTo?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, videoTimestamp: Int32?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(326126204) - serializeInt32(flags, buffer: buffer, boxed: false) - fromPeer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(randomId.count)) - for item in randomId { - serializeInt64(item, buffer: buffer, boxed: false) - } - toPeer.serialize(buffer, true) - if Int(flags) & Int(1 << 9) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 22) != 0 {replyTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 24) != 0 {serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {quickReplyShortcut!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 20) != 0 {serializeInt32(videoTimestamp!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 21) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 23) != 0 {suggestedPost!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.forwardMessages", parameters: [("flags", String(describing: flags)), ("fromPeer", String(describing: fromPeer)), ("id", String(describing: id)), ("randomId", String(describing: randomId)), ("toPeer", String(describing: toPeer)), ("topMsgId", String(describing: topMsgId)), ("replyTo", String(describing: replyTo)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("videoTimestamp", String(describing: videoTimestamp)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAdminsWithInvites(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(958457583) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAdminsWithInvites", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatAdminsWithInvites? in - let reader = BufferReader(buffer) - var result: Api.messages.ChatAdminsWithInvites? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ChatAdminsWithInvites - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAllDrafts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1782549861) - - return (FunctionDescription(name: "messages.getAllDrafts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAllStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1197432408) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAllStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.AllStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getArchivedStickers(flags: Int32, offsetId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1475442322) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getArchivedStickers", parameters: [("flags", String(describing: flags)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ArchivedStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.ArchivedStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ArchivedStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAttachMenuBot(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1998676370) - bot.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAttachMenuBot", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBotsBot? in - let reader = BufferReader(buffer) - var result: Api.AttachMenuBotsBot? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AttachMenuBotsBot - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAttachMenuBots(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(385663691) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAttachMenuBots", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBots? in - let reader = BufferReader(buffer) - var result: Api.AttachMenuBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AttachMenuBots - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAttachedStickers(media: Api.InputStickeredMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StickerSetCovered]>) { - let buffer = Buffer() - buffer.appendInt32(-866424884) - media.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAttachedStickers", parameters: [("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StickerSetCovered]? in - let reader = BufferReader(buffer) - var result: [Api.StickerSetCovered]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAvailableEffects(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-559805895) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAvailableEffects", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableEffects? in - let reader = BufferReader(buffer) - var result: Api.messages.AvailableEffects? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AvailableEffects - } - return result - }) - } -} -public extension Api.functions.messages { - static func getAvailableReactions(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(417243308) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAvailableReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableReactions? in - let reader = BufferReader(buffer) - var result: Api.messages.AvailableReactions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AvailableReactions - } - return result - }) - } -} -public extension Api.functions.messages { - static func getBotApp(app: Api.InputBotApp, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(889046467) - app.serialize(buffer, true) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getBotApp", parameters: [("app", String(describing: app)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotApp? in - let reader = BufferReader(buffer) - var result: Api.messages.BotApp? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.BotApp - } - return result - }) - } -} -public extension Api.functions.messages { - static func getBotCallbackAnswer(flags: Int32, peer: Api.InputPeer, msgId: Int32, data: Buffer?, password: Api.InputCheckPasswordSRP?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1824339449) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(data!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {password!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.getBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("data", String(describing: data)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotCallbackAnswer? in - let reader = BufferReader(buffer) - var result: Api.messages.BotCallbackAnswer? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.BotCallbackAnswer - } - return result - }) - } -} -public extension Api.functions.messages { - static func getChatInviteImporters(flags: Int32, peer: Api.InputPeer, link: String?, q: String?, offsetDate: Int32, offsetUser: Api.InputUser, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-553329330) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(link!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(q!, buffer: buffer, boxed: false)} - serializeInt32(offsetDate, buffer: buffer, boxed: false) - offsetUser.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getChatInviteImporters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetUser", String(describing: offsetUser)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatInviteImporters? in - let reader = BufferReader(buffer) - var result: Api.messages.ChatInviteImporters? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ChatInviteImporters - } - return result - }) - } -} -public extension Api.functions.messages { - static func getChats(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1240027791) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getChats", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } -} -public extension Api.functions.messages { - static func getCommonChats(userId: Api.InputUser, maxId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-468934396) - userId.serialize(buffer, true) - serializeInt64(maxId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getCommonChats", parameters: [("userId", String(describing: userId)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } -} -public extension Api.functions.messages { - static func getCustomEmojiDocuments(documentId: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Document]>) { - let buffer = Buffer() - buffer.appendInt32(-643100844) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documentId.count)) - for item in documentId { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getCustomEmojiDocuments", parameters: [("documentId", String(describing: documentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Document]? in - let reader = BufferReader(buffer) - var result: [Api.Document]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDefaultHistoryTTL() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1703637384) - - return (FunctionDescription(name: "messages.getDefaultHistoryTTL", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DefaultHistoryTTL? in - let reader = BufferReader(buffer) - var result: Api.DefaultHistoryTTL? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.DefaultHistoryTTL - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDefaultTagReactions(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1107741656) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDefaultTagReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in - let reader = BufferReader(buffer) - var result: Api.messages.Reactions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Reactions - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDhConfig(version: Int32, randomLength: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(651135312) - serializeInt32(version, buffer: buffer, boxed: false) - serializeInt32(randomLength, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDhConfig", parameters: [("version", String(describing: version)), ("randomLength", String(describing: randomLength))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DhConfig? in - let reader = BufferReader(buffer) - var result: Api.messages.DhConfig? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.DhConfig - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDialogFilters() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-271283063) - - return (FunctionDescription(name: "messages.getDialogFilters", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DialogFilters? in - let reader = BufferReader(buffer) - var result: Api.messages.DialogFilters? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.DialogFilters - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDialogUnreadMarks(flags: Int32, parentPeer: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.DialogPeer]>) { - let buffer = Buffer() - buffer.appendInt32(555754018) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {parentPeer!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.getDialogUnreadMarks", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogPeer]? in - let reader = BufferReader(buffer) - var result: [Api.DialogPeer]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDialogs(flags: Int32, folderId: Int32?, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1594569905) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Dialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.Dialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Dialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDiscussionMessage(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1147761405) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDiscussionMessage", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DiscussionMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.DiscussionMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.DiscussionMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func getDocumentByHash(sha256: Buffer, size: Int64, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1309538785) - serializeBytes(sha256, buffer: buffer, boxed: false) - serializeInt64(size, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDocumentByHash", parameters: [("sha256", String(describing: sha256)), ("size", String(describing: size)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in - let reader = BufferReader(buffer) - var result: Api.Document? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Document - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiGameInfo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-75592537) - - return (FunctionDescription(name: "messages.getEmojiGameInfo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGameInfo? in - let reader = BufferReader(buffer) - var result: Api.messages.EmojiGameInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameInfo - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1955122779) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in - let reader = BufferReader(buffer) - var result: Api.messages.EmojiGroups? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiKeywords(langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(899735650) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiKeywords", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in - let reader = BufferReader(buffer) - var result: Api.EmojiKeywordsDifference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiKeywordsDifference - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiKeywordsDifference(langCode: String, fromVersion: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(352892591) - serializeString(langCode, buffer: buffer, boxed: false) - serializeInt32(fromVersion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiKeywordsDifference", parameters: [("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in - let reader = BufferReader(buffer) - var result: Api.EmojiKeywordsDifference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiKeywordsDifference - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiKeywordsLanguages(langCodes: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.EmojiLanguage]>) { - let buffer = Buffer() - buffer.appendInt32(1318675378) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(langCodes.count)) - for item in langCodes { - serializeString(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getEmojiKeywordsLanguages", parameters: [("langCodes", String(describing: langCodes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.EmojiLanguage]? in - let reader = BufferReader(buffer) - var result: [Api.EmojiLanguage]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiLanguage.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiProfilePhotoGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(564480243) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiProfilePhotoGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in - let reader = BufferReader(buffer) - var result: Api.messages.EmojiGroups? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiStatusGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(785209037) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStatusGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in - let reader = BufferReader(buffer) - var result: Api.messages.EmojiGroups? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiStickerGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(500711669) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStickerGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in - let reader = BufferReader(buffer) - var result: Api.messages.EmojiGroups? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-67329649) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.AllStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getEmojiURL(langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-709817306) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiURL", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiURL? in - let reader = BufferReader(buffer) - var result: Api.EmojiURL? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiURL - } - return result - }) - } -} -public extension Api.functions.messages { - static func getExportedChatInvite(peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1937010524) - peer.serialize(buffer, true) - serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in - let reader = BufferReader(buffer) - var result: Api.messages.ExportedChatInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvite - } - return result - }) - } -} -public extension Api.functions.messages { - static func getExportedChatInvites(flags: Int32, peer: Api.InputPeer, adminId: Api.InputUser, offsetDate: Int32?, offsetLink: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1565154314) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - adminId.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(offsetDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(offsetLink!, buffer: buffer, boxed: false)} - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getExportedChatInvites", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("adminId", String(describing: adminId)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvites? in - let reader = BufferReader(buffer) - var result: Api.messages.ExportedChatInvites? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvites - } - return result - }) - } -} -public extension Api.functions.messages { - static func getExtendedMedia(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2064119788) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getExtendedMedia", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getFactCheck(peer: Api.InputPeer, msgId: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FactCheck]>) { - let buffer = Buffer() - buffer.appendInt32(-1177696786) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(msgId.count)) - for item in msgId { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FactCheck]? in - let reader = BufferReader(buffer) - var result: [Api.FactCheck]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FactCheck.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getFavedStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(82946729) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFavedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FavedStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.FavedStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FavedStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getFeaturedEmojiStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(248473398) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFeaturedEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.FeaturedStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getFeaturedStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1685588756) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFeaturedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.FeaturedStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getForumTopics(flags: Int32, peer: Api.InputPeer, q: String?, offsetDate: Int32, offsetId: Int32, offsetTopic: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1000635391) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(q!, buffer: buffer, boxed: false)} - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(offsetTopic, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetTopic", String(describing: offsetTopic)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in - let reader = BufferReader(buffer) - var result: Api.messages.ForumTopics? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ForumTopics - } - return result - }) - } -} -public extension Api.functions.messages { - static func getForumTopicsByID(peer: Api.InputPeer, topics: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1358280184) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(topics.count)) - for item in topics { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getForumTopicsByID", parameters: [("peer", String(describing: peer)), ("topics", String(describing: topics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in - let reader = BufferReader(buffer) - var result: Api.messages.ForumTopics? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ForumTopics - } - return result - }) - } -} -public extension Api.functions.messages { - static func getFullChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1364194508) - serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFullChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in - let reader = BufferReader(buffer) - var result: Api.messages.ChatFull? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ChatFull - } - return result - }) - } -} -public extension Api.functions.messages { - static func getGameHighScores(peer: Api.InputPeer, id: Int32, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-400399203) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.getGameHighScores", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in - let reader = BufferReader(buffer) - var result: Api.messages.HighScores? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.HighScores - } - return result - }) - } -} -public extension Api.functions.messages { - static func getHistory(peer: Api.InputPeer, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1143203525) - peer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getHistory", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getInlineBotResults(flags: Int32, bot: Api.InputUser, peer: Api.InputPeer, geoPoint: Api.InputGeoPoint?, query: String, offset: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1364105629) - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {geoPoint!.serialize(buffer, true)} - serializeString(query, buffer: buffer, boxed: false) - serializeString(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getInlineBotResults", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("geoPoint", String(describing: geoPoint)), ("query", String(describing: query)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotResults? in - let reader = BufferReader(buffer) - var result: Api.messages.BotResults? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.BotResults - } - return result - }) - } -} -public extension Api.functions.messages { - static func getInlineGameHighScores(id: Api.InputBotInlineMessageID, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(258170395) - id.serialize(buffer, true) - userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.getInlineGameHighScores", parameters: [("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in - let reader = BufferReader(buffer) - var result: Api.messages.HighScores? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.HighScores - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMaskStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1678738104) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMaskStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.AllStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessageEditData(peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-39416522) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageEditData", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageEditData? in - let reader = BufferReader(buffer) - var result: Api.messages.MessageEditData? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.MessageEditData - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessageReactionsList(flags: Int32, peer: Api.InputPeer, id: Int32, reaction: Api.Reaction?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1176190792) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {reaction!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(offset!, buffer: buffer, boxed: false)} - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageReactionsList? in - let reader = BufferReader(buffer) - var result: Api.messages.MessageReactionsList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.MessageReactionsList - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessageReadParticipants(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ReadParticipantDate]>) { - let buffer = Buffer() - buffer.appendInt32(834782287) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageReadParticipants", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReadParticipantDate]? in - let reader = BufferReader(buffer) - var result: [Api.ReadParticipantDate]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReadParticipantDate.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessages(id: [Api.InputMessage]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1673946374) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.getMessages", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessagesReactions(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1950707482) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getMessagesReactions", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMessagesViews(peer: Api.InputPeer, id: [Int32], increment: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1468322785) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - increment.serialize(buffer, true) - return (FunctionDescription(name: "messages.getMessagesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("increment", String(describing: increment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageViews? in - let reader = BufferReader(buffer) - var result: Api.messages.MessageViews? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.MessageViews - } - return result - }) - } -} -public extension Api.functions.messages { - static func getMyStickers(offsetId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-793386500) - serializeInt64(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMyStickers", parameters: [("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MyStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.MyStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.MyStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getOldFeaturedStickers(offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2127598753) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getOldFeaturedStickers", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.FeaturedStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getOnlines(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1848369232) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getOnlines", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatOnlines? in - let reader = BufferReader(buffer) - var result: Api.ChatOnlines? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ChatOnlines - } - return result - }) - } -} -public extension Api.functions.messages { - static func getOutboxReadDate(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1941176739) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getOutboxReadDate", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.OutboxReadDate? in - let reader = BufferReader(buffer) - var result: Api.OutboxReadDate? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.OutboxReadDate - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPaidReactionPrivacy() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1193563562) - - return (FunctionDescription(name: "messages.getPaidReactionPrivacy", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPeerDialogs(peers: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-462373635) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.getPeerDialogs", parameters: [("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.PeerDialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.PeerDialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPeerSettings(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-270948702) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getPeerSettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerSettings? in - let reader = BufferReader(buffer) - var result: Api.messages.PeerSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.PeerSettings - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPinnedDialogs(folderId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-692498958) - serializeInt32(folderId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPinnedDialogs", parameters: [("folderId", String(describing: folderId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.PeerDialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.PeerDialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPinnedSavedDialogs() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-700607264) - - return (FunctionDescription(name: "messages.getPinnedSavedDialogs", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedDialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPollResults(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1941660731) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPollVotes(flags: Int32, peer: Api.InputPeer, id: Int32, option: Buffer?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1200736242) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeBytes(option!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(offset!, buffer: buffer, boxed: false)} - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.VotesList? in - let reader = BufferReader(buffer) - var result: Api.messages.VotesList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.VotesList - } - return result - }) - } -} -public extension Api.functions.messages { - static func getPreparedInlineMessage(bot: Api.InputUser, id: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2055291464) - bot.serialize(buffer, true) - serializeString(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPreparedInlineMessage", parameters: [("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PreparedInlineMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.PreparedInlineMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.PreparedInlineMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func getQuickReplies(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-729550168) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getQuickReplies", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.QuickReplies? in - let reader = BufferReader(buffer) - var result: Api.messages.QuickReplies? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.QuickReplies - } - return result - }) - } -} -public extension Api.functions.messages { - static func getQuickReplyMessages(flags: Int32, shortcutId: Int32, id: [Int32]?, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1801153085) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id!.count)) - for item in id! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getQuickReplyMessages", parameters: [("flags", String(describing: flags)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getRecentLocations(peer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1881817312) - peer.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentLocations", parameters: [("peer", String(describing: peer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getRecentReactions(limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(960896434) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in - let reader = BufferReader(buffer) - var result: Api.messages.Reactions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Reactions - } - return result - }) - } -} -public extension Api.functions.messages { - static func getRecentStickers(flags: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1649852357) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentStickers", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.RecentStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.RecentStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.RecentStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getReplies(peer: Api.InputPeer, msgId: Int32, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(584962828) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getReplies", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSavedDialogs(flags: Int32, parentPeer: Api.InputPeer?, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(512883865) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {parentPeer!.serialize(buffer, true)} - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedDialogs", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedDialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSavedDialogsByID(flags: Int32, parentPeer: Api.InputPeer?, ids: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1869585558) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {parentPeer!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ids.count)) - for item in ids { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.getSavedDialogsByID", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("ids", String(describing: ids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedDialogs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSavedGifs(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1559270965) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedGifs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedGifs? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedGifs? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedGifs - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSavedHistory(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputPeer, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1718964215) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {parentPeer!.serialize(buffer, true)} - peer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(offsetDate, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSavedReactionTags(flags: Int32, peer: Api.InputPeer?, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(909631579) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {peer!.serialize(buffer, true)} - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedReactionTags", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedReactionTags? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedReactionTags? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedReactionTags - } - return result - }) - } -} -public extension Api.functions.messages { - static func getScheduledHistory(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-183077365) - peer.serialize(buffer, true) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getScheduledHistory", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1111817116) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.getScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSearchCounters(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, topMsgId: Int32?, filters: [Api.MessagesFilter]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.messages.SearchCounter]>) { - let buffer = Buffer() - buffer.appendInt32(465367808) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {savedPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(filters.count)) - for item in filters { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.getSearchCounters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("topMsgId", String(describing: topMsgId)), ("filters", String(describing: filters))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.messages.SearchCounter]? in - let reader = BufferReader(buffer) - var result: [Api.messages.SearchCounter]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.messages.SearchCounter.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSearchResultsCalendar(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, filter: Api.MessagesFilter, offsetId: Int32, offsetDate: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1789130429) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {savedPeerId!.serialize(buffer, true)} - filter.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(offsetDate, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSearchResultsCalendar", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsCalendar? in - let reader = BufferReader(buffer) - var result: Api.messages.SearchResultsCalendar? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SearchResultsCalendar - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSearchResultsPositions(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, filter: Api.MessagesFilter, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1669386480) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {savedPeerId!.serialize(buffer, true)} - filter.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSearchResultsPositions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsPositions? in - let reader = BufferReader(buffer) - var result: Api.messages.SearchResultsPositions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SearchResultsPositions - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSplitRanges() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.MessageRange]>) { - let buffer = Buffer() - buffer.appendInt32(486505992) - - return (FunctionDescription(name: "messages.getSplitRanges", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.MessageRange]? in - let reader = BufferReader(buffer) - var result: [Api.MessageRange]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageRange.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSponsoredMessages(flags: Int32, peer: Api.InputPeer, msgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1030547536) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(msgId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.getSponsoredMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SponsoredMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.SponsoredMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SponsoredMessages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getStickerSet(stickerset: Api.InputStickerSet, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-928977804) - stickerset.serialize(buffer, true) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } -} -public extension Api.functions.messages { - static func getStickers(emoticon: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-710552671) - serializeString(emoticon, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getStickers", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Stickers? in - let reader = BufferReader(buffer) - var result: Api.messages.Stickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Stickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func getSuggestedDialogFilters() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.DialogFilterSuggested]>) { - let buffer = Buffer() - buffer.appendInt32(-1566780372) - - return (FunctionDescription(name: "messages.getSuggestedDialogFilters", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogFilterSuggested]? in - let reader = BufferReader(buffer) - var result: [Api.DialogFilterSuggested]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogFilterSuggested.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func getTopReactions(limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1149164102) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getTopReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in - let reader = BufferReader(buffer) - var result: Api.messages.Reactions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Reactions - } - return result - }) - } -} -public extension Api.functions.messages { - static func getUnreadMentions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-251140208) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getUnreadMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getUnreadReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1115713364) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getUnreadReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func getWebPage(url: String, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1919511901) - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getWebPage", parameters: [("url", String(describing: url)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPage? in - let reader = BufferReader(buffer) - var result: Api.messages.WebPage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.WebPage - } - return result - }) - } -} -public extension Api.functions.messages { - static func getWebPagePreview(flags: Int32, message: String, entities: [Api.MessageEntity]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1460498287) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "messages.getWebPagePreview", parameters: [("flags", String(describing: flags)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPagePreview? in - let reader = BufferReader(buffer) - var result: Api.messages.WebPagePreview? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.WebPagePreview - } - return result - }) - } -} -public extension Api.functions.messages { - static func hideAllChatJoinRequests(flags: Int32, peer: Api.InputPeer, link: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-528091926) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(link!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.hideAllChatJoinRequests", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func hideChatJoinRequest(flags: Int32, peer: Api.InputPeer, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2145904661) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.hideChatJoinRequest", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func hidePeerSettingsBar(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1336717624) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.hidePeerSettingsBar", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func importChatInvite(hash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1817183516) - serializeString(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.importChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func initHistoryImport(peer: Api.InputPeer, file: Api.InputFile, mediaCount: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(873008187) - peer.serialize(buffer, true) - file.serialize(buffer, true) - serializeInt32(mediaCount, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.initHistoryImport", parameters: [("peer", String(describing: peer)), ("file", String(describing: file)), ("mediaCount", String(describing: mediaCount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImport? in - let reader = BufferReader(buffer) - var result: Api.messages.HistoryImport? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.HistoryImport - } - return result - }) - } -} -public extension Api.functions.messages { - static func installStickerSet(stickerset: Api.InputStickerSet, archived: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-946871200) - stickerset.serialize(buffer, true) - archived.serialize(buffer, true) - return (FunctionDescription(name: "messages.installStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("archived", String(describing: archived))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSetInstallResult? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSetInstallResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSetInstallResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func markDialogUnread(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1940912392) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {parentPeer!.serialize(buffer, true)} - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.markDialogUnread", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func migrateChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1568189671) - serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.migrateChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func prolongWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, queryId: Int64, replyTo: Api.InputReplyTo?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1328014717) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - bot.serialize(buffer, true) - serializeInt64(queryId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.prolongWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("queryId", String(describing: queryId)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func rateTranscribedAudio(peer: Api.InputPeer, msgId: Int32, transcriptionId: Int64, good: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2132608815) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(transcriptionId, buffer: buffer, boxed: false) - good.serialize(buffer, true) - return (FunctionDescription(name: "messages.rateTranscribedAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("transcriptionId", String(describing: transcriptionId)), ("good", String(describing: good))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func readDiscussion(peer: Api.InputPeer, msgId: Int32, readMaxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-147740172) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(readMaxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readDiscussion", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("readMaxId", String(describing: readMaxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func readEncryptedHistory(peer: Api.InputEncryptedChat, maxDate: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2135648522) - peer.serialize(buffer, true) - serializeInt32(maxDate, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readEncryptedHistory", parameters: [("peer", String(describing: peer)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func readFeaturedStickers(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1527873830) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.readFeaturedStickers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func readHistory(peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(238054714) - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readHistory", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages - } - return result - }) - } -} -public extension Api.functions.messages { - static func readMentions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(921026381) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.readMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func readMessageContents(id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(916930423) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.readMessageContents", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedMessages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages - } - return result - }) - } -} -public extension Api.functions.messages { - static func readReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1631301741) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.readReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func readSavedHistory(parentPeer: Api.InputPeer, peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1169540261) - parentPeer.serialize(buffer, true) - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readSavedHistory", parameters: [("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func receivedMessages(maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ReceivedNotifyMessage]>) { - let buffer = Buffer() - buffer.appendInt32(94983360) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.receivedMessages", parameters: [("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReceivedNotifyMessage]? in - let reader = BufferReader(buffer) - var result: [Api.ReceivedNotifyMessage]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReceivedNotifyMessage.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func receivedQueue(maxQts: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int64]>) { - let buffer = Buffer() - buffer.appendInt32(1436924774) - serializeInt32(maxQts, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.receivedQueue", parameters: [("maxQts", String(describing: maxQts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in - let reader = BufferReader(buffer) - var result: [Int64]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - return result - }) - } -} -public extension Api.functions.messages { - static func reorderPinnedDialogs(flags: Int32, folderId: Int32, order: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(991616823) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(folderId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.reorderPinnedDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reorderPinnedForumTopics(flags: Int32, peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(242762224) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.reorderPinnedForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func reorderPinnedSavedDialogs(flags: Int32, order: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1955502713) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.reorderPinnedSavedDialogs", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reorderQuickReplies(order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1613961479) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.reorderQuickReplies", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reorderStickerSets(flags: Int32, order: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2016638777) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.reorderStickerSets", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func report(peer: Api.InputPeer, id: [Int32], option: Buffer, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-59199589) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeBytes(option, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in - let reader = BufferReader(buffer) - var result: Api.ReportResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ReportResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func reportEncryptedSpam(peer: Api.InputEncryptedChat) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1259113487) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportEncryptedSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reportMessagesDelivery(flags: Int32, peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1517122453) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.reportMessagesDelivery", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reportReaction(peer: Api.InputPeer, id: Int32, reactionPeer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1063567478) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - reactionPeer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportReaction", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("reactionPeer", String(describing: reactionPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reportSpam(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-820669733) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func reportSponsoredMessage(randomId: Buffer, option: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(315355332) - serializeBytes(randomId, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.reportSponsoredMessage", parameters: [("randomId", String(describing: randomId)), ("option", String(describing: option))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SponsoredMessageReportResult? in - let reader = BufferReader(buffer) - var result: Api.channels.SponsoredMessageReportResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.SponsoredMessageReportResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestAppWebView(flags: Int32, peer: Api.InputPeer, app: Api.InputBotApp, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1398901710) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - app.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(startParam!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {themeParams!.serialize(buffer, true)} - serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestAppWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("app", String(describing: app)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in - let reader = BufferReader(buffer) - var result: Api.WebViewResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WebViewResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestEncryption(userId: Api.InputUser, randomId: Int32, gA: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-162681021) - userId.serialize(buffer, true) - serializeInt32(randomId, buffer: buffer, boxed: false) - serializeBytes(gA, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestEncryption", parameters: [("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gA", String(describing: gA))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in - let reader = BufferReader(buffer) - var result: Api.EncryptedChat? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EncryptedChat - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestMainWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-908059013) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - bot.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(startParam!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {themeParams!.serialize(buffer, true)} - serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestMainWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in - let reader = BufferReader(buffer) - var result: Api.WebViewResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WebViewResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestSimpleWebView(flags: Int32, bot: Api.InputUser, url: String?, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1094336115) - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - if Int(flags) & Int(1 << 3) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeString(startParam!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {themeParams!.serialize(buffer, true)} - serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestSimpleWebView", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in - let reader = BufferReader(buffer) - var result: Api.WebViewResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WebViewResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestUrlAuth(flags: Int32, peer: Api.InputPeer?, msgId: Int32?, buttonId: Int32?, url: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(428848198) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(msgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(buttonId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.requestUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in - let reader = BufferReader(buffer) - var result: Api.UrlAuthResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.UrlAuthResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func requestWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, url: String?, startParam: String?, themeParams: Api.DataJSON?, platform: String, replyTo: Api.InputReplyTo?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(647873217) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - bot.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(startParam!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {themeParams!.serialize(buffer, true)} - serializeString(platform, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.requestWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in - let reader = BufferReader(buffer) - var result: Api.WebViewResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WebViewResult - } - return result - }) - } -} -public extension Api.functions.messages { - static func saveDefaultSendAs(peer: Api.InputPeer, sendAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-855777386) - peer.serialize(buffer, true) - sendAs.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveDefaultSendAs", parameters: [("peer", String(describing: peer)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func saveDraft(flags: Int32, replyTo: Api.InputReplyTo?, peer: Api.InputPeer, message: String, entities: [Api.MessageEntity]?, media: Api.InputMedia?, effect: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1420701838) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {replyTo!.serialize(buffer, true)} - peer.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 5) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {suggestedPost!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.saveDraft", parameters: [("flags", String(describing: flags)), ("replyTo", String(describing: replyTo)), ("peer", String(describing: peer)), ("message", String(describing: message)), ("entities", String(describing: entities)), ("media", String(describing: media)), ("effect", String(describing: effect)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func saveGif(id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(846868683) - id.serialize(buffer, true) - unsave.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveGif", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func savePreparedInlineMessage(flags: Int32, result: Api.InputBotInlineResult, userId: Api.InputUser, peerTypes: [Api.InlineQueryPeerType]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-232816849) - serializeInt32(flags, buffer: buffer, boxed: false) - result.serialize(buffer, true) - userId.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peerTypes!.count)) - for item in peerTypes! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "messages.savePreparedInlineMessage", parameters: [("flags", String(describing: flags)), ("result", String(describing: result)), ("userId", String(describing: userId)), ("peerTypes", String(describing: peerTypes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotPreparedInlineMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.BotPreparedInlineMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.BotPreparedInlineMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func saveRecentSticker(flags: Int32, id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(958863608) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - unsave.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveRecentSticker", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func search(flags: Int32, peer: Api.InputPeer, q: String, fromId: Api.InputPeer?, savedPeerId: Api.InputPeer?, savedReaction: [Api.Reaction]?, topMsgId: Int32?, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(703497338) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(q, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {fromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {savedPeerId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(savedReaction!.count)) - for item in savedReaction! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - filter.serialize(buffer, true) - serializeInt32(minDate, buffer: buffer, boxed: false) - serializeInt32(maxDate, buffer: buffer, boxed: false) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(addOffset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt32(maxId, buffer: buffer, boxed: false) - serializeInt32(minId, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.search", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("fromId", String(describing: fromId)), ("savedPeerId", String(describing: savedPeerId)), ("savedReaction", String(describing: savedReaction)), ("topMsgId", String(describing: topMsgId)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchCustomEmoji(emoticon: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(739360983) - serializeString(emoticon, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchCustomEmoji", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in - let reader = BufferReader(buffer) - var result: Api.EmojiList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EmojiList - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchEmojiStickerSets(flags: Int32, q: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1833678516) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(q, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchEmojiStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in - let reader = BufferReader(buffer) - var result: Api.messages.FoundStickerSets? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickerSets - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchGlobal(flags: Int32, folderId: Int32?, q: String, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetRate: Int32, offsetPeer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1271290010) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - serializeString(q, buffer: buffer, boxed: false) - filter.serialize(buffer, true) - serializeInt32(minDate, buffer: buffer, boxed: false) - serializeInt32(maxDate, buffer: buffer, boxed: false) - serializeInt32(offsetRate, buffer: buffer, boxed: false) - offsetPeer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchGlobal", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("q", String(describing: q)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchSentMedia(q: String, filter: Api.MessagesFilter, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(276705696) - serializeString(q, buffer: buffer, boxed: false) - filter.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchSentMedia", parameters: [("q", String(describing: q)), ("filter", String(describing: filter)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in - let reader = BufferReader(buffer) - var result: Api.messages.Messages? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Messages - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchStickerSets(flags: Int32, q: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(896555914) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(q, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in - let reader = BufferReader(buffer) - var result: Api.messages.FoundStickerSets? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickerSets - } - return result - }) - } -} -public extension Api.functions.messages { - static func searchStickers(flags: Int32, q: String, emoticon: String, langCode: [String], offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(699516522) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(q, buffer: buffer, boxed: false) - serializeString(emoticon, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(langCode.count)) - for item in langCode { - serializeString(item, buffer: buffer, boxed: false) - } - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchStickers", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("emoticon", String(describing: emoticon)), ("langCode", String(describing: langCode)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickers? in - let reader = BufferReader(buffer) - var result: Api.messages.FoundStickers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickers - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendBotRequestedPeer(peer: Api.InputPeer, msgId: Int32, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1850552224) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(buttonId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(requestedPeers.count)) - for item in requestedPeers { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.sendBotRequestedPeer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("requestedPeers", String(describing: requestedPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendEncrypted(flags: Int32, peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1157265941) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendEncrypted", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.SentEncryptedMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendEncryptedFile(flags: Int32, peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer, file: Api.InputEncryptedFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1431914525) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeBytes(data, buffer: buffer, boxed: false) - file.serialize(buffer, true) - return (FunctionDescription(name: "messages.sendEncryptedFile", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.SentEncryptedMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendEncryptedService(peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(852769188) - peer.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendEncryptedService", parameters: [("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in - let reader = BufferReader(buffer) - var result: Api.messages.SentEncryptedMessage? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendInlineBotResult(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, randomId: Int64, queryId: Int64, id: String, scheduleDate: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1060145594) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {quickReplyShortcut!.serialize(buffer, true)} - if Int(flags) & Int(1 << 21) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.sendInlineBotResult", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId)), ("queryId", String(describing: queryId)), ("id", String(describing: id)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendMedia(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, media: Api.InputMedia, message: String, randomId: Int64, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(53536639) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - media.serialize(buffer, true) - serializeString(message, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 24) != 0 {serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {quickReplyShortcut!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 21) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 22) != 0 {suggestedPost!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.sendMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("media", String(describing: media)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendMessage(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, message: String, randomId: Int64, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1415369050) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - serializeString(message, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 24) != 0 {serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {quickReplyShortcut!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 21) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 22) != 0 {suggestedPost!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.sendMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendMultiMedia(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, multiMedia: [Api.InputSingleMedia], scheduleDate: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(469278068) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {replyTo!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(multiMedia.count)) - for item in multiMedia { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {sendAs!.serialize(buffer, true)} - if Int(flags) & Int(1 << 17) != 0 {quickReplyShortcut!.serialize(buffer, true)} - if Int(flags) & Int(1 << 18) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 21) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.sendMultiMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("multiMedia", String(describing: multiMedia)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendPaidReaction(flags: Int32, peer: Api.InputPeer, msgId: Int32, count: Int32, randomId: Int64, `private`: Api.PaidReactionPrivacy?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1488702288) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt32(count, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {`private`!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.sendPaidReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("count", String(describing: count)), ("randomId", String(describing: randomId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendQuickReplyMessages(peer: Api.InputPeer, shortcutId: Int32, id: [Int32], randomId: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1819610593) - peer.serialize(buffer, true) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(randomId.count)) - for item in randomId { - serializeInt64(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.sendQuickReplyMessages", parameters: [("peer", String(describing: peer)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendReaction(flags: Int32, peer: Api.InputPeer, msgId: Int32, reaction: [Api.Reaction]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-754091820) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reaction!.count)) - for item in reaction! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "messages.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1120369398) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.sendScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendScreenshotNotification(peer: Api.InputPeer, replyTo: Api.InputReplyTo, randomId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1589618665) - peer.serialize(buffer, true) - replyTo.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendScreenshotNotification", parameters: [("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendVote(peer: Api.InputPeer, msgId: Int32, options: [Buffer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(283795844) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(options.count)) - for item in options { - serializeBytes(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.sendVote", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("options", String(describing: options))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendWebViewData(bot: Api.InputUser, randomId: Int64, buttonText: String, data: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-603831608) - bot.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeString(buttonText, buffer: buffer, boxed: false) - serializeString(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendWebViewData", parameters: [("bot", String(describing: bot)), ("randomId", String(describing: randomId)), ("buttonText", String(describing: buttonText)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func sendWebViewResultMessage(botQueryId: String, result: Api.InputBotInlineResult) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(172168437) - serializeString(botQueryId, buffer: buffer, boxed: false) - result.serialize(buffer, true) - return (FunctionDescription(name: "messages.sendWebViewResultMessage", parameters: [("botQueryId", String(describing: botQueryId)), ("result", String(describing: result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewMessageSent? in - let reader = BufferReader(buffer) - var result: Api.WebViewMessageSent? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.WebViewMessageSent - } - return result - }) - } -} -public extension Api.functions.messages { - static func setBotCallbackAnswer(flags: Int32, queryId: Int64, message: String?, url: String?, cacheTime: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-712043766) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(message!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - serializeInt32(cacheTime, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("message", String(describing: message)), ("url", String(describing: url)), ("cacheTime", String(describing: cacheTime))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setBotPrecheckoutResults(flags: Int32, queryId: Int64, error: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(163765653) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(error!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.setBotPrecheckoutResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setBotShippingResults(flags: Int32, queryId: Int64, error: String?, shippingOptions: [Api.ShippingOption]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-436833542) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(error!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(shippingOptions!.count)) - for item in shippingOptions! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "messages.setBotShippingResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error)), ("shippingOptions", String(describing: shippingOptions))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setChatAvailableReactions(flags: Int32, peer: Api.InputPeer, availableReactions: Api.ChatReactions, reactionsLimit: Int32?, paidEnabled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2041895551) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - availableReactions.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(reactionsLimit!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {paidEnabled!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.setChatAvailableReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("availableReactions", String(describing: availableReactions)), ("reactionsLimit", String(describing: reactionsLimit)), ("paidEnabled", String(describing: paidEnabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func setChatTheme(peer: Api.InputPeer, theme: Api.InputChatTheme) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(135398089) - peer.serialize(buffer, true) - theme.serialize(buffer, true) - return (FunctionDescription(name: "messages.setChatTheme", parameters: [("peer", String(describing: peer)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func setChatWallPaper(flags: Int32, peer: Api.InputPeer, wallpaper: Api.InputWallPaper?, settings: Api.WallPaperSettings?, id: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1879389471) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {wallpaper!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {settings!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(id!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.setChatWallPaper", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func setDefaultHistoryTTL(period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1632299963) - serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setDefaultHistoryTTL", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setDefaultReaction(reaction: Api.Reaction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1330094102) - reaction.serialize(buffer, true) - return (FunctionDescription(name: "messages.setDefaultReaction", parameters: [("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setEncryptedTyping(peer: Api.InputEncryptedChat, typing: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2031374829) - peer.serialize(buffer, true) - typing.serialize(buffer, true) - return (FunctionDescription(name: "messages.setEncryptedTyping", parameters: [("peer", String(describing: peer)), ("typing", String(describing: typing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setGameScore(flags: Int32, peer: Api.InputPeer, id: Int32, userId: Api.InputUser, score: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1896289088) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeInt32(score, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setGameScore", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func setHistoryTTL(peer: Api.InputPeer, period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1207017500) - peer.serialize(buffer, true) - serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setHistoryTTL", parameters: [("peer", String(describing: peer)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func setInlineBotResults(flags: Int32, queryId: Int64, results: [Api.InputBotInlineResult], cacheTime: Int32, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1156406247) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(queryId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(results.count)) - for item in results { - item.serialize(buffer, true) - } - serializeInt32(cacheTime, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {switchPm!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {switchWebview!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.setInlineBotResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("results", String(describing: results)), ("cacheTime", String(describing: cacheTime)), ("nextOffset", String(describing: nextOffset)), ("switchPm", String(describing: switchPm)), ("switchWebview", String(describing: switchWebview))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setInlineGameScore(flags: Int32, id: Api.InputBotInlineMessageID, userId: Api.InputUser, score: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(363700068) - serializeInt32(flags, buffer: buffer, boxed: false) - id.serialize(buffer, true) - userId.serialize(buffer, true) - serializeInt32(score, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setInlineGameScore", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func setTyping(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, action: Api.SendMessageAction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1486110434) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - action.serialize(buffer, true) - return (FunctionDescription(name: "messages.setTyping", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("action", String(describing: action))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func startBot(bot: Api.InputUser, peer: Api.InputPeer, randomId: Int64, startParam: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-421563528) - bot.serialize(buffer, true) - peer.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeString(startParam, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.startBot", parameters: [("bot", String(describing: bot)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("startParam", String(describing: startParam))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func startHistoryImport(peer: Api.InputPeer, importId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1271008444) - peer.serialize(buffer, true) - serializeInt64(importId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.startHistoryImport", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func summarizeText(flags: Int32, peer: Api.InputPeer, id: Int32, toLang: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1656683294) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(toLang!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in - let reader = BufferReader(buffer) - var result: Api.TextWithEntities? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleBotInAttachMenu(flags: Int32, bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1777704297) - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleBotInAttachMenu", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleDialogFilterTags(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-47326647) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleDialogFilterTags", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleDialogPin(flags: Int32, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1489903017) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleNoForwards(peer: Api.InputPeer, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1323389022) - peer.serialize(buffer, true) - enabled.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleNoForwards", parameters: [("peer", String(describing: peer)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func togglePaidReactionPrivacy(peer: Api.InputPeer, msgId: Int32, `private`: Api.PaidReactionPrivacy) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1129874869) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - `private`.serialize(buffer, true) - return (FunctionDescription(name: "messages.togglePaidReactionPrivacy", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func togglePeerTranslations(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-461589127) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.togglePeerTranslations", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleSavedDialogPin(flags: Int32, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1400783906) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleSavedDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleStickerSets(flags: Int32, stickersets: [Api.InputStickerSet]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1257951254) - serializeInt32(flags, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickersets.count)) - for item in stickersets { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.toggleStickerSets", parameters: [("flags", String(describing: flags)), ("stickersets", String(describing: stickersets))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleSuggestedPostApproval(flags: Int32, peer: Api.InputPeer, msgId: Int32, scheduleDate: Int32?, rejectComment: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2130229924) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(rejectComment!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.toggleSuggestedPostApproval", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("scheduleDate", String(describing: scheduleDate)), ("rejectComment", String(describing: rejectComment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func toggleTodoCompleted(peer: Api.InputPeer, msgId: Int32, completed: [Int32], incompleted: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-740282076) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(completed.count)) - for item in completed { - serializeInt32(item, buffer: buffer, boxed: false) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(incompleted.count)) - for item in incompleted { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.toggleTodoCompleted", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("completed", String(describing: completed)), ("incompleted", String(describing: incompleted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func transcribeAudio(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(647928393) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.transcribeAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranscribedAudio? in - let reader = BufferReader(buffer) - var result: Api.messages.TranscribedAudio? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.TranscribedAudio - } - return result - }) - } -} -public extension Api.functions.messages { - static func translateText(flags: Int32, peer: Api.InputPeer?, id: [Int32]?, text: [Api.TextWithEntities]?, toLang: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1662529584) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {peer!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id!.count)) - for item in id! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(text!.count)) - for item in text! { - item.serialize(buffer, true) - }} - serializeString(toLang, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.translateText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("text", String(describing: text)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranslatedText? in - let reader = BufferReader(buffer) - var result: Api.messages.TranslatedText? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.TranslatedText - } - return result - }) - } -} -public extension Api.functions.messages { - static func uninstallStickerSet(stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-110209570) - stickerset.serialize(buffer, true) - return (FunctionDescription(name: "messages.uninstallStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func unpinAllMessages(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(103667527) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {savedPeerId!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.unpinAllMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in - let reader = BufferReader(buffer) - var result: Api.messages.AffectedHistory? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory - } - return result - }) - } -} -public extension Api.functions.messages { - static func updateDialogFilter(flags: Int32, id: Int32, filter: Api.DialogFilter?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(450142282) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {filter!.serialize(buffer, true)} - return (FunctionDescription(name: "messages.updateDialogFilter", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("filter", String(describing: filter))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func updateDialogFiltersOrder(order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-983318044) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.updateDialogFiltersOrder", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func updatePinnedForumTopic(peer: Api.InputPeer, topicId: Int32, pinned: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(392032849) - peer.serialize(buffer, true) - serializeInt32(topicId, buffer: buffer, boxed: false) - pinned.serialize(buffer, true) - return (FunctionDescription(name: "messages.updatePinnedForumTopic", parameters: [("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func updatePinnedMessage(flags: Int32, peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-760547348) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.updatePinnedMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } -} -public extension Api.functions.messages { - static func updateSavedReactionTag(flags: Int32, reaction: Api.Reaction, title: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1613331948) - serializeInt32(flags, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "messages.updateSavedReactionTag", parameters: [("flags", String(describing: flags)), ("reaction", String(describing: reaction)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.messages { - static func uploadEncryptedFile(peer: Api.InputEncryptedChat, file: Api.InputEncryptedFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1347929239) - peer.serialize(buffer, true) - file.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadEncryptedFile", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedFile? in - let reader = BufferReader(buffer) - var result: Api.EncryptedFile? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.EncryptedFile - } - return result - }) - } -} -public extension Api.functions.messages { - static func uploadImportedMedia(peer: Api.InputPeer, importId: Int64, fileName: String, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(713433234) - peer.serialize(buffer, true) - serializeInt64(importId, buffer: buffer, boxed: false) - serializeString(fileName, buffer: buffer, boxed: false) - media.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadImportedMedia", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId)), ("fileName", String(describing: fileName)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in - let reader = BufferReader(buffer) - var result: Api.MessageMedia? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - return result - }) - } -} -public extension Api.functions.messages { - static func uploadMedia(flags: Int32, businessConnectionId: String?, peer: Api.InputPeer, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(345405816) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(businessConnectionId!, buffer: buffer, boxed: false)} - peer.serialize(buffer, true) - media.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadMedia", parameters: [("flags", String(describing: flags)), ("businessConnectionId", String(describing: businessConnectionId)), ("peer", String(describing: peer)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in - let reader = BufferReader(buffer) - var result: Api.MessageMedia? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - return result - }) - } -} -public extension Api.functions.messages { - static func viewSponsoredMessage(randomId: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(647902787) - serializeBytes(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.viewSponsoredMessage", parameters: [("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func getStrings(langPack: String, langCode: String, keys: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.LangPackString]>) { + let buffer = Buffer() + buffer.appendInt32(-269862909) + serializeString(langPack, buffer: buffer, boxed: false) + serializeString(langCode, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(keys.count)) + for item in keys { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "langpack.getStrings", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("keys", String(describing: keys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackString]? in + let reader = BufferReader(buffer) + var result: [Api.LangPackString]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackString.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func acceptEncryption(peer: Api.InputEncryptedChat, gB: Buffer, keyFingerprint: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1035731989) + peer.serialize(buffer, true) + serializeBytes(gB, buffer: buffer, boxed: false) + serializeInt64(keyFingerprint, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.acceptEncryption", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("keyFingerprint", String(describing: keyFingerprint))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in + let reader = BufferReader(buffer) + var result: Api.EncryptedChat? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EncryptedChat + } + return result + }) + } +} +public extension Api.functions.messages { + static func acceptUrlAuth(flags: Int32, peer: Api.InputPeer?, msgId: Int32?, buttonId: Int32?, url: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1322487515) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + peer!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(msgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(buttonId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(url!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.acceptUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in + let reader = BufferReader(buffer) + var result: Api.UrlAuthResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.UrlAuthResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func addChatUser(chatId: Int64, userId: Api.InputUser, fwdLimit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-876162809) + serializeInt64(chatId, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + serializeInt32(fwdLimit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.addChatUser", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("fwdLimit", String(describing: fwdLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + let reader = BufferReader(buffer) + var result: Api.messages.InvitedUsers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers + } + return result + }) + } +} +public extension Api.functions.messages { + static func appendTodoList(peer: Api.InputPeer, msgId: Int32, list: [Api.TodoItem]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(564531287) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(list.count)) + for item in list { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.appendTodoList", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("list", String(describing: list))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func checkChatInvite(hash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1051570619) + serializeString(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.checkChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatInvite? in + let reader = BufferReader(buffer) + var result: Api.ChatInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ChatInvite + } + return result + }) + } +} +public extension Api.functions.messages { + static func checkHistoryImport(importHead: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1140726259) + serializeString(importHead, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.checkHistoryImport", parameters: [("importHead", String(describing: importHead))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImportParsed? in + let reader = BufferReader(buffer) + var result: Api.messages.HistoryImportParsed? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.HistoryImportParsed + } + return result + }) + } +} +public extension Api.functions.messages { + static func checkHistoryImportPeer(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1573261059) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.checkHistoryImportPeer", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.CheckedHistoryImportPeer? in + let reader = BufferReader(buffer) + var result: Api.messages.CheckedHistoryImportPeer? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.CheckedHistoryImportPeer + } + return result + }) + } +} +public extension Api.functions.messages { + static func checkQuickReplyShortcut(shortcut: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-237962285) + serializeString(shortcut, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.checkQuickReplyShortcut", parameters: [("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func clearAllDrafts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2119757468) + return (FunctionDescription(name: "messages.clearAllDrafts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func clearRecentReactions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1644236876) + return (FunctionDescription(name: "messages.clearRecentReactions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func clearRecentStickers(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1986437075) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.clearRecentStickers", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func clickSponsoredMessage(flags: Int32, randomId: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2110454402) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeBytes(randomId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.clickSponsoredMessage", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func createChat(flags: Int32, users: [Api.InputUser], title: String, ttlPeriod: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1831936556) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(users.count)) + for item in users { + item.serialize(buffer, true) + } + serializeString(title, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(ttlPeriod!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.createChat", parameters: [("flags", String(describing: flags)), ("users", String(describing: users)), ("title", String(describing: title)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + let reader = BufferReader(buffer) + var result: Api.messages.InvitedUsers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.InvitedUsers + } + return result + }) + } +} +public extension Api.functions.messages { + static func createForumTopic(flags: Int32, peer: Api.InputPeer, title: String, iconColor: Int32?, iconEmojiId: Int64?, randomId: Int64, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(798540757) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(iconColor!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeInt64(iconEmojiId!, buffer: buffer, boxed: false) + } + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + sendAs!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.createForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("title", String(describing: title)), ("iconColor", String(describing: iconColor)), ("iconEmojiId", String(describing: iconEmojiId)), ("randomId", String(describing: randomId)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1540419152) + serializeInt64(chatId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deleteChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteChatUser(flags: Int32, chatId: Int64, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1575461717) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(chatId, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + return (FunctionDescription(name: "messages.deleteChatUser", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteExportedChatInvite(peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-731601877) + peer.serialize(buffer, true) + serializeString(link, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deleteExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteFactCheck(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-774204404) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deleteFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteHistory(flags: Int32, peer: Api.InputPeer, maxId: Int32, minDate: Int32?, maxDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1332768214) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(minDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeInt32(maxDate!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.deleteHistory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteMessages(flags: Int32, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-443640366) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.deleteMessages", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages + } + return result + }) + } +} +public extension Api.functions.messages { + static func deletePhoneCallHistory(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-104078327) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deletePhoneCallHistory", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedFoundMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedFoundMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedFoundMessages + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteQuickReplyMessages(shortcutId: Int32, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-519706352) + serializeInt32(shortcutId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.deleteQuickReplyMessages", parameters: [("shortcutId", String(describing: shortcutId)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteQuickReplyShortcut(shortcutId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1019234112) + serializeInt32(shortcutId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deleteQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteRevokedExportedChatInvites(peer: Api.InputPeer, adminId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1452833749) + peer.serialize(buffer, true) + adminId.serialize(buffer, true) + return (FunctionDescription(name: "messages.deleteRevokedExportedChatInvites", parameters: [("peer", String(describing: peer)), ("adminId", String(describing: adminId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteSavedHistory(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputPeer, maxId: Int32, minDate: Int32?, maxDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1304758367) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + parentPeer!.serialize(buffer, true) + } + peer.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(minDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeInt32(maxDate!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.deleteSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1504586518) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.deleteScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func deleteTopicHistory(peer: Api.InputPeer, topMsgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-763269360) + peer.serialize(buffer, true) + serializeInt32(topMsgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deleteTopicHistory", parameters: [("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func discardEncryption(flags: Int32, chatId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-208425312) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(chatId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.discardEncryption", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func editChatAbout(peer: Api.InputPeer, about: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-554301545) + peer.serialize(buffer, true) + serializeString(about, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.editChatAbout", parameters: [("peer", String(describing: peer)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func editChatAdmin(chatId: Int64, userId: Api.InputUser, isAdmin: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1470377534) + serializeInt64(chatId, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + isAdmin.serialize(buffer, true) + return (FunctionDescription(name: "messages.editChatAdmin", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("isAdmin", String(describing: isAdmin))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func editChatDefaultBannedRights(peer: Api.InputPeer, bannedRights: Api.ChatBannedRights) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1517917375) + peer.serialize(buffer, true) + bannedRights.serialize(buffer, true) + return (FunctionDescription(name: "messages.editChatDefaultBannedRights", parameters: [("peer", String(describing: peer)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editChatPhoto(chatId: Int64, photo: Api.InputChatPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(903730804) + serializeInt64(chatId, buffer: buffer, boxed: false) + photo.serialize(buffer, true) + return (FunctionDescription(name: "messages.editChatPhoto", parameters: [("chatId", String(describing: chatId)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editChatTitle(chatId: Int64, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1937260541) + serializeInt64(chatId, buffer: buffer, boxed: false) + serializeString(title, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.editChatTitle", parameters: [("chatId", String(describing: chatId)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editExportedChatInvite(flags: Int32, peer: Api.InputPeer, link: String, expireDate: Int32?, usageLimit: Int32?, requestNeeded: Api.Bool?, title: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1110823051) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(link, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(expireDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(usageLimit!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + requestNeeded!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 4) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.editExportedChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("requestNeeded", String(describing: requestNeeded)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in + let reader = BufferReader(buffer) + var result: Api.messages.ExportedChatInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvite + } + return result + }) + } +} +public extension Api.functions.messages { + static func editFactCheck(peer: Api.InputPeer, msgId: Int32, text: Api.TextWithEntities) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(92925557) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + text.serialize(buffer, true) + return (FunctionDescription(name: "messages.editFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("text", String(describing: text))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editForumTopic(flags: Int32, peer: Api.InputPeer, topicId: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-825487052) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(topicId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt64(iconEmojiId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + closed!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + hidden!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.editForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("title", String(describing: title)), ("iconEmojiId", String(describing: iconEmojiId)), ("closed", String(describing: closed)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editInlineBotMessage(flags: Int32, id: Api.InputBotInlineMessageID, message: String?, media: Api.InputMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2091549254) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + if Int(flags) & Int(1 << 11) != 0 { + serializeString(message!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 14) != 0 { + media!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + replyMarkup!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "messages.editInlineBotMessage", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func editMessage(flags: Int32, peer: Api.InputPeer, id: Int32, message: String?, media: Api.InputMedia?, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, quickReplyShortcutId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1374175969) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 11) != 0 { + serializeString(message!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 14) != 0 { + media!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + replyMarkup!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 15) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 18) != 0 { + serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 17) != 0 { + serializeInt32(quickReplyShortcutId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.editMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("quickReplyShortcutId", String(describing: quickReplyShortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func editQuickReplyShortcut(shortcutId: Int32, shortcut: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1543519471) + serializeInt32(shortcutId, buffer: buffer, boxed: false) + serializeString(shortcut, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.editQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId)), ("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func exportChatInvite(flags: Int32, peer: Api.InputPeer, expireDate: Int32?, usageLimit: Int32?, title: String?, subscriptionPricing: Api.StarsSubscriptionPricing?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1537876336) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(expireDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(usageLimit!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 4) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 5) != 0 { + subscriptionPricing!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.exportChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("title", String(describing: title)), ("subscriptionPricing", String(describing: subscriptionPricing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatInvite? in + let reader = BufferReader(buffer) + var result: Api.ExportedChatInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + return result + }) + } +} +public extension Api.functions.messages { + static func faveSticker(id: Api.InputDocument, unfave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1174420133) + id.serialize(buffer, true) + unfave.serialize(buffer, true) + return (FunctionDescription(name: "messages.faveSticker", parameters: [("id", String(describing: id)), ("unfave", String(describing: unfave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func forwardMessages(flags: Int32, fromPeer: Api.InputPeer, id: [Int32], randomId: [Int64], toPeer: Api.InputPeer, topMsgId: Int32?, replyTo: Api.InputReplyTo?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, videoTimestamp: Int32?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(326126204) + serializeInt32(flags, buffer: buffer, boxed: false) + fromPeer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(randomId.count)) + for item in randomId { + serializeInt64(item, buffer: buffer, boxed: false) + } + toPeer.serialize(buffer, true) + if Int(flags) & Int(1 << 9) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 22) != 0 { + replyTo!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 10) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 24) != 0 { + serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 17) != 0 { + quickReplyShortcut!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 18) != 0 { + serializeInt64(effect!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 20) != 0 { + serializeInt32(videoTimestamp!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 21) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 23) != 0 { + suggestedPost!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.forwardMessages", parameters: [("flags", String(describing: flags)), ("fromPeer", String(describing: fromPeer)), ("id", String(describing: id)), ("randomId", String(describing: randomId)), ("toPeer", String(describing: toPeer)), ("topMsgId", String(describing: topMsgId)), ("replyTo", String(describing: replyTo)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("videoTimestamp", String(describing: videoTimestamp)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAdminsWithInvites(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(958457583) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.getAdminsWithInvites", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatAdminsWithInvites? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatAdminsWithInvites? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatAdminsWithInvites + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAllDrafts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1782549861) + return (FunctionDescription(name: "messages.getAllDrafts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAllStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1197432408) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getAllStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.AllStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getArchivedStickers(flags: Int32, offsetId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1475442322) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getArchivedStickers", parameters: [("flags", String(describing: flags)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ArchivedStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.ArchivedStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ArchivedStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAttachMenuBot(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1998676370) + bot.serialize(buffer, true) + return (FunctionDescription(name: "messages.getAttachMenuBot", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBotsBot? in + let reader = BufferReader(buffer) + var result: Api.AttachMenuBotsBot? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AttachMenuBotsBot + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAttachMenuBots(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(385663691) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getAttachMenuBots", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBots? in + let reader = BufferReader(buffer) + var result: Api.AttachMenuBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AttachMenuBots + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAttachedStickers(media: Api.InputStickeredMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StickerSetCovered]>) { + let buffer = Buffer() + buffer.appendInt32(-866424884) + media.serialize(buffer, true) + return (FunctionDescription(name: "messages.getAttachedStickers", parameters: [("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StickerSetCovered]? in + let reader = BufferReader(buffer) + var result: [Api.StickerSetCovered]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAvailableEffects(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-559805895) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getAvailableEffects", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableEffects? in + let reader = BufferReader(buffer) + var result: Api.messages.AvailableEffects? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AvailableEffects + } + return result + }) + } +} +public extension Api.functions.messages { + static func getAvailableReactions(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(417243308) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getAvailableReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableReactions? in + let reader = BufferReader(buffer) + var result: Api.messages.AvailableReactions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AvailableReactions + } + return result + }) + } +} +public extension Api.functions.messages { + static func getBotApp(app: Api.InputBotApp, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(889046467) + app.serialize(buffer, true) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getBotApp", parameters: [("app", String(describing: app)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotApp? in + let reader = BufferReader(buffer) + var result: Api.messages.BotApp? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.BotApp + } + return result + }) + } +} +public extension Api.functions.messages { + static func getBotCallbackAnswer(flags: Int32, peer: Api.InputPeer, msgId: Int32, data: Buffer?, password: Api.InputCheckPasswordSRP?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1824339449) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeBytes(data!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + password!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("data", String(describing: data)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotCallbackAnswer? in + let reader = BufferReader(buffer) + var result: Api.messages.BotCallbackAnswer? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.BotCallbackAnswer + } + return result + }) + } +} +public extension Api.functions.messages { + static func getChatInviteImporters(flags: Int32, peer: Api.InputPeer, link: String?, q: String?, offsetDate: Int32, offsetUser: Api.InputUser, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-553329330) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(link!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(q!, buffer: buffer, boxed: false) + } + serializeInt32(offsetDate, buffer: buffer, boxed: false) + offsetUser.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getChatInviteImporters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetUser", String(describing: offsetUser)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatInviteImporters? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatInviteImporters? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatInviteImporters + } + return result + }) + } +} +public extension Api.functions.messages { + static func getChats(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1240027791) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getChats", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } +} +public extension Api.functions.messages { + static func getCommonChats(userId: Api.InputUser, maxId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-468934396) + userId.serialize(buffer, true) + serializeInt64(maxId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getCommonChats", parameters: [("userId", String(describing: userId)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } +} +public extension Api.functions.messages { + static func getCustomEmojiDocuments(documentId: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.Document]>) { + let buffer = Buffer() + buffer.appendInt32(-643100844) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(documentId.count)) + for item in documentId { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getCustomEmojiDocuments", parameters: [("documentId", String(describing: documentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Document]? in + let reader = BufferReader(buffer) + var result: [Api.Document]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDefaultHistoryTTL() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1703637384) + return (FunctionDescription(name: "messages.getDefaultHistoryTTL", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DefaultHistoryTTL? in + let reader = BufferReader(buffer) + var result: Api.DefaultHistoryTTL? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.DefaultHistoryTTL + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDefaultTagReactions(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1107741656) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getDefaultTagReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + let reader = BufferReader(buffer) + var result: Api.messages.Reactions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Reactions + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDhConfig(version: Int32, randomLength: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(651135312) + serializeInt32(version, buffer: buffer, boxed: false) + serializeInt32(randomLength, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getDhConfig", parameters: [("version", String(describing: version)), ("randomLength", String(describing: randomLength))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DhConfig? in + let reader = BufferReader(buffer) + var result: Api.messages.DhConfig? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.DhConfig + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDialogFilters() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-271283063) + return (FunctionDescription(name: "messages.getDialogFilters", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DialogFilters? in + let reader = BufferReader(buffer) + var result: Api.messages.DialogFilters? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.DialogFilters + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDialogUnreadMarks(flags: Int32, parentPeer: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.DialogPeer]>) { + let buffer = Buffer() + buffer.appendInt32(555754018) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + parentPeer!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getDialogUnreadMarks", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogPeer]? in + let reader = BufferReader(buffer) + var result: [Api.DialogPeer]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDialogs(flags: Int32, folderId: Int32?, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1594569905) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(folderId!, buffer: buffer, boxed: false) + } + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + offsetPeer.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Dialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.Dialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Dialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDiscussionMessage(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1147761405) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getDiscussionMessage", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DiscussionMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.DiscussionMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.DiscussionMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func getDocumentByHash(sha256: Buffer, size: Int64, mimeType: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1309538785) + serializeBytes(sha256, buffer: buffer, boxed: false) + serializeInt64(size, buffer: buffer, boxed: false) + serializeString(mimeType, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getDocumentByHash", parameters: [("sha256", String(describing: sha256)), ("size", String(describing: size)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + let reader = BufferReader(buffer) + var result: Api.Document? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Document + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiGameInfo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-75592537) + return (FunctionDescription(name: "messages.getEmojiGameInfo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGameInfo? in + let reader = BufferReader(buffer) + var result: Api.messages.EmojiGameInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameInfo + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1955122779) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + let reader = BufferReader(buffer) + var result: Api.messages.EmojiGroups? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiKeywords(langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(899735650) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiKeywords", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in + let reader = BufferReader(buffer) + var result: Api.EmojiKeywordsDifference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiKeywordsDifference + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiKeywordsDifference(langCode: String, fromVersion: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(352892591) + serializeString(langCode, buffer: buffer, boxed: false) + serializeInt32(fromVersion, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiKeywordsDifference", parameters: [("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in + let reader = BufferReader(buffer) + var result: Api.EmojiKeywordsDifference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiKeywordsDifference + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiKeywordsLanguages(langCodes: [String]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.EmojiLanguage]>) { + let buffer = Buffer() + buffer.appendInt32(1318675378) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(langCodes.count)) + for item in langCodes { + serializeString(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getEmojiKeywordsLanguages", parameters: [("langCodes", String(describing: langCodes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.EmojiLanguage]? in + let reader = BufferReader(buffer) + var result: [Api.EmojiLanguage]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiLanguage.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiProfilePhotoGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(564480243) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiProfilePhotoGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + let reader = BufferReader(buffer) + var result: Api.messages.EmojiGroups? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiStatusGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(785209037) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiStatusGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + let reader = BufferReader(buffer) + var result: Api.messages.EmojiGroups? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiStickerGroups(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(500711669) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiStickerGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + let reader = BufferReader(buffer) + var result: Api.messages.EmojiGroups? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.EmojiGroups + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-67329649) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.AllStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getEmojiURL(langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-709817306) + serializeString(langCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getEmojiURL", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiURL? in + let reader = BufferReader(buffer) + var result: Api.EmojiURL? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiURL + } + return result + }) + } +} +public extension Api.functions.messages { + static func getExportedChatInvite(peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1937010524) + peer.serialize(buffer, true) + serializeString(link, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in + let reader = BufferReader(buffer) + var result: Api.messages.ExportedChatInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvite + } + return result + }) + } +} +public extension Api.functions.messages { + static func getExportedChatInvites(flags: Int32, peer: Api.InputPeer, adminId: Api.InputUser, offsetDate: Int32?, offsetLink: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1565154314) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + adminId.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(offsetDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(offsetLink!, buffer: buffer, boxed: false) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getExportedChatInvites", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("adminId", String(describing: adminId)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvites? in + let reader = BufferReader(buffer) + var result: Api.messages.ExportedChatInvites? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ExportedChatInvites + } + return result + }) + } +} +public extension Api.functions.messages { + static func getExtendedMedia(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2064119788) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getExtendedMedia", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getFactCheck(peer: Api.InputPeer, msgId: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FactCheck]>) { + let buffer = Buffer() + buffer.appendInt32(-1177696786) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(msgId.count)) + for item in msgId { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FactCheck]? in + let reader = BufferReader(buffer) + var result: [Api.FactCheck]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FactCheck.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getFavedStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(82946729) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getFavedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FavedStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.FavedStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FavedStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getFeaturedEmojiStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(248473398) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getFeaturedEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.FeaturedStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getFeaturedStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1685588756) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getFeaturedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.FeaturedStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getForumTopics(flags: Int32, peer: Api.InputPeer, q: String?, offsetDate: Int32, offsetId: Int32, offsetTopic: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1000635391) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(q!, buffer: buffer, boxed: false) + } + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(offsetTopic, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetTopic", String(describing: offsetTopic)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in + let reader = BufferReader(buffer) + var result: Api.messages.ForumTopics? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ForumTopics + } + return result + }) + } +} +public extension Api.functions.messages { + static func getForumTopicsByID(peer: Api.InputPeer, topics: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1358280184) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(topics.count)) + for item in topics { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getForumTopicsByID", parameters: [("peer", String(describing: peer)), ("topics", String(describing: topics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in + let reader = BufferReader(buffer) + var result: Api.messages.ForumTopics? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ForumTopics + } + return result + }) + } +} +public extension Api.functions.messages { + static func getFullChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1364194508) + serializeInt64(chatId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getFullChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatFull? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatFull + } + return result + }) + } +} +public extension Api.functions.messages { + static func getGameHighScores(peer: Api.InputPeer, id: Int32, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-400399203) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + return (FunctionDescription(name: "messages.getGameHighScores", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in + let reader = BufferReader(buffer) + var result: Api.messages.HighScores? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.HighScores + } + return result + }) + } +} +public extension Api.functions.messages { + static func getHistory(peer: Api.InputPeer, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1143203525) + peer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getHistory", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getInlineBotResults(flags: Int32, bot: Api.InputUser, peer: Api.InputPeer, geoPoint: Api.InputGeoPoint?, query: String, offset: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1364105629) + serializeInt32(flags, buffer: buffer, boxed: false) + bot.serialize(buffer, true) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + geoPoint!.serialize(buffer, true) + } + serializeString(query, buffer: buffer, boxed: false) + serializeString(offset, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getInlineBotResults", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("geoPoint", String(describing: geoPoint)), ("query", String(describing: query)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotResults? in + let reader = BufferReader(buffer) + var result: Api.messages.BotResults? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.BotResults + } + return result + }) + } +} +public extension Api.functions.messages { + static func getInlineGameHighScores(id: Api.InputBotInlineMessageID, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(258170395) + id.serialize(buffer, true) + userId.serialize(buffer, true) + return (FunctionDescription(name: "messages.getInlineGameHighScores", parameters: [("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in + let reader = BufferReader(buffer) + var result: Api.messages.HighScores? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.HighScores + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMaskStickers(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1678738104) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getMaskStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.AllStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AllStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessageEditData(peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-39416522) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getMessageEditData", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageEditData? in + let reader = BufferReader(buffer) + var result: Api.messages.MessageEditData? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.MessageEditData + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessageReactionsList(flags: Int32, peer: Api.InputPeer, id: Int32, reaction: Api.Reaction?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1176190792) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + reaction!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(offset!, buffer: buffer, boxed: false) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getMessageReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageReactionsList? in + let reader = BufferReader(buffer) + var result: Api.messages.MessageReactionsList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.MessageReactionsList + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessageReadParticipants(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ReadParticipantDate]>) { + let buffer = Buffer() + buffer.appendInt32(834782287) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getMessageReadParticipants", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReadParticipantDate]? in + let reader = BufferReader(buffer) + var result: [Api.ReadParticipantDate]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReadParticipantDate.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessages(id: [Api.InputMessage]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1673946374) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getMessages", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessagesReactions(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1950707482) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getMessagesReactions", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMessagesViews(peer: Api.InputPeer, id: [Int32], increment: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1468322785) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + increment.serialize(buffer, true) + return (FunctionDescription(name: "messages.getMessagesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("increment", String(describing: increment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageViews? in + let reader = BufferReader(buffer) + var result: Api.messages.MessageViews? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.MessageViews + } + return result + }) + } +} +public extension Api.functions.messages { + static func getMyStickers(offsetId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-793386500) + serializeInt64(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getMyStickers", parameters: [("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MyStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.MyStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.MyStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getOldFeaturedStickers(offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2127598753) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getOldFeaturedStickers", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.FeaturedStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FeaturedStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getOnlines(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1848369232) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.getOnlines", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatOnlines? in + let reader = BufferReader(buffer) + var result: Api.ChatOnlines? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ChatOnlines + } + return result + }) + } +} +public extension Api.functions.messages { + static func getOutboxReadDate(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1941176739) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getOutboxReadDate", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.OutboxReadDate? in + let reader = BufferReader(buffer) + var result: Api.OutboxReadDate? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.OutboxReadDate + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPaidReactionPrivacy() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1193563562) + return (FunctionDescription(name: "messages.getPaidReactionPrivacy", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPeerDialogs(peers: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-462373635) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peers.count)) + for item in peers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getPeerDialogs", parameters: [("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.PeerDialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.PeerDialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPeerSettings(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-270948702) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.getPeerSettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerSettings? in + let reader = BufferReader(buffer) + var result: Api.messages.PeerSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.PeerSettings + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPinnedDialogs(folderId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-692498958) + serializeInt32(folderId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getPinnedDialogs", parameters: [("folderId", String(describing: folderId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.PeerDialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.PeerDialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPinnedSavedDialogs() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-700607264) + return (FunctionDescription(name: "messages.getPinnedSavedDialogs", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.SavedDialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPollResults(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1941660731) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPollVotes(flags: Int32, peer: Api.InputPeer, id: Int32, option: Buffer?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1200736242) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeBytes(option!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(offset!, buffer: buffer, boxed: false) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.VotesList? in + let reader = BufferReader(buffer) + var result: Api.messages.VotesList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.VotesList + } + return result + }) + } +} +public extension Api.functions.messages { + static func getPreparedInlineMessage(bot: Api.InputUser, id: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2055291464) + bot.serialize(buffer, true) + serializeString(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getPreparedInlineMessage", parameters: [("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PreparedInlineMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.PreparedInlineMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.PreparedInlineMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func getQuickReplies(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-729550168) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getQuickReplies", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.QuickReplies? in + let reader = BufferReader(buffer) + var result: Api.messages.QuickReplies? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.QuickReplies + } + return result + }) + } +} +public extension Api.functions.messages { + static func getQuickReplyMessages(flags: Int32, shortcutId: Int32, id: [Int32]?, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1801153085) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(shortcutId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id!.count)) + for item in id! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getQuickReplyMessages", parameters: [("flags", String(describing: flags)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getRecentLocations(peer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1881817312) + peer.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getRecentLocations", parameters: [("peer", String(describing: peer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getRecentReactions(limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(960896434) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getRecentReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + let reader = BufferReader(buffer) + var result: Api.messages.Reactions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Reactions + } + return result + }) + } +} +public extension Api.functions.messages { + static func getRecentStickers(flags: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1649852357) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getRecentStickers", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.RecentStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.RecentStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.RecentStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getReplies(peer: Api.InputPeer, msgId: Int32, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(584962828) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getReplies", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSavedDialogs(flags: Int32, parentPeer: Api.InputPeer?, offsetDate: Int32, offsetId: Int32, offsetPeer: Api.InputPeer, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(512883865) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + parentPeer!.serialize(buffer, true) + } + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + offsetPeer.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSavedDialogs", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.SavedDialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSavedDialogsByID(flags: Int32, parentPeer: Api.InputPeer?, ids: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1869585558) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + parentPeer!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(ids.count)) + for item in ids { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getSavedDialogsByID", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("ids", String(describing: ids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in + let reader = BufferReader(buffer) + var result: Api.messages.SavedDialogs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SavedDialogs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSavedGifs(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1559270965) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSavedGifs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedGifs? in + let reader = BufferReader(buffer) + var result: Api.messages.SavedGifs? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SavedGifs + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSavedHistory(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputPeer, offsetId: Int32, offsetDate: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1718964215) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + parentPeer!.serialize(buffer, true) + } + peer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(offsetDate, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSavedReactionTags(flags: Int32, peer: Api.InputPeer?, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(909631579) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + peer!.serialize(buffer, true) + } + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSavedReactionTags", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedReactionTags? in + let reader = BufferReader(buffer) + var result: Api.messages.SavedReactionTags? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SavedReactionTags + } + return result + }) + } +} +public extension Api.functions.messages { + static func getScheduledHistory(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-183077365) + peer.serialize(buffer, true) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getScheduledHistory", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1111817116) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSearchCounters(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, topMsgId: Int32?, filters: [Api.MessagesFilter]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.messages.SearchCounter]>) { + let buffer = Buffer() + buffer.appendInt32(465367808) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + savedPeerId!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(filters.count)) + for item in filters { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.getSearchCounters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("topMsgId", String(describing: topMsgId)), ("filters", String(describing: filters))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.messages.SearchCounter]? in + let reader = BufferReader(buffer) + var result: [Api.messages.SearchCounter]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.messages.SearchCounter.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSearchResultsCalendar(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, filter: Api.MessagesFilter, offsetId: Int32, offsetDate: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1789130429) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + savedPeerId!.serialize(buffer, true) + } + filter.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(offsetDate, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSearchResultsCalendar", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsCalendar? in + let reader = BufferReader(buffer) + var result: Api.messages.SearchResultsCalendar? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SearchResultsCalendar + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSearchResultsPositions(flags: Int32, peer: Api.InputPeer, savedPeerId: Api.InputPeer?, filter: Api.MessagesFilter, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1669386480) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + savedPeerId!.serialize(buffer, true) + } + filter.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getSearchResultsPositions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsPositions? in + let reader = BufferReader(buffer) + var result: Api.messages.SearchResultsPositions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SearchResultsPositions + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSplitRanges() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.MessageRange]>) { + let buffer = Buffer() + buffer.appendInt32(486505992) + return (FunctionDescription(name: "messages.getSplitRanges", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.MessageRange]? in + let reader = BufferReader(buffer) + var result: [Api.MessageRange]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageRange.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSponsoredMessages(flags: Int32, peer: Api.InputPeer, msgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1030547536) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(msgId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.getSponsoredMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SponsoredMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.SponsoredMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SponsoredMessages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getStickerSet(stickerset: Api.InputStickerSet, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-928977804) + stickerset.serialize(buffer, true) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } +} +public extension Api.functions.messages { + static func getStickers(emoticon: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-710552671) + serializeString(emoticon, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getStickers", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Stickers? in + let reader = BufferReader(buffer) + var result: Api.messages.Stickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Stickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func getSuggestedDialogFilters() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.DialogFilterSuggested]>) { + let buffer = Buffer() + buffer.appendInt32(-1566780372) + return (FunctionDescription(name: "messages.getSuggestedDialogFilters", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogFilterSuggested]? in + let reader = BufferReader(buffer) + var result: [Api.DialogFilterSuggested]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogFilterSuggested.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func getTopReactions(limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1149164102) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getTopReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + let reader = BufferReader(buffer) + var result: Api.messages.Reactions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Reactions + } + return result + }) + } +} +public extension Api.functions.messages { + static func getUnreadMentions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-251140208) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getUnreadMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getUnreadReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1115713364) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + savedPeerId!.serialize(buffer, true) + } + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getUnreadReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func getWebPage(url: String, hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1919511901) + serializeString(url, buffer: buffer, boxed: false) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getWebPage", parameters: [("url", String(describing: url)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPage? in + let reader = BufferReader(buffer) + var result: Api.messages.WebPage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.WebPage + } + return result + }) + } +} +public extension Api.functions.messages { + static func getWebPagePreview(flags: Int32, message: String, entities: [Api.MessageEntity]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1460498287) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(message, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "messages.getWebPagePreview", parameters: [("flags", String(describing: flags)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPagePreview? in + let reader = BufferReader(buffer) + var result: Api.messages.WebPagePreview? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.WebPagePreview + } + return result + }) + } +} +public extension Api.functions.messages { + static func hideAllChatJoinRequests(flags: Int32, peer: Api.InputPeer, link: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-528091926) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(link!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.hideAllChatJoinRequests", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func hideChatJoinRequest(flags: Int32, peer: Api.InputPeer, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2145904661) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + userId.serialize(buffer, true) + return (FunctionDescription(name: "messages.hideChatJoinRequest", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func hidePeerSettingsBar(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1336717624) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.hidePeerSettingsBar", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func importChatInvite(hash: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1817183516) + serializeString(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.importChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func initHistoryImport(peer: Api.InputPeer, file: Api.InputFile, mediaCount: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(873008187) + peer.serialize(buffer, true) + file.serialize(buffer, true) + serializeInt32(mediaCount, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.initHistoryImport", parameters: [("peer", String(describing: peer)), ("file", String(describing: file)), ("mediaCount", String(describing: mediaCount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImport? in + let reader = BufferReader(buffer) + var result: Api.messages.HistoryImport? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.HistoryImport + } + return result + }) + } +} +public extension Api.functions.messages { + static func installStickerSet(stickerset: Api.InputStickerSet, archived: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-946871200) + stickerset.serialize(buffer, true) + archived.serialize(buffer, true) + return (FunctionDescription(name: "messages.installStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("archived", String(describing: archived))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSetInstallResult? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSetInstallResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSetInstallResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func markDialogUnread(flags: Int32, parentPeer: Api.InputPeer?, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1940912392) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + parentPeer!.serialize(buffer, true) + } + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.markDialogUnread", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func migrateChat(chatId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1568189671) + serializeInt64(chatId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.migrateChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func prolongWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, queryId: Int64, replyTo: Api.InputReplyTo?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1328014717) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + bot.serialize(buffer, true) + serializeInt64(queryId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.prolongWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("queryId", String(describing: queryId)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func rateTranscribedAudio(peer: Api.InputPeer, msgId: Int32, transcriptionId: Int64, good: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2132608815) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt64(transcriptionId, buffer: buffer, boxed: false) + good.serialize(buffer, true) + return (FunctionDescription(name: "messages.rateTranscribedAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("transcriptionId", String(describing: transcriptionId)), ("good", String(describing: good))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func readDiscussion(peer: Api.InputPeer, msgId: Int32, readMaxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-147740172) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt32(readMaxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.readDiscussion", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("readMaxId", String(describing: readMaxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func readEncryptedHistory(peer: Api.InputEncryptedChat, maxDate: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2135648522) + peer.serialize(buffer, true) + serializeInt32(maxDate, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.readEncryptedHistory", parameters: [("peer", String(describing: peer)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func readFeaturedStickers(id: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1527873830) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.readFeaturedStickers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func readHistory(peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(238054714) + peer.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.readHistory", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages + } + return result + }) + } +} +public extension Api.functions.messages { + static func readMentions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(921026381) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.readMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func readMessageContents(id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(916930423) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.readMessageContents", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedMessages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedMessages + } + return result + }) + } +} +public extension Api.functions.messages { + static func readReactions(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1631301741) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + savedPeerId!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.readReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func readSavedHistory(parentPeer: Api.InputPeer, peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1169540261) + parentPeer.serialize(buffer, true) + peer.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.readSavedHistory", parameters: [("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func receivedMessages(maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ReceivedNotifyMessage]>) { + let buffer = Buffer() + buffer.appendInt32(94983360) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.receivedMessages", parameters: [("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReceivedNotifyMessage]? in + let reader = BufferReader(buffer) + var result: [Api.ReceivedNotifyMessage]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReceivedNotifyMessage.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func receivedQueue(maxQts: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int64]>) { + let buffer = Buffer() + buffer.appendInt32(1436924774) + serializeInt32(maxQts, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.receivedQueue", parameters: [("maxQts", String(describing: maxQts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in + let reader = BufferReader(buffer) + var result: [Int64]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + return result + }) + } +} +public extension Api.functions.messages { + static func reorderPinnedDialogs(flags: Int32, folderId: Int32, order: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(991616823) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(folderId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.reorderPinnedDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reorderPinnedForumTopics(flags: Int32, peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(242762224) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.reorderPinnedForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func reorderPinnedSavedDialogs(flags: Int32, order: [Api.InputDialogPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1955502713) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.reorderPinnedSavedDialogs", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reorderQuickReplies(order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1613961479) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.reorderQuickReplies", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reorderStickerSets(flags: Int32, order: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2016638777) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.reorderStickerSets", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func report(peer: Api.InputPeer, id: [Int32], option: Buffer, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-59199589) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeBytes(option, buffer: buffer, boxed: false) + serializeString(message, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in + let reader = BufferReader(buffer) + var result: Api.ReportResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ReportResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func reportEncryptedSpam(peer: Api.InputEncryptedChat) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1259113487) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.reportEncryptedSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reportMessagesDelivery(flags: Int32, peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1517122453) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.reportMessagesDelivery", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reportReaction(peer: Api.InputPeer, id: Int32, reactionPeer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1063567478) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + reactionPeer.serialize(buffer, true) + return (FunctionDescription(name: "messages.reportReaction", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("reactionPeer", String(describing: reactionPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reportSpam(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-820669733) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.reportSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func reportSponsoredMessage(randomId: Buffer, option: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(315355332) + serializeBytes(randomId, buffer: buffer, boxed: false) + serializeBytes(option, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.reportSponsoredMessage", parameters: [("randomId", String(describing: randomId)), ("option", String(describing: option))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SponsoredMessageReportResult? in + let reader = BufferReader(buffer) + var result: Api.channels.SponsoredMessageReportResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.channels.SponsoredMessageReportResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestAppWebView(flags: Int32, peer: Api.InputPeer, app: Api.InputBotApp, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1398901710) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + app.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(startParam!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + themeParams!.serialize(buffer, true) + } + serializeString(platform, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.requestAppWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("app", String(describing: app)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + let reader = BufferReader(buffer) + var result: Api.WebViewResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WebViewResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestEncryption(userId: Api.InputUser, randomId: Int32, gA: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-162681021) + userId.serialize(buffer, true) + serializeInt32(randomId, buffer: buffer, boxed: false) + serializeBytes(gA, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.requestEncryption", parameters: [("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gA", String(describing: gA))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in + let reader = BufferReader(buffer) + var result: Api.EncryptedChat? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EncryptedChat + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestMainWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-908059013) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + bot.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(startParam!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + themeParams!.serialize(buffer, true) + } + serializeString(platform, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.requestMainWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + let reader = BufferReader(buffer) + var result: Api.WebViewResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WebViewResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestSimpleWebView(flags: Int32, bot: Api.InputUser, url: String?, startParam: String?, themeParams: Api.DataJSON?, platform: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1094336115) + serializeInt32(flags, buffer: buffer, boxed: false) + bot.serialize(buffer, true) + if Int(flags) & Int(1 << 3) != 0 { + serializeString(url!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 4) != 0 { + serializeString(startParam!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + themeParams!.serialize(buffer, true) + } + serializeString(platform, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.requestSimpleWebView", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + let reader = BufferReader(buffer) + var result: Api.WebViewResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WebViewResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestUrlAuth(flags: Int32, peer: Api.InputPeer?, msgId: Int32?, buttonId: Int32?, url: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(428848198) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + peer!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(msgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(buttonId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(url!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.requestUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in + let reader = BufferReader(buffer) + var result: Api.UrlAuthResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.UrlAuthResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func requestWebView(flags: Int32, peer: Api.InputPeer, bot: Api.InputUser, url: String?, startParam: String?, themeParams: Api.DataJSON?, platform: String, replyTo: Api.InputReplyTo?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(647873217) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + bot.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(url!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeString(startParam!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + themeParams!.serialize(buffer, true) + } + serializeString(platform, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.requestWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + let reader = BufferReader(buffer) + var result: Api.WebViewResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WebViewResult + } + return result + }) + } +} +public extension Api.functions.messages { + static func saveDefaultSendAs(peer: Api.InputPeer, sendAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-855777386) + peer.serialize(buffer, true) + sendAs.serialize(buffer, true) + return (FunctionDescription(name: "messages.saveDefaultSendAs", parameters: [("peer", String(describing: peer)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func saveDraft(flags: Int32, replyTo: Api.InputReplyTo?, peer: Api.InputPeer, message: String, entities: [Api.MessageEntity]?, media: Api.InputMedia?, effect: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1420701838) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 4) != 0 { + replyTo!.serialize(buffer, true) + } + peer.serialize(buffer, true) + serializeString(message, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 5) != 0 { + media!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 7) != 0 { + serializeInt64(effect!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 8) != 0 { + suggestedPost!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.saveDraft", parameters: [("flags", String(describing: flags)), ("replyTo", String(describing: replyTo)), ("peer", String(describing: peer)), ("message", String(describing: message)), ("entities", String(describing: entities)), ("media", String(describing: media)), ("effect", String(describing: effect)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func saveGif(id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(846868683) + id.serialize(buffer, true) + unsave.serialize(buffer, true) + return (FunctionDescription(name: "messages.saveGif", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func savePreparedInlineMessage(flags: Int32, result: Api.InputBotInlineResult, userId: Api.InputUser, peerTypes: [Api.InlineQueryPeerType]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-232816849) + serializeInt32(flags, buffer: buffer, boxed: false) + result.serialize(buffer, true) + userId.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(peerTypes!.count)) + for item in peerTypes! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "messages.savePreparedInlineMessage", parameters: [("flags", String(describing: flags)), ("result", String(describing: result)), ("userId", String(describing: userId)), ("peerTypes", String(describing: peerTypes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotPreparedInlineMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.BotPreparedInlineMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.BotPreparedInlineMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func saveRecentSticker(flags: Int32, id: Api.InputDocument, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(958863608) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + unsave.serialize(buffer, true) + return (FunctionDescription(name: "messages.saveRecentSticker", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func search(flags: Int32, peer: Api.InputPeer, q: String, fromId: Api.InputPeer?, savedPeerId: Api.InputPeer?, savedReaction: [Api.Reaction]?, topMsgId: Int32?, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetId: Int32, addOffset: Int32, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(703497338) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(q, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + fromId!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + savedPeerId!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(savedReaction!.count)) + for item in savedReaction! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + filter.serialize(buffer, true) + serializeInt32(minDate, buffer: buffer, boxed: false) + serializeInt32(maxDate, buffer: buffer, boxed: false) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(addOffset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt32(maxId, buffer: buffer, boxed: false) + serializeInt32(minId, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.search", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("fromId", String(describing: fromId)), ("savedPeerId", String(describing: savedPeerId)), ("savedReaction", String(describing: savedReaction)), ("topMsgId", String(describing: topMsgId)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchCustomEmoji(emoticon: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(739360983) + serializeString(emoticon, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchCustomEmoji", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + let reader = BufferReader(buffer) + var result: Api.EmojiList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EmojiList + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchEmojiStickerSets(flags: Int32, q: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1833678516) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(q, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchEmojiStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in + let reader = BufferReader(buffer) + var result: Api.messages.FoundStickerSets? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickerSets + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchGlobal(flags: Int32, folderId: Int32?, q: String, filter: Api.MessagesFilter, minDate: Int32, maxDate: Int32, offsetRate: Int32, offsetPeer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1271290010) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(folderId!, buffer: buffer, boxed: false) + } + serializeString(q, buffer: buffer, boxed: false) + filter.serialize(buffer, true) + serializeInt32(minDate, buffer: buffer, boxed: false) + serializeInt32(maxDate, buffer: buffer, boxed: false) + serializeInt32(offsetRate, buffer: buffer, boxed: false) + offsetPeer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchGlobal", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("q", String(describing: q)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchSentMedia(q: String, filter: Api.MessagesFilter, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(276705696) + serializeString(q, buffer: buffer, boxed: false) + filter.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchSentMedia", parameters: [("q", String(describing: q)), ("filter", String(describing: filter)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + let reader = BufferReader(buffer) + var result: Api.messages.Messages? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Messages + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchStickerSets(flags: Int32, q: String, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(896555914) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(q, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in + let reader = BufferReader(buffer) + var result: Api.messages.FoundStickerSets? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickerSets + } + return result + }) + } +} +public extension Api.functions.messages { + static func searchStickers(flags: Int32, q: String, emoticon: String, langCode: [String], offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(699516522) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(q, buffer: buffer, boxed: false) + serializeString(emoticon, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(langCode.count)) + for item in langCode { + serializeString(item, buffer: buffer, boxed: false) + } + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.searchStickers", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("emoticon", String(describing: emoticon)), ("langCode", String(describing: langCode)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickers? in + let reader = BufferReader(buffer) + var result: Api.messages.FoundStickers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.FoundStickers + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendBotRequestedPeer(peer: Api.InputPeer, msgId: Int32, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1850552224) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt32(buttonId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(requestedPeers.count)) + for item in requestedPeers { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.sendBotRequestedPeer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("requestedPeers", String(describing: requestedPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendEncrypted(flags: Int32, peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1157265941) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeBytes(data, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.sendEncrypted", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.SentEncryptedMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendEncryptedFile(flags: Int32, peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer, file: Api.InputEncryptedFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1431914525) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeBytes(data, buffer: buffer, boxed: false) + file.serialize(buffer, true) + return (FunctionDescription(name: "messages.sendEncryptedFile", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.SentEncryptedMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendEncryptedService(peer: Api.InputEncryptedChat, randomId: Int64, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(852769188) + peer.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeBytes(data, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.sendEncryptedService", parameters: [("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + let reader = BufferReader(buffer) + var result: Api.messages.SentEncryptedMessage? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.SentEncryptedMessage + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendInlineBotResult(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, randomId: Int64, queryId: Int64, id: String, scheduleDate: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1060145594) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeInt64(queryId, buffer: buffer, boxed: false) + serializeString(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 10) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 17) != 0 { + quickReplyShortcut!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 21) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.sendInlineBotResult", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId)), ("queryId", String(describing: queryId)), ("id", String(describing: id)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendMedia(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, media: Api.InputMedia, message: String, randomId: Int64, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(53536639) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + media.serialize(buffer, true) + serializeString(message, buffer: buffer, boxed: false) + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + replyMarkup!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 10) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 24) != 0 { + serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 17) != 0 { + quickReplyShortcut!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 18) != 0 { + serializeInt64(effect!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 21) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 22) != 0 { + suggestedPost!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.sendMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("media", String(describing: media)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendMessage(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, message: String, randomId: Int64, replyMarkup: Api.ReplyMarkup?, entities: [Api.MessageEntity]?, scheduleDate: Int32?, scheduleRepeatPeriod: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?, suggestedPost: Api.SuggestedPost?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1415369050) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + serializeString(message, buffer: buffer, boxed: false) + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + replyMarkup!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 10) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 24) != 0 { + serializeInt32(scheduleRepeatPeriod!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 17) != 0 { + quickReplyShortcut!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 18) != 0 { + serializeInt64(effect!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 21) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 22) != 0 { + suggestedPost!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.sendMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendMultiMedia(flags: Int32, peer: Api.InputPeer, replyTo: Api.InputReplyTo?, multiMedia: [Api.InputSingleMedia], scheduleDate: Int32?, sendAs: Api.InputPeer?, quickReplyShortcut: Api.InputQuickReplyShortcut?, effect: Int64?, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(469278068) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + replyTo!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(multiMedia.count)) + for item in multiMedia { + item.serialize(buffer, true) + } + if Int(flags) & Int(1 << 10) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 13) != 0 { + sendAs!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 17) != 0 { + quickReplyShortcut!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 18) != 0 { + serializeInt64(effect!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 21) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.sendMultiMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("multiMedia", String(describing: multiMedia)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendPaidReaction(flags: Int32, peer: Api.InputPeer, msgId: Int32, count: Int32, randomId: Int64, `private`: Api.PaidReactionPrivacy?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1488702288) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt32(count, buffer: buffer, boxed: false) + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + `private`!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.sendPaidReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("count", String(describing: count)), ("randomId", String(describing: randomId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendQuickReplyMessages(peer: Api.InputPeer, shortcutId: Int32, id: [Int32], randomId: [Int64]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1819610593) + peer.serialize(buffer, true) + serializeInt32(shortcutId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(randomId.count)) + for item in randomId { + serializeInt64(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.sendQuickReplyMessages", parameters: [("peer", String(describing: peer)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendReaction(flags: Int32, peer: Api.InputPeer, msgId: Int32, reaction: [Api.Reaction]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-754091820) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(reaction!.count)) + for item in reaction! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "messages.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendScheduledMessages(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1120369398) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.sendScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendScreenshotNotification(peer: Api.InputPeer, replyTo: Api.InputReplyTo, randomId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1589618665) + peer.serialize(buffer, true) + replyTo.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.sendScreenshotNotification", parameters: [("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendVote(peer: Api.InputPeer, msgId: Int32, options: [Buffer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(283795844) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(options.count)) + for item in options { + serializeBytes(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.sendVote", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("options", String(describing: options))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendWebViewData(bot: Api.InputUser, randomId: Int64, buttonText: String, data: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-603831608) + bot.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeString(buttonText, buffer: buffer, boxed: false) + serializeString(data, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.sendWebViewData", parameters: [("bot", String(describing: bot)), ("randomId", String(describing: randomId)), ("buttonText", String(describing: buttonText)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func sendWebViewResultMessage(botQueryId: String, result: Api.InputBotInlineResult) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(172168437) + serializeString(botQueryId, buffer: buffer, boxed: false) + result.serialize(buffer, true) + return (FunctionDescription(name: "messages.sendWebViewResultMessage", parameters: [("botQueryId", String(describing: botQueryId)), ("result", String(describing: result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewMessageSent? in + let reader = BufferReader(buffer) + var result: Api.WebViewMessageSent? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.WebViewMessageSent + } + return result + }) + } +} +public extension Api.functions.messages { + static func setBotCallbackAnswer(flags: Int32, queryId: Int64, message: String?, url: String?, cacheTime: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-712043766) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(queryId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(message!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(url!, buffer: buffer, boxed: false) + } + serializeInt32(cacheTime, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.setBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("message", String(describing: message)), ("url", String(describing: url)), ("cacheTime", String(describing: cacheTime))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setBotPrecheckoutResults(flags: Int32, queryId: Int64, error: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(163765653) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(queryId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(error!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.setBotPrecheckoutResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setBotShippingResults(flags: Int32, queryId: Int64, error: String?, shippingOptions: [Api.ShippingOption]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-436833542) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(queryId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(error!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(shippingOptions!.count)) + for item in shippingOptions! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "messages.setBotShippingResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error)), ("shippingOptions", String(describing: shippingOptions))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setChatAvailableReactions(flags: Int32, peer: Api.InputPeer, availableReactions: Api.ChatReactions, reactionsLimit: Int32?, paidEnabled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2041895551) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + availableReactions.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(reactionsLimit!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + paidEnabled!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.setChatAvailableReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("availableReactions", String(describing: availableReactions)), ("reactionsLimit", String(describing: reactionsLimit)), ("paidEnabled", String(describing: paidEnabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func setChatTheme(peer: Api.InputPeer, theme: Api.InputChatTheme) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(135398089) + peer.serialize(buffer, true) + theme.serialize(buffer, true) + return (FunctionDescription(name: "messages.setChatTheme", parameters: [("peer", String(describing: peer)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func setChatWallPaper(flags: Int32, peer: Api.InputPeer, wallpaper: Api.InputWallPaper?, settings: Api.WallPaperSettings?, id: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1879389471) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + wallpaper!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + settings!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(id!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.setChatWallPaper", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func setDefaultHistoryTTL(period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1632299963) + serializeInt32(period, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.setDefaultHistoryTTL", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setDefaultReaction(reaction: Api.Reaction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1330094102) + reaction.serialize(buffer, true) + return (FunctionDescription(name: "messages.setDefaultReaction", parameters: [("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setEncryptedTyping(peer: Api.InputEncryptedChat, typing: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2031374829) + peer.serialize(buffer, true) + typing.serialize(buffer, true) + return (FunctionDescription(name: "messages.setEncryptedTyping", parameters: [("peer", String(describing: peer)), ("typing", String(describing: typing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setGameScore(flags: Int32, peer: Api.InputPeer, id: Int32, userId: Api.InputUser, score: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1896289088) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + serializeInt32(score, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.setGameScore", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func setHistoryTTL(peer: Api.InputPeer, period: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1207017500) + peer.serialize(buffer, true) + serializeInt32(period, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.setHistoryTTL", parameters: [("peer", String(describing: peer)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func setInlineBotResults(flags: Int32, queryId: Int64, results: [Api.InputBotInlineResult], cacheTime: Int32, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1156406247) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(queryId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(results.count)) + for item in results { + item.serialize(buffer, true) + } + serializeInt32(cacheTime, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + serializeString(nextOffset!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + switchPm!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 4) != 0 { + switchWebview!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.setInlineBotResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("results", String(describing: results)), ("cacheTime", String(describing: cacheTime)), ("nextOffset", String(describing: nextOffset)), ("switchPm", String(describing: switchPm)), ("switchWebview", String(describing: switchWebview))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setInlineGameScore(flags: Int32, id: Api.InputBotInlineMessageID, userId: Api.InputUser, score: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(363700068) + serializeInt32(flags, buffer: buffer, boxed: false) + id.serialize(buffer, true) + userId.serialize(buffer, true) + serializeInt32(score, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.setInlineGameScore", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func setTyping(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, action: Api.SendMessageAction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1486110434) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + action.serialize(buffer, true) + return (FunctionDescription(name: "messages.setTyping", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("action", String(describing: action))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func startBot(bot: Api.InputUser, peer: Api.InputPeer, randomId: Int64, startParam: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-421563528) + bot.serialize(buffer, true) + peer.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + serializeString(startParam, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.startBot", parameters: [("bot", String(describing: bot)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("startParam", String(describing: startParam))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func startHistoryImport(peer: Api.InputPeer, importId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1271008444) + peer.serialize(buffer, true) + serializeInt64(importId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.startHistoryImport", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func summarizeText(flags: Int32, peer: Api.InputPeer, id: Int32, toLang: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1656683294) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(toLang!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in + let reader = BufferReader(buffer) + var result: Api.TextWithEntities? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleBotInAttachMenu(flags: Int32, bot: Api.InputUser, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1777704297) + serializeInt32(flags, buffer: buffer, boxed: false) + bot.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "messages.toggleBotInAttachMenu", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleDialogFilterTags(enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-47326647) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "messages.toggleDialogFilterTags", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleDialogPin(flags: Int32, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1489903017) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.toggleDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleNoForwards(peer: Api.InputPeer, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1323389022) + peer.serialize(buffer, true) + enabled.serialize(buffer, true) + return (FunctionDescription(name: "messages.toggleNoForwards", parameters: [("peer", String(describing: peer)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func togglePaidReactionPrivacy(peer: Api.InputPeer, msgId: Int32, `private`: Api.PaidReactionPrivacy) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1129874869) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + `private`.serialize(buffer, true) + return (FunctionDescription(name: "messages.togglePaidReactionPrivacy", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func togglePeerTranslations(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-461589127) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.togglePeerTranslations", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleSavedDialogPin(flags: Int32, peer: Api.InputDialogPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1400783906) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.toggleSavedDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleStickerSets(flags: Int32, stickersets: [Api.InputStickerSet]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1257951254) + serializeInt32(flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stickersets.count)) + for item in stickersets { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.toggleStickerSets", parameters: [("flags", String(describing: flags)), ("stickersets", String(describing: stickersets))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleSuggestedPostApproval(flags: Int32, peer: Api.InputPeer, msgId: Int32, scheduleDate: Int32?, rejectComment: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2130229924) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(rejectComment!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.toggleSuggestedPostApproval", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("scheduleDate", String(describing: scheduleDate)), ("rejectComment", String(describing: rejectComment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func toggleTodoCompleted(peer: Api.InputPeer, msgId: Int32, completed: [Int32], incompleted: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-740282076) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(completed.count)) + for item in completed { + serializeInt32(item, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(incompleted.count)) + for item in incompleted { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.toggleTodoCompleted", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("completed", String(describing: completed)), ("incompleted", String(describing: incompleted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func transcribeAudio(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(647928393) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.transcribeAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranscribedAudio? in + let reader = BufferReader(buffer) + var result: Api.messages.TranscribedAudio? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.TranscribedAudio + } + return result + }) + } +} +public extension Api.functions.messages { + static func translateText(flags: Int32, peer: Api.InputPeer?, id: [Int32]?, text: [Api.TextWithEntities]?, toLang: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1662529584) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + peer!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id!.count)) + for item in id! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(text!.count)) + for item in text! { + item.serialize(buffer, true) + } + } + serializeString(toLang, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.translateText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("text", String(describing: text)), ("toLang", String(describing: toLang))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranslatedText? in + let reader = BufferReader(buffer) + var result: Api.messages.TranslatedText? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.TranslatedText + } + return result + }) + } +} +public extension Api.functions.messages { + static func uninstallStickerSet(stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-110209570) + stickerset.serialize(buffer, true) + return (FunctionDescription(name: "messages.uninstallStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func unpinAllMessages(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?, savedPeerId: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(103667527) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(topMsgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + savedPeerId!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.unpinAllMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + let reader = BufferReader(buffer) + var result: Api.messages.AffectedHistory? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.AffectedHistory + } + return result + }) + } +} +public extension Api.functions.messages { + static func updateDialogFilter(flags: Int32, id: Int32, filter: Api.DialogFilter?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(450142282) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + filter!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.updateDialogFilter", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("filter", String(describing: filter))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func updateDialogFiltersOrder(order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-983318044) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.updateDialogFiltersOrder", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func updatePinnedForumTopic(peer: Api.InputPeer, topicId: Int32, pinned: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(392032849) + peer.serialize(buffer, true) + serializeInt32(topicId, buffer: buffer, boxed: false) + pinned.serialize(buffer, true) + return (FunctionDescription(name: "messages.updatePinnedForumTopic", parameters: [("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func updatePinnedMessage(flags: Int32, peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-760547348) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.updatePinnedMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } +} +public extension Api.functions.messages { + static func updateSavedReactionTag(flags: Int32, reaction: Api.Reaction, title: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1613331948) + serializeInt32(flags, buffer: buffer, boxed: false) + reaction.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.updateSavedReactionTag", parameters: [("flags", String(describing: flags)), ("reaction", String(describing: reaction)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.messages { + static func uploadEncryptedFile(peer: Api.InputEncryptedChat, file: Api.InputEncryptedFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1347929239) + peer.serialize(buffer, true) + file.serialize(buffer, true) + return (FunctionDescription(name: "messages.uploadEncryptedFile", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedFile? in + let reader = BufferReader(buffer) + var result: Api.EncryptedFile? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.EncryptedFile + } + return result + }) + } +} +public extension Api.functions.messages { + static func uploadImportedMedia(peer: Api.InputPeer, importId: Int64, fileName: String, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(713433234) + peer.serialize(buffer, true) + serializeInt64(importId, buffer: buffer, boxed: false) + serializeString(fileName, buffer: buffer, boxed: false) + media.serialize(buffer, true) + return (FunctionDescription(name: "messages.uploadImportedMedia", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId)), ("fileName", String(describing: fileName)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in + let reader = BufferReader(buffer) + var result: Api.MessageMedia? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + return result + }) + } +} +public extension Api.functions.messages { + static func uploadMedia(flags: Int32, businessConnectionId: String?, peer: Api.InputPeer, media: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(345405816) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(businessConnectionId!, buffer: buffer, boxed: false) + } + peer.serialize(buffer, true) + media.serialize(buffer, true) + return (FunctionDescription(name: "messages.uploadMedia", parameters: [("flags", String(describing: flags)), ("businessConnectionId", String(describing: businessConnectionId)), ("peer", String(describing: peer)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in + let reader = BufferReader(buffer) + var result: Api.MessageMedia? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + return result + }) + } +} +public extension Api.functions.messages { + static func viewSponsoredMessage(randomId: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(647902787) + serializeBytes(randomId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.viewSponsoredMessage", parameters: [("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func applyGiftCode(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-152934316) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.applyGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func applyGiftCode(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-152934316) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.applyGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func assignAppStoreTransaction(receipt: Buffer, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2131921795) - serializeBytes(receipt, buffer: buffer, boxed: false) - purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.assignAppStoreTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func assignAppStoreTransaction(receipt: Buffer, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2131921795) + serializeBytes(receipt, buffer: buffer, boxed: false) + purpose.serialize(buffer, true) + return (FunctionDescription(name: "payments.assignAppStoreTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func assignPlayMarketTransaction(receipt: Api.DataJSON, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-537046829) - receipt.serialize(buffer, true) - purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.assignPlayMarketTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func assignPlayMarketTransaction(receipt: Api.DataJSON, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-537046829) + receipt.serialize(buffer, true) + purpose.serialize(buffer, true) + return (FunctionDescription(name: "payments.assignPlayMarketTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func botCancelStarsSubscription(flags: Int32, userId: Api.InputUser, chargeId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1845102114) - serializeInt32(flags, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeString(chargeId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.botCancelStarsSubscription", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func botCancelStarsSubscription(flags: Int32, userId: Api.InputUser, chargeId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1845102114) + serializeInt32(flags, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + serializeString(chargeId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.botCancelStarsSubscription", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func canPurchaseStore(purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1339842215) - purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.canPurchaseStore", parameters: [("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func canPurchaseStore(purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1339842215) + purpose.serialize(buffer, true) + return (FunctionDescription(name: "payments.canPurchaseStore", parameters: [("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func changeStarsSubscription(flags: Int32, peer: Api.InputPeer, subscriptionId: String, canceled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-948500360) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(subscriptionId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {canceled!.serialize(buffer, true)} - return (FunctionDescription(name: "payments.changeStarsSubscription", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId)), ("canceled", String(describing: canceled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func changeStarsSubscription(flags: Int32, peer: Api.InputPeer, subscriptionId: String, canceled: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-948500360) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(subscriptionId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + canceled!.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.changeStarsSubscription", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId)), ("canceled", String(describing: canceled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func checkCanSendGift(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1060835895) - serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.checkCanSendGift", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckCanSendGiftResult? in - let reader = BufferReader(buffer) - var result: Api.payments.CheckCanSendGiftResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.CheckCanSendGiftResult - } - return result - }) - } + static func checkCanSendGift(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1060835895) + serializeInt64(giftId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.checkCanSendGift", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckCanSendGiftResult? in + let reader = BufferReader(buffer) + var result: Api.payments.CheckCanSendGiftResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.CheckCanSendGiftResult + } + return result + }) + } } public extension Api.functions.payments { - static func checkGiftCode(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1907247935) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.checkGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckedGiftCode? in - let reader = BufferReader(buffer) - var result: Api.payments.CheckedGiftCode? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.CheckedGiftCode - } - return result - }) - } + static func checkGiftCode(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1907247935) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.checkGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckedGiftCode? in + let reader = BufferReader(buffer) + var result: Api.payments.CheckedGiftCode? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.CheckedGiftCode + } + return result + }) + } } public extension Api.functions.payments { - static func clearSavedInfo(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-667062079) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.clearSavedInfo", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func clearSavedInfo(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-667062079) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.clearSavedInfo", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func connectStarRefBot(peer: Api.InputPeer, bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2127901834) - peer.serialize(buffer, true) - bot.serialize(buffer, true) - return (FunctionDescription(name: "payments.connectStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in - let reader = BufferReader(buffer) - var result: Api.payments.ConnectedStarRefBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots - } - return result - }) - } + static func connectStarRefBot(peer: Api.InputPeer, bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2127901834) + peer.serialize(buffer, true) + bot.serialize(buffer, true) + return (FunctionDescription(name: "payments.connectStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + let reader = BufferReader(buffer) + var result: Api.payments.ConnectedStarRefBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots + } + return result + }) + } } public extension Api.functions.payments { - static func convertStarGift(stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1958676331) - stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.convertStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func convertStarGift(stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1958676331) + stargift.serialize(buffer, true) + return (FunctionDescription(name: "payments.convertStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func craftStarGift(stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1325832113) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stargift.count)) - for item in stargift { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "payments.craftStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func craftStarGift(stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1325832113) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stargift.count)) + for item in stargift { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.craftStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func createStarGiftCollection(peer: Api.InputPeer, title: String, stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(524947079) - peer.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stargift.count)) - for item in stargift { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "payments.createStarGiftCollection", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in - let reader = BufferReader(buffer) - var result: Api.StarGiftCollection? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StarGiftCollection - } - return result - }) - } + static func createStarGiftCollection(peer: Api.InputPeer, title: String, stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(524947079) + peer.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stargift.count)) + for item in stargift { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.createStarGiftCollection", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in + let reader = BufferReader(buffer) + var result: Api.StarGiftCollection? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StarGiftCollection + } + return result + }) + } } public extension Api.functions.payments { - static func deleteStarGiftCollection(peer: Api.InputPeer, collectionId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1386854168) - peer.serialize(buffer, true) - serializeInt32(collectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.deleteStarGiftCollection", parameters: [("peer", String(describing: peer)), ("collectionId", String(describing: collectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deleteStarGiftCollection(peer: Api.InputPeer, collectionId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1386854168) + peer.serialize(buffer, true) + serializeInt32(collectionId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.deleteStarGiftCollection", parameters: [("peer", String(describing: peer)), ("collectionId", String(describing: collectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func editConnectedStarRefBot(flags: Int32, peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-453204829) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.editConnectedStarRefBot", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in - let reader = BufferReader(buffer) - var result: Api.payments.ConnectedStarRefBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots - } - return result - }) - } + static func editConnectedStarRefBot(flags: Int32, peer: Api.InputPeer, link: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-453204829) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(link, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.editConnectedStarRefBot", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + let reader = BufferReader(buffer) + var result: Api.payments.ConnectedStarRefBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots + } + return result + }) + } } public extension Api.functions.payments { - static func exportInvoice(invoiceMedia: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(261206117) - invoiceMedia.serialize(buffer, true) - return (FunctionDescription(name: "payments.exportInvoice", parameters: [("invoiceMedia", String(describing: invoiceMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ExportedInvoice? in - let reader = BufferReader(buffer) - var result: Api.payments.ExportedInvoice? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ExportedInvoice - } - return result - }) - } + static func exportInvoice(invoiceMedia: Api.InputMedia) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(261206117) + invoiceMedia.serialize(buffer, true) + return (FunctionDescription(name: "payments.exportInvoice", parameters: [("invoiceMedia", String(describing: invoiceMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ExportedInvoice? in + let reader = BufferReader(buffer) + var result: Api.payments.ExportedInvoice? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ExportedInvoice + } + return result + }) + } } public extension Api.functions.payments { - static func fulfillStarsSubscription(peer: Api.InputPeer, subscriptionId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-866391117) - peer.serialize(buffer, true) - serializeString(subscriptionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.fulfillStarsSubscription", parameters: [("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func fulfillStarsSubscription(peer: Api.InputPeer, subscriptionId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-866391117) + peer.serialize(buffer, true) + serializeString(subscriptionId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.fulfillStarsSubscription", parameters: [("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func getBankCardData(number: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(779736953) - serializeString(number, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getBankCardData", parameters: [("number", String(describing: number))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.BankCardData? in - let reader = BufferReader(buffer) - var result: Api.payments.BankCardData? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.BankCardData - } - return result - }) - } + static func getBankCardData(number: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(779736953) + serializeString(number, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getBankCardData", parameters: [("number", String(describing: number))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.BankCardData? in + let reader = BufferReader(buffer) + var result: Api.payments.BankCardData? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.BankCardData + } + return result + }) + } } public extension Api.functions.payments { - static func getConnectedStarRefBot(peer: Api.InputPeer, bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1210476304) - peer.serialize(buffer, true) - bot.serialize(buffer, true) - return (FunctionDescription(name: "payments.getConnectedStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in - let reader = BufferReader(buffer) - var result: Api.payments.ConnectedStarRefBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots - } - return result - }) - } + static func getConnectedStarRefBot(peer: Api.InputPeer, bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1210476304) + peer.serialize(buffer, true) + bot.serialize(buffer, true) + return (FunctionDescription(name: "payments.getConnectedStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + let reader = BufferReader(buffer) + var result: Api.payments.ConnectedStarRefBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots + } + return result + }) + } } public extension Api.functions.payments { - static func getConnectedStarRefBots(flags: Int32, peer: Api.InputPeer, offsetDate: Int32?, offsetLink: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1483318611) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(offsetDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(offsetLink!, buffer: buffer, boxed: false)} - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getConnectedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in - let reader = BufferReader(buffer) - var result: Api.payments.ConnectedStarRefBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots - } - return result - }) - } + static func getConnectedStarRefBots(flags: Int32, peer: Api.InputPeer, offsetDate: Int32?, offsetLink: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1483318611) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(offsetDate!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(offsetLink!, buffer: buffer, boxed: false) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getConnectedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + let reader = BufferReader(buffer) + var result: Api.payments.ConnectedStarRefBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ConnectedStarRefBots + } + return result + }) + } } public extension Api.functions.payments { - static func getCraftStarGifts(giftId: Int64, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-49947392) - serializeInt64(giftId, buffer: buffer, boxed: false) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getCraftStarGifts", parameters: [("giftId", String(describing: giftId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.SavedStarGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts - } - return result - }) - } + static func getCraftStarGifts(giftId: Int64, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-49947392) + serializeInt64(giftId, buffer: buffer, boxed: false) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getCraftStarGifts", parameters: [("giftId", String(describing: giftId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.SavedStarGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getGiveawayInfo(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-198994907) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getGiveawayInfo", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.GiveawayInfo? in - let reader = BufferReader(buffer) - var result: Api.payments.GiveawayInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.GiveawayInfo - } - return result - }) - } + static func getGiveawayInfo(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-198994907) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getGiveawayInfo", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.GiveawayInfo? in + let reader = BufferReader(buffer) + var result: Api.payments.GiveawayInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.GiveawayInfo + } + return result + }) + } } public extension Api.functions.payments { - static func getPaymentForm(flags: Int32, invoice: Api.InputInvoice, themeParams: Api.DataJSON?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(924093883) - serializeInt32(flags, buffer: buffer, boxed: false) - invoice.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {themeParams!.serialize(buffer, true)} - return (FunctionDescription(name: "payments.getPaymentForm", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("themeParams", String(describing: themeParams))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentForm? in - let reader = BufferReader(buffer) - var result: Api.payments.PaymentForm? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.PaymentForm - } - return result - }) - } + static func getPaymentForm(flags: Int32, invoice: Api.InputInvoice, themeParams: Api.DataJSON?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(924093883) + serializeInt32(flags, buffer: buffer, boxed: false) + invoice.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + themeParams!.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.getPaymentForm", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("themeParams", String(describing: themeParams))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentForm? in + let reader = BufferReader(buffer) + var result: Api.payments.PaymentForm? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.PaymentForm + } + return result + }) + } } public extension Api.functions.payments { - static func getPaymentReceipt(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(611897804) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getPaymentReceipt", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentReceipt? in - let reader = BufferReader(buffer) - var result: Api.payments.PaymentReceipt? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.PaymentReceipt - } - return result - }) - } + static func getPaymentReceipt(peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(611897804) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getPaymentReceipt", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentReceipt? in + let reader = BufferReader(buffer) + var result: Api.payments.PaymentReceipt? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.PaymentReceipt + } + return result + }) + } } public extension Api.functions.payments { - static func getPremiumGiftCodeOptions(flags: Int32, boostPeer: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.PremiumGiftCodeOption]>) { - let buffer = Buffer() - buffer.appendInt32(660060756) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {boostPeer!.serialize(buffer, true)} - return (FunctionDescription(name: "payments.getPremiumGiftCodeOptions", parameters: [("flags", String(describing: flags)), ("boostPeer", String(describing: boostPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.PremiumGiftCodeOption]? in - let reader = BufferReader(buffer) - var result: [Api.PremiumGiftCodeOption]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.PremiumGiftCodeOption.self) - } - return result - }) - } + static func getPremiumGiftCodeOptions(flags: Int32, boostPeer: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.PremiumGiftCodeOption]>) { + let buffer = Buffer() + buffer.appendInt32(660060756) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + boostPeer!.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.getPremiumGiftCodeOptions", parameters: [("flags", String(describing: flags)), ("boostPeer", String(describing: boostPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.PremiumGiftCodeOption]? in + let reader = BufferReader(buffer) + var result: [Api.PremiumGiftCodeOption]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.PremiumGiftCodeOption.self) + } + return result + }) + } } public extension Api.functions.payments { - static func getResaleStarGifts(flags: Int32, attributesHash: Int64?, giftId: Int64, attributes: [Api.StarGiftAttributeId]?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2053087798) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(attributesHash!, buffer: buffer, boxed: false)} - serializeInt64(giftId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes!.count)) - for item in attributes! { - item.serialize(buffer, true) - }} - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getResaleStarGifts", parameters: [("flags", String(describing: flags)), ("attributesHash", String(describing: attributesHash)), ("giftId", String(describing: giftId)), ("attributes", String(describing: attributes)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ResaleStarGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.ResaleStarGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ResaleStarGifts - } - return result - }) - } + static func getResaleStarGifts(flags: Int32, attributesHash: Int64?, giftId: Int64, attributes: [Api.StarGiftAttributeId]?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2053087798) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(attributesHash!, buffer: buffer, boxed: false) + } + serializeInt64(giftId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(attributes!.count)) + for item in attributes! { + item.serialize(buffer, true) + } + } + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getResaleStarGifts", parameters: [("flags", String(describing: flags)), ("attributesHash", String(describing: attributesHash)), ("giftId", String(describing: giftId)), ("attributes", String(describing: attributes)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ResaleStarGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.ResaleStarGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ResaleStarGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getSavedInfo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(578650699) - - return (FunctionDescription(name: "payments.getSavedInfo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedInfo? in - let reader = BufferReader(buffer) - var result: Api.payments.SavedInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.SavedInfo - } - return result - }) - } + static func getSavedInfo() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(578650699) + return (FunctionDescription(name: "payments.getSavedInfo", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedInfo? in + let reader = BufferReader(buffer) + var result: Api.payments.SavedInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.SavedInfo + } + return result + }) + } } public extension Api.functions.payments { - static func getSavedStarGift(stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1269456634) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stargift.count)) - for item in stargift { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "payments.getSavedStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.SavedStarGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts - } - return result - }) - } + static func getSavedStarGift(stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1269456634) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stargift.count)) + for item in stargift { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.getSavedStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.SavedStarGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getSavedStarGifts(flags: Int32, peer: Api.InputPeer, collectionId: Int32?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1558583959) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(collectionId!, buffer: buffer, boxed: false)} - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getSavedStarGifts", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.SavedStarGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts - } - return result - }) - } + static func getSavedStarGifts(flags: Int32, peer: Api.InputPeer, collectionId: Int32?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1558583959) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 6) != 0 { + serializeInt32(collectionId!, buffer: buffer, boxed: false) + } + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getSavedStarGifts", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.SavedStarGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.SavedStarGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftActiveAuctions(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1513074355) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftActiveAuctions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftActiveAuctions? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftActiveAuctions? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftActiveAuctions - } - return result - }) - } + static func getStarGiftActiveAuctions(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1513074355) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftActiveAuctions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftActiveAuctions? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftActiveAuctions? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftActiveAuctions + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftAuctionAcquiredGifts(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1805831148) - serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftAuctionAcquiredGifts", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionAcquiredGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftAuctionAcquiredGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftAuctionAcquiredGifts - } - return result - }) - } + static func getStarGiftAuctionAcquiredGifts(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1805831148) + serializeInt64(giftId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftAuctionAcquiredGifts", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionAcquiredGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftAuctionAcquiredGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftAuctionAcquiredGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftAuctionState(auction: Api.InputStarGiftAuction, version: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1553986774) - auction.serialize(buffer, true) - serializeInt32(version, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftAuctionState", parameters: [("auction", String(describing: auction)), ("version", String(describing: version))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionState? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftAuctionState? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftAuctionState - } - return result - }) - } + static func getStarGiftAuctionState(auction: Api.InputStarGiftAuction, version: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1553986774) + auction.serialize(buffer, true) + serializeInt32(version, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftAuctionState", parameters: [("auction", String(describing: auction)), ("version", String(describing: version))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionState? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftAuctionState? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftAuctionState + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftCollections(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1743023651) - peer.serialize(buffer, true) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftCollections", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftCollections? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftCollections? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftCollections - } - return result - }) - } + static func getStarGiftCollections(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1743023651) + peer.serialize(buffer, true) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftCollections", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftCollections? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftCollections? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftCollections + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftUpgradeAttributes(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1828948824) - serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftUpgradeAttributes", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradeAttributes? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftUpgradeAttributes? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftUpgradeAttributes - } - return result - }) - } + static func getStarGiftUpgradeAttributes(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1828948824) + serializeInt64(giftId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftUpgradeAttributes", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradeAttributes? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftUpgradeAttributes? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftUpgradeAttributes + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftUpgradePreview(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1667580751) - serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftUpgradePreview", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradePreview? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftUpgradePreview? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftUpgradePreview - } - return result - }) - } + static func getStarGiftUpgradePreview(giftId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1667580751) + serializeInt64(giftId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGiftUpgradePreview", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradePreview? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftUpgradePreview? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftUpgradePreview + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGiftWithdrawalUrl(stargift: Api.InputSavedStarGift, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-798059608) - stargift.serialize(buffer, true) - password.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarGiftWithdrawalUrl", parameters: [("stargift", String(describing: stargift)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftWithdrawalUrl? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGiftWithdrawalUrl? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftWithdrawalUrl - } - return result - }) - } + static func getStarGiftWithdrawalUrl(stargift: Api.InputSavedStarGift, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-798059608) + stargift.serialize(buffer, true) + password.serialize(buffer, true) + return (FunctionDescription(name: "payments.getStarGiftWithdrawalUrl", parameters: [("stargift", String(describing: stargift)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftWithdrawalUrl? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGiftWithdrawalUrl? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGiftWithdrawalUrl + } + return result + }) + } } public extension Api.functions.payments { - static func getStarGifts(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1000983152) - serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGifts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGifts? in - let reader = BufferReader(buffer) - var result: Api.payments.StarGifts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarGifts - } - return result - }) - } + static func getStarGifts(hash: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1000983152) + serializeInt32(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarGifts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGifts? in + let reader = BufferReader(buffer) + var result: Api.payments.StarGifts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarGifts + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsGiftOptions(flags: Int32, userId: Api.InputUser?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsGiftOption]>) { - let buffer = Buffer() - buffer.appendInt32(-741774392) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {userId!.serialize(buffer, true)} - return (FunctionDescription(name: "payments.getStarsGiftOptions", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiftOption]? in - let reader = BufferReader(buffer) - var result: [Api.StarsGiftOption]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiftOption.self) - } - return result - }) - } + static func getStarsGiftOptions(flags: Int32, userId: Api.InputUser?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsGiftOption]>) { + let buffer = Buffer() + buffer.appendInt32(-741774392) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + userId!.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.getStarsGiftOptions", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiftOption]? in + let reader = BufferReader(buffer) + var result: [Api.StarsGiftOption]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiftOption.self) + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsGiveawayOptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsGiveawayOption]>) { - let buffer = Buffer() - buffer.appendInt32(-1122042562) - - return (FunctionDescription(name: "payments.getStarsGiveawayOptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiveawayOption]? in - let reader = BufferReader(buffer) - var result: [Api.StarsGiveawayOption]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiveawayOption.self) - } - return result - }) - } + static func getStarsGiveawayOptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsGiveawayOption]>) { + let buffer = Buffer() + buffer.appendInt32(-1122042562) + return (FunctionDescription(name: "payments.getStarsGiveawayOptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiveawayOption]? in + let reader = BufferReader(buffer) + var result: [Api.StarsGiveawayOption]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiveawayOption.self) + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsRevenueAdsAccountUrl(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-774377531) - peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueAdsAccountUrl", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueAdsAccountUrl? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsRevenueAdsAccountUrl? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueAdsAccountUrl - } - return result - }) - } + static func getStarsRevenueAdsAccountUrl(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-774377531) + peer.serialize(buffer, true) + return (FunctionDescription(name: "payments.getStarsRevenueAdsAccountUrl", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueAdsAccountUrl? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsRevenueAdsAccountUrl? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueAdsAccountUrl + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsRevenueStats(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-652215594) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueStats? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsRevenueStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueStats - } - return result - }) - } + static func getStarsRevenueStats(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-652215594) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "payments.getStarsRevenueStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueStats? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsRevenueStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueStats + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsRevenueWithdrawalUrl(flags: Int32, peer: Api.InputPeer, amount: Int64?, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(607378578) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(amount!, buffer: buffer, boxed: false)} - password.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueWithdrawalUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("amount", String(describing: amount)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueWithdrawalUrl? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsRevenueWithdrawalUrl? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueWithdrawalUrl - } - return result - }) - } + static func getStarsRevenueWithdrawalUrl(flags: Int32, peer: Api.InputPeer, amount: Int64?, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(607378578) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeInt64(amount!, buffer: buffer, boxed: false) + } + password.serialize(buffer, true) + return (FunctionDescription(name: "payments.getStarsRevenueWithdrawalUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("amount", String(describing: amount)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueWithdrawalUrl? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsRevenueWithdrawalUrl? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsRevenueWithdrawalUrl + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsStatus(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1319744447) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsStatus", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsStatus? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus - } - return result - }) - } + static func getStarsStatus(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1319744447) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "payments.getStarsStatus", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsStatus? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsSubscriptions(flags: Int32, peer: Api.InputPeer, offset: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(52761285) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarsSubscriptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsStatus? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus - } - return result - }) - } + static func getStarsSubscriptions(flags: Int32, peer: Api.InputPeer, offset: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(52761285) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(offset, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarsSubscriptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsStatus? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsTopupOptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsTopupOption]>) { - let buffer = Buffer() - buffer.appendInt32(-1072773165) - - return (FunctionDescription(name: "payments.getStarsTopupOptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsTopupOption]? in - let reader = BufferReader(buffer) - var result: [Api.StarsTopupOption]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTopupOption.self) - } - return result - }) - } + static func getStarsTopupOptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.StarsTopupOption]>) { + let buffer = Buffer() + buffer.appendInt32(-1072773165) + return (FunctionDescription(name: "payments.getStarsTopupOptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsTopupOption]? in + let reader = BufferReader(buffer) + var result: [Api.StarsTopupOption]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTopupOption.self) + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsTransactions(flags: Int32, subscriptionId: String?, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1775912279) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(subscriptionId!, buffer: buffer, boxed: false)} - peer.serialize(buffer, true) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarsTransactions", parameters: [("flags", String(describing: flags)), ("subscriptionId", String(describing: subscriptionId)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsStatus? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus - } - return result - }) - } + static func getStarsTransactions(flags: Int32, subscriptionId: String?, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1775912279) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + serializeString(subscriptionId!, buffer: buffer, boxed: false) + } + peer.serialize(buffer, true) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getStarsTransactions", parameters: [("flags", String(describing: flags)), ("subscriptionId", String(describing: subscriptionId)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsStatus? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus + } + return result + }) + } } public extension Api.functions.payments { - static func getStarsTransactionsByID(flags: Int32, peer: Api.InputPeer, id: [Api.InputStarsTransaction]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(768218808) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "payments.getStarsTransactionsByID", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in - let reader = BufferReader(buffer) - var result: Api.payments.StarsStatus? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus - } - return result - }) - } + static func getStarsTransactionsByID(flags: Int32, peer: Api.InputPeer, id: [Api.InputStarsTransaction]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(768218808) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.getStarsTransactionsByID", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + let reader = BufferReader(buffer) + var result: Api.payments.StarsStatus? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.StarsStatus + } + return result + }) + } } public extension Api.functions.payments { - static func getSuggestedStarRefBots(flags: Int32, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(225134839) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getSuggestedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SuggestedStarRefBots? in - let reader = BufferReader(buffer) - var result: Api.payments.SuggestedStarRefBots? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.SuggestedStarRefBots - } - return result - }) - } + static func getSuggestedStarRefBots(flags: Int32, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(225134839) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getSuggestedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SuggestedStarRefBots? in + let reader = BufferReader(buffer) + var result: Api.payments.SuggestedStarRefBots? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.SuggestedStarRefBots + } + return result + }) + } } public extension Api.functions.payments { - static func getUniqueStarGift(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1583919758) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getUniqueStarGift", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGift? in - let reader = BufferReader(buffer) - var result: Api.payments.UniqueStarGift? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.UniqueStarGift - } - return result - }) - } + static func getUniqueStarGift(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1583919758) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getUniqueStarGift", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGift? in + let reader = BufferReader(buffer) + var result: Api.payments.UniqueStarGift? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.UniqueStarGift + } + return result + }) + } } public extension Api.functions.payments { - static func getUniqueStarGiftValueInfo(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1130737515) - serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getUniqueStarGiftValueInfo", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGiftValueInfo? in - let reader = BufferReader(buffer) - var result: Api.payments.UniqueStarGiftValueInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.UniqueStarGiftValueInfo - } - return result - }) - } + static func getUniqueStarGiftValueInfo(slug: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1130737515) + serializeString(slug, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.getUniqueStarGiftValueInfo", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGiftValueInfo? in + let reader = BufferReader(buffer) + var result: Api.payments.UniqueStarGiftValueInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.UniqueStarGiftValueInfo + } + return result + }) + } } public extension Api.functions.payments { - static func launchPrepaidGiveaway(peer: Api.InputPeer, giveawayId: Int64, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1609928480) - peer.serialize(buffer, true) - serializeInt64(giveawayId, buffer: buffer, boxed: false) - purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.launchPrepaidGiveaway", parameters: [("peer", String(describing: peer)), ("giveawayId", String(describing: giveawayId)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func launchPrepaidGiveaway(peer: Api.InputPeer, giveawayId: Int64, purpose: Api.InputStorePaymentPurpose) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1609928480) + peer.serialize(buffer, true) + serializeInt64(giveawayId, buffer: buffer, boxed: false) + purpose.serialize(buffer, true) + return (FunctionDescription(name: "payments.launchPrepaidGiveaway", parameters: [("peer", String(describing: peer)), ("giveawayId", String(describing: giveawayId)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func refundStarsCharge(userId: Api.InputUser, chargeId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(632196938) - userId.serialize(buffer, true) - serializeString(chargeId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.refundStarsCharge", parameters: [("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func refundStarsCharge(userId: Api.InputUser, chargeId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(632196938) + userId.serialize(buffer, true) + serializeString(chargeId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.refundStarsCharge", parameters: [("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func reorderStarGiftCollections(peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1020594996) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "payments.reorderStarGiftCollections", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reorderStarGiftCollections(peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1020594996) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "payments.reorderStarGiftCollections", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func resolveStarGiftOffer(flags: Int32, offerMsgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-372344804) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(offerMsgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.resolveStarGiftOffer", parameters: [("flags", String(describing: flags)), ("offerMsgId", String(describing: offerMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func resolveStarGiftOffer(flags: Int32, offerMsgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-372344804) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(offerMsgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "payments.resolveStarGiftOffer", parameters: [("flags", String(describing: flags)), ("offerMsgId", String(describing: offerMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func saveStarGift(flags: Int32, stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(707422588) - serializeInt32(flags, buffer: buffer, boxed: false) - stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.saveStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveStarGift(flags: Int32, stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(707422588) + serializeInt32(flags, buffer: buffer, boxed: false) + stargift.serialize(buffer, true) + return (FunctionDescription(name: "payments.saveStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func sendPaymentForm(flags: Int32, formId: Int64, invoice: Api.InputInvoice, requestedInfoId: String?, shippingOptionId: String?, credentials: Api.InputPaymentCredentials, tipAmount: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(755192367) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(formId, buffer: buffer, boxed: false) - invoice.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(requestedInfoId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(shippingOptionId!, buffer: buffer, boxed: false)} - credentials.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {serializeInt64(tipAmount!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "payments.sendPaymentForm", parameters: [("flags", String(describing: flags)), ("formId", String(describing: formId)), ("invoice", String(describing: invoice)), ("requestedInfoId", String(describing: requestedInfoId)), ("shippingOptionId", String(describing: shippingOptionId)), ("credentials", String(describing: credentials)), ("tipAmount", String(describing: tipAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in - let reader = BufferReader(buffer) - var result: Api.payments.PaymentResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.PaymentResult - } - return result - }) - } + static func sendPaymentForm(flags: Int32, formId: Int64, invoice: Api.InputInvoice, requestedInfoId: String?, shippingOptionId: String?, credentials: Api.InputPaymentCredentials, tipAmount: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(755192367) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(formId, buffer: buffer, boxed: false) + invoice.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(requestedInfoId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(shippingOptionId!, buffer: buffer, boxed: false) + } + credentials.serialize(buffer, true) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt64(tipAmount!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "payments.sendPaymentForm", parameters: [("flags", String(describing: flags)), ("formId", String(describing: formId)), ("invoice", String(describing: invoice)), ("requestedInfoId", String(describing: requestedInfoId)), ("shippingOptionId", String(describing: shippingOptionId)), ("credentials", String(describing: credentials)), ("tipAmount", String(describing: tipAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in + let reader = BufferReader(buffer) + var result: Api.payments.PaymentResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.PaymentResult + } + return result + }) + } } public extension Api.functions.payments { - static func sendStarGiftOffer(flags: Int32, peer: Api.InputPeer, slug: String, price: Api.StarsAmount, duration: Int32, randomId: Int64, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1883739327) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(slug, buffer: buffer, boxed: false) - price.serialize(buffer, true) - serializeInt32(duration, buffer: buffer, boxed: false) - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "payments.sendStarGiftOffer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("slug", String(describing: slug)), ("price", String(describing: price)), ("duration", String(describing: duration)), ("randomId", String(describing: randomId)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func sendStarGiftOffer(flags: Int32, peer: Api.InputPeer, slug: String, price: Api.StarsAmount, duration: Int32, randomId: Int64, allowPaidStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1883739327) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(slug, buffer: buffer, boxed: false) + price.serialize(buffer, true) + serializeInt32(duration, buffer: buffer, boxed: false) + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "payments.sendStarGiftOffer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("slug", String(describing: slug)), ("price", String(describing: price)), ("duration", String(describing: duration)), ("randomId", String(describing: randomId)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func sendStarsForm(formId: Int64, invoice: Api.InputInvoice) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2040056084) - serializeInt64(formId, buffer: buffer, boxed: false) - invoice.serialize(buffer, true) - return (FunctionDescription(name: "payments.sendStarsForm", parameters: [("formId", String(describing: formId)), ("invoice", String(describing: invoice))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in - let reader = BufferReader(buffer) - var result: Api.payments.PaymentResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.PaymentResult - } - return result - }) - } + static func sendStarsForm(formId: Int64, invoice: Api.InputInvoice) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2040056084) + serializeInt64(formId, buffer: buffer, boxed: false) + invoice.serialize(buffer, true) + return (FunctionDescription(name: "payments.sendStarsForm", parameters: [("formId", String(describing: formId)), ("invoice", String(describing: invoice))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in + let reader = BufferReader(buffer) + var result: Api.payments.PaymentResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.PaymentResult + } + return result + }) + } } public extension Api.functions.payments { - static func toggleChatStarGiftNotifications(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1626009505) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.toggleChatStarGiftNotifications", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleChatStarGiftNotifications(flags: Int32, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1626009505) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + return (FunctionDescription(name: "payments.toggleChatStarGiftNotifications", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func toggleStarGiftsPinnedToTop(peer: Api.InputPeer, stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(353626032) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stargift.count)) - for item in stargift { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "payments.toggleStarGiftsPinnedToTop", parameters: [("peer", String(describing: peer)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleStarGiftsPinnedToTop(peer: Api.InputPeer, stargift: [Api.InputSavedStarGift]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(353626032) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stargift.count)) + for item in stargift { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "payments.toggleStarGiftsPinnedToTop", parameters: [("peer", String(describing: peer)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.payments { - static func transferStarGift(stargift: Api.InputSavedStarGift, toId: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2132285290) - stargift.serialize(buffer, true) - toId.serialize(buffer, true) - return (FunctionDescription(name: "payments.transferStarGift", parameters: [("stargift", String(describing: stargift)), ("toId", String(describing: toId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func transferStarGift(stargift: Api.InputSavedStarGift, toId: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2132285290) + stargift.serialize(buffer, true) + toId.serialize(buffer, true) + return (FunctionDescription(name: "payments.transferStarGift", parameters: [("stargift", String(describing: stargift)), ("toId", String(describing: toId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func updateStarGiftCollection(flags: Int32, peer: Api.InputPeer, collectionId: Int32, title: String?, deleteStargift: [Api.InputSavedStarGift]?, addStargift: [Api.InputSavedStarGift]?, order: [Api.InputSavedStarGift]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1339932391) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(collectionId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(deleteStargift!.count)) - for item in deleteStargift! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(addStargift!.count)) - for item in addStargift! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order!.count)) - for item in order! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "payments.updateStarGiftCollection", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("title", String(describing: title)), ("deleteStargift", String(describing: deleteStargift)), ("addStargift", String(describing: addStargift)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in - let reader = BufferReader(buffer) - var result: Api.StarGiftCollection? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StarGiftCollection - } - return result - }) - } + static func updateStarGiftCollection(flags: Int32, peer: Api.InputPeer, collectionId: Int32, title: String?, deleteStargift: [Api.InputSavedStarGift]?, addStargift: [Api.InputSavedStarGift]?, order: [Api.InputSavedStarGift]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1339932391) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(collectionId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(deleteStargift!.count)) + for item in deleteStargift! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(addStargift!.count)) + for item in addStargift! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order!.count)) + for item in order! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "payments.updateStarGiftCollection", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("title", String(describing: title)), ("deleteStargift", String(describing: deleteStargift)), ("addStargift", String(describing: addStargift)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in + let reader = BufferReader(buffer) + var result: Api.StarGiftCollection? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StarGiftCollection + } + return result + }) + } } public extension Api.functions.payments { - static func updateStarGiftPrice(stargift: Api.InputSavedStarGift, resellAmount: Api.StarsAmount) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-306287413) - stargift.serialize(buffer, true) - resellAmount.serialize(buffer, true) - return (FunctionDescription(name: "payments.updateStarGiftPrice", parameters: [("stargift", String(describing: stargift)), ("resellAmount", String(describing: resellAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func updateStarGiftPrice(stargift: Api.InputSavedStarGift, resellAmount: Api.StarsAmount) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-306287413) + stargift.serialize(buffer, true) + resellAmount.serialize(buffer, true) + return (FunctionDescription(name: "payments.updateStarGiftPrice", parameters: [("stargift", String(describing: stargift)), ("resellAmount", String(describing: resellAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func upgradeStarGift(flags: Int32, stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1361648395) - serializeInt32(flags, buffer: buffer, boxed: false) - stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.upgradeStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func upgradeStarGift(flags: Int32, stargift: Api.InputSavedStarGift) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1361648395) + serializeInt32(flags, buffer: buffer, boxed: false) + stargift.serialize(buffer, true) + return (FunctionDescription(name: "payments.upgradeStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.payments { - static func validateRequestedInfo(flags: Int32, invoice: Api.InputInvoice, info: Api.PaymentRequestedInfo) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1228345045) - serializeInt32(flags, buffer: buffer, boxed: false) - invoice.serialize(buffer, true) - info.serialize(buffer, true) - return (FunctionDescription(name: "payments.validateRequestedInfo", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("info", String(describing: info))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ValidatedRequestedInfo? in - let reader = BufferReader(buffer) - var result: Api.payments.ValidatedRequestedInfo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.payments.ValidatedRequestedInfo - } - return result - }) - } + static func validateRequestedInfo(flags: Int32, invoice: Api.InputInvoice, info: Api.PaymentRequestedInfo) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1228345045) + serializeInt32(flags, buffer: buffer, boxed: false) + invoice.serialize(buffer, true) + info.serialize(buffer, true) + return (FunctionDescription(name: "payments.validateRequestedInfo", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("info", String(describing: info))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ValidatedRequestedInfo? in + let reader = BufferReader(buffer) + var result: Api.payments.ValidatedRequestedInfo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.payments.ValidatedRequestedInfo + } + return result + }) + } } public extension Api.functions.phone { - static func acceptCall(peer: Api.InputPhoneCall, gB: Buffer, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1003664544) - peer.serialize(buffer, true) - serializeBytes(gB, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.acceptCall", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in - let reader = BufferReader(buffer) - var result: Api.phone.PhoneCall? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall - } - return result - }) - } + static func acceptCall(peer: Api.InputPhoneCall, gB: Buffer, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1003664544) + peer.serialize(buffer, true) + serializeBytes(gB, buffer: buffer, boxed: false) + `protocol`.serialize(buffer, true) + return (FunctionDescription(name: "phone.acceptCall", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + let reader = BufferReader(buffer) + var result: Api.phone.PhoneCall? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall + } + return result + }) + } } public extension Api.functions.phone { - static func checkGroupCall(call: Api.InputGroupCall, sources: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { - let buffer = Buffer() - buffer.appendInt32(-1248003721) - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sources.count)) - for item in sources { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "phone.checkGroupCall", parameters: [("call", String(describing: call)), ("sources", String(describing: sources))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - return result - }) - } + static func checkGroupCall(call: Api.InputGroupCall, sources: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { + let buffer = Buffer() + buffer.appendInt32(-1248003721) + call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(sources.count)) + for item in sources { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "phone.checkGroupCall", parameters: [("call", String(describing: call)), ("sources", String(describing: sources))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + let reader = BufferReader(buffer) + var result: [Int32]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + return result + }) + } } public extension Api.functions.phone { - static func confirmCall(peer: Api.InputPhoneCall, gA: Buffer, keyFingerprint: Int64, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(788404002) - peer.serialize(buffer, true) - serializeBytes(gA, buffer: buffer, boxed: false) - serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.confirmCall", parameters: [("peer", String(describing: peer)), ("gA", String(describing: gA)), ("keyFingerprint", String(describing: keyFingerprint)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in - let reader = BufferReader(buffer) - var result: Api.phone.PhoneCall? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall - } - return result - }) - } + static func confirmCall(peer: Api.InputPhoneCall, gA: Buffer, keyFingerprint: Int64, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(788404002) + peer.serialize(buffer, true) + serializeBytes(gA, buffer: buffer, boxed: false) + serializeInt64(keyFingerprint, buffer: buffer, boxed: false) + `protocol`.serialize(buffer, true) + return (FunctionDescription(name: "phone.confirmCall", parameters: [("peer", String(describing: peer)), ("gA", String(describing: gA)), ("keyFingerprint", String(describing: keyFingerprint)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + let reader = BufferReader(buffer) + var result: Api.phone.PhoneCall? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall + } + return result + }) + } } public extension Api.functions.phone { - static func createConferenceCall(flags: Int32, randomId: Int32, publicKey: Int256?, block: Buffer?, params: Api.DataJSON?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2097431739) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt256(publicKey!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeBytes(block!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {params!.serialize(buffer, true)} - return (FunctionDescription(name: "phone.createConferenceCall", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func createConferenceCall(flags: Int32, randomId: Int32, publicKey: Int256?, block: Buffer?, params: Api.DataJSON?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2097431739) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + serializeInt256(publicKey!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeBytes(block!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + params!.serialize(buffer, true) + } + return (FunctionDescription(name: "phone.createConferenceCall", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func createGroupCall(flags: Int32, peer: Api.InputPeer, randomId: Int32, title: String?, scheduleDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1221445336) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "phone.createGroupCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("title", String(describing: title)), ("scheduleDate", String(describing: scheduleDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func createGroupCall(flags: Int32, peer: Api.InputPeer, randomId: Int32, title: String?, scheduleDate: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1221445336) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(scheduleDate!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "phone.createGroupCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("title", String(describing: title)), ("scheduleDate", String(describing: scheduleDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func declineConferenceCallInvite(msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1011325297) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.declineConferenceCallInvite", parameters: [("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func declineConferenceCallInvite(msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1011325297) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.declineConferenceCallInvite", parameters: [("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func deleteConferenceCallParticipants(flags: Int32, call: Api.InputGroupCall, ids: [Int64], block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1935276763) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ids.count)) - for item in ids { - serializeInt64(item, buffer: buffer, boxed: false) - } - serializeBytes(block, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.deleteConferenceCallParticipants", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("ids", String(describing: ids)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteConferenceCallParticipants(flags: Int32, call: Api.InputGroupCall, ids: [Int64], block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1935276763) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(ids.count)) + for item in ids { + serializeInt64(item, buffer: buffer, boxed: false) + } + serializeBytes(block, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.deleteConferenceCallParticipants", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("ids", String(describing: ids)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func deleteGroupCallMessages(flags: Int32, call: Api.InputGroupCall, messages: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-162573065) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(messages.count)) - for item in messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "phone.deleteGroupCallMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("messages", String(describing: messages))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteGroupCallMessages(flags: Int32, call: Api.InputGroupCall, messages: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-162573065) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(messages.count)) + for item in messages { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "phone.deleteGroupCallMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("messages", String(describing: messages))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func deleteGroupCallParticipantMessages(flags: Int32, call: Api.InputGroupCall, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(499117216) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - participant.serialize(buffer, true) - return (FunctionDescription(name: "phone.deleteGroupCallParticipantMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func deleteGroupCallParticipantMessages(flags: Int32, call: Api.InputGroupCall, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(499117216) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + participant.serialize(buffer, true) + return (FunctionDescription(name: "phone.deleteGroupCallParticipantMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func discardCall(flags: Int32, peer: Api.InputPhoneCall, duration: Int32, reason: Api.PhoneCallDiscardReason, connectionId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1295269440) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(duration, buffer: buffer, boxed: false) - reason.serialize(buffer, true) - serializeInt64(connectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.discardCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("duration", String(describing: duration)), ("reason", String(describing: reason)), ("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func discardCall(flags: Int32, peer: Api.InputPhoneCall, duration: Int32, reason: Api.PhoneCallDiscardReason, connectionId: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1295269440) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(duration, buffer: buffer, boxed: false) + reason.serialize(buffer, true) + serializeInt64(connectionId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.discardCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("duration", String(describing: duration)), ("reason", String(describing: reason)), ("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func discardGroupCall(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2054648117) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.discardGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func discardGroupCall(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2054648117) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.discardGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func editGroupCallParticipant(flags: Int32, call: Api.InputGroupCall, participant: Api.InputPeer, muted: Api.Bool?, volume: Int32?, raiseHand: Api.Bool?, videoStopped: Api.Bool?, videoPaused: Api.Bool?, presentationPaused: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1524155713) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - participant.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {muted!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(volume!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {raiseHand!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {videoStopped!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {videoPaused!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {presentationPaused!.serialize(buffer, true)} - return (FunctionDescription(name: "phone.editGroupCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant)), ("muted", String(describing: muted)), ("volume", String(describing: volume)), ("raiseHand", String(describing: raiseHand)), ("videoStopped", String(describing: videoStopped)), ("videoPaused", String(describing: videoPaused)), ("presentationPaused", String(describing: presentationPaused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editGroupCallParticipant(flags: Int32, call: Api.InputGroupCall, participant: Api.InputPeer, muted: Api.Bool?, volume: Int32?, raiseHand: Api.Bool?, videoStopped: Api.Bool?, videoPaused: Api.Bool?, presentationPaused: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1524155713) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + participant.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + muted!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(volume!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + raiseHand!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + videoStopped!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 4) != 0 { + videoPaused!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 5) != 0 { + presentationPaused!.serialize(buffer, true) + } + return (FunctionDescription(name: "phone.editGroupCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant)), ("muted", String(describing: muted)), ("volume", String(describing: volume)), ("raiseHand", String(describing: raiseHand)), ("videoStopped", String(describing: videoStopped)), ("videoPaused", String(describing: videoPaused)), ("presentationPaused", String(describing: presentationPaused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func editGroupCallTitle(call: Api.InputGroupCall, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(480685066) - call.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.editGroupCallTitle", parameters: [("call", String(describing: call)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editGroupCallTitle(call: Api.InputGroupCall, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(480685066) + call.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.editGroupCallTitle", parameters: [("call", String(describing: call)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func exportGroupCallInvite(flags: Int32, call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-425040769) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.exportGroupCallInvite", parameters: [("flags", String(describing: flags)), ("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.ExportedGroupCallInvite? in - let reader = BufferReader(buffer) - var result: Api.phone.ExportedGroupCallInvite? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.ExportedGroupCallInvite - } - return result - }) - } + static func exportGroupCallInvite(flags: Int32, call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-425040769) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.exportGroupCallInvite", parameters: [("flags", String(describing: flags)), ("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.ExportedGroupCallInvite? in + let reader = BufferReader(buffer) + var result: Api.phone.ExportedGroupCallInvite? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.ExportedGroupCallInvite + } + return result + }) + } } public extension Api.functions.phone { - static func getCallConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1430593449) - - return (FunctionDescription(name: "phone.getCallConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in - let reader = BufferReader(buffer) - var result: Api.DataJSON? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.DataJSON - } - return result - }) - } + static func getCallConfig() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1430593449) + return (FunctionDescription(name: "phone.getCallConfig", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in + let reader = BufferReader(buffer) + var result: Api.DataJSON? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.DataJSON + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCall(call: Api.InputGroupCall, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(68699611) - call.serialize(buffer, true) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupCall", parameters: [("call", String(describing: call)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCall? in - let reader = BufferReader(buffer) - var result: Api.phone.GroupCall? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.GroupCall - } - return result - }) - } + static func getGroupCall(call: Api.InputGroupCall, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(68699611) + call.serialize(buffer, true) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.getGroupCall", parameters: [("call", String(describing: call)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCall? in + let reader = BufferReader(buffer) + var result: Api.phone.GroupCall? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.GroupCall + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCallChainBlocks(call: Api.InputGroupCall, subChainId: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-291534682) - call.serialize(buffer, true) - serializeInt32(subChainId, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupCallChainBlocks", parameters: [("call", String(describing: call)), ("subChainId", String(describing: subChainId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func getGroupCallChainBlocks(call: Api.InputGroupCall, subChainId: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-291534682) + call.serialize(buffer, true) + serializeInt32(subChainId, buffer: buffer, boxed: false) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.getGroupCallChainBlocks", parameters: [("call", String(describing: call)), ("subChainId", String(describing: subChainId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCallJoinAs(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-277077702) - peer.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallJoinAs", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.JoinAsPeers? in - let reader = BufferReader(buffer) - var result: Api.phone.JoinAsPeers? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.JoinAsPeers - } - return result - }) - } + static func getGroupCallJoinAs(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-277077702) + peer.serialize(buffer, true) + return (FunctionDescription(name: "phone.getGroupCallJoinAs", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.JoinAsPeers? in + let reader = BufferReader(buffer) + var result: Api.phone.JoinAsPeers? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.JoinAsPeers + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCallStars(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1868784386) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStars", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStars? in - let reader = BufferReader(buffer) - var result: Api.phone.GroupCallStars? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStars - } - return result - }) - } + static func getGroupCallStars(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1868784386) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.getGroupCallStars", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStars? in + let reader = BufferReader(buffer) + var result: Api.phone.GroupCallStars? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStars + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCallStreamChannels(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(447879488) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStreamChannels", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamChannels? in - let reader = BufferReader(buffer) - var result: Api.phone.GroupCallStreamChannels? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStreamChannels - } - return result - }) - } + static func getGroupCallStreamChannels(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(447879488) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.getGroupCallStreamChannels", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamChannels? in + let reader = BufferReader(buffer) + var result: Api.phone.GroupCallStreamChannels? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStreamChannels + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupCallStreamRtmpUrl(flags: Int32, peer: Api.InputPeer, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1525991226) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - revoke.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStreamRtmpUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("revoke", String(describing: revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamRtmpUrl? in - let reader = BufferReader(buffer) - var result: Api.phone.GroupCallStreamRtmpUrl? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStreamRtmpUrl - } - return result - }) - } + static func getGroupCallStreamRtmpUrl(flags: Int32, peer: Api.InputPeer, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1525991226) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + revoke.serialize(buffer, true) + return (FunctionDescription(name: "phone.getGroupCallStreamRtmpUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("revoke", String(describing: revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamRtmpUrl? in + let reader = BufferReader(buffer) + var result: Api.phone.GroupCallStreamRtmpUrl? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.GroupCallStreamRtmpUrl + } + return result + }) + } } public extension Api.functions.phone { - static func getGroupParticipants(call: Api.InputGroupCall, ids: [Api.InputPeer], sources: [Int32], offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-984033109) - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(ids.count)) - for item in ids { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sources.count)) - for item in sources { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupParticipants", parameters: [("call", String(describing: call)), ("ids", String(describing: ids)), ("sources", String(describing: sources)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupParticipants? in - let reader = BufferReader(buffer) - var result: Api.phone.GroupParticipants? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.GroupParticipants - } - return result - }) - } + static func getGroupParticipants(call: Api.InputGroupCall, ids: [Api.InputPeer], sources: [Int32], offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-984033109) + call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(ids.count)) + for item in ids { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(sources.count)) + for item in sources { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.getGroupParticipants", parameters: [("call", String(describing: call)), ("ids", String(describing: ids)), ("sources", String(describing: sources)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupParticipants? in + let reader = BufferReader(buffer) + var result: Api.phone.GroupParticipants? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.GroupParticipants + } + return result + }) + } } public extension Api.functions.phone { - static func inviteConferenceCallParticipant(flags: Int32, call: Api.InputGroupCall, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1124981115) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - userId.serialize(buffer, true) - return (FunctionDescription(name: "phone.inviteConferenceCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func inviteConferenceCallParticipant(flags: Int32, call: Api.InputGroupCall, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1124981115) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + userId.serialize(buffer, true) + return (FunctionDescription(name: "phone.inviteConferenceCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func inviteToGroupCall(call: Api.InputGroupCall, users: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2067345760) - call.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users.count)) - for item in users { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "phone.inviteToGroupCall", parameters: [("call", String(describing: call)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func inviteToGroupCall(call: Api.InputGroupCall, users: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2067345760) + call.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(users.count)) + for item in users { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "phone.inviteToGroupCall", parameters: [("call", String(describing: call)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func joinGroupCall(flags: Int32, call: Api.InputGroupCall, joinAs: Api.InputPeer, inviteHash: String?, publicKey: Int256?, block: Buffer?, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1883951017) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - joinAs.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(inviteHash!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt256(publicKey!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeBytes(block!, buffer: buffer, boxed: false)} - params.serialize(buffer, true) - return (FunctionDescription(name: "phone.joinGroupCall", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinAs", String(describing: joinAs)), ("inviteHash", String(describing: inviteHash)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func joinGroupCall(flags: Int32, call: Api.InputGroupCall, joinAs: Api.InputPeer, inviteHash: String?, publicKey: Int256?, block: Buffer?, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1883951017) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + joinAs.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(inviteHash!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeInt256(publicKey!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeBytes(block!, buffer: buffer, boxed: false) + } + params.serialize(buffer, true) + return (FunctionDescription(name: "phone.joinGroupCall", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinAs", String(describing: joinAs)), ("inviteHash", String(describing: inviteHash)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func joinGroupCallPresentation(call: Api.InputGroupCall, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-873829436) - call.serialize(buffer, true) - params.serialize(buffer, true) - return (FunctionDescription(name: "phone.joinGroupCallPresentation", parameters: [("call", String(describing: call)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func joinGroupCallPresentation(call: Api.InputGroupCall, params: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-873829436) + call.serialize(buffer, true) + params.serialize(buffer, true) + return (FunctionDescription(name: "phone.joinGroupCallPresentation", parameters: [("call", String(describing: call)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func leaveGroupCall(call: Api.InputGroupCall, source: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1342404601) - call.serialize(buffer, true) - serializeInt32(source, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.leaveGroupCall", parameters: [("call", String(describing: call)), ("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func leaveGroupCall(call: Api.InputGroupCall, source: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1342404601) + call.serialize(buffer, true) + serializeInt32(source, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.leaveGroupCall", parameters: [("call", String(describing: call)), ("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func leaveGroupCallPresentation(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(475058500) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.leaveGroupCallPresentation", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func leaveGroupCallPresentation(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(475058500) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.leaveGroupCallPresentation", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func receivedCall(peer: Api.InputPhoneCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(399855457) - peer.serialize(buffer, true) - return (FunctionDescription(name: "phone.receivedCall", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func receivedCall(peer: Api.InputPhoneCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(399855457) + peer.serialize(buffer, true) + return (FunctionDescription(name: "phone.receivedCall", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func requestCall(flags: Int32, userId: Api.InputUser, randomId: Int32, gAHash: Buffer, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1124046573) - serializeInt32(flags, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeInt32(randomId, buffer: buffer, boxed: false) - serializeBytes(gAHash, buffer: buffer, boxed: false) - `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.requestCall", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gAHash", String(describing: gAHash)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in - let reader = BufferReader(buffer) - var result: Api.phone.PhoneCall? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall - } - return result - }) - } + static func requestCall(flags: Int32, userId: Api.InputUser, randomId: Int32, gAHash: Buffer, `protocol`: Api.PhoneCallProtocol) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1124046573) + serializeInt32(flags, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + serializeInt32(randomId, buffer: buffer, boxed: false) + serializeBytes(gAHash, buffer: buffer, boxed: false) + `protocol`.serialize(buffer, true) + return (FunctionDescription(name: "phone.requestCall", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gAHash", String(describing: gAHash)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + let reader = BufferReader(buffer) + var result: Api.phone.PhoneCall? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.phone.PhoneCall + } + return result + }) + } } public extension Api.functions.phone { - static func saveCallDebug(peer: Api.InputPhoneCall, debug: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(662363518) - peer.serialize(buffer, true) - debug.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveCallDebug", parameters: [("peer", String(describing: peer)), ("debug", String(describing: debug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveCallDebug(peer: Api.InputPhoneCall, debug: Api.DataJSON) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(662363518) + peer.serialize(buffer, true) + debug.serialize(buffer, true) + return (FunctionDescription(name: "phone.saveCallDebug", parameters: [("peer", String(describing: peer)), ("debug", String(describing: debug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func saveCallLog(peer: Api.InputPhoneCall, file: Api.InputFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1092913030) - peer.serialize(buffer, true) - file.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveCallLog", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveCallLog(peer: Api.InputPhoneCall, file: Api.InputFile) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1092913030) + peer.serialize(buffer, true) + file.serialize(buffer, true) + return (FunctionDescription(name: "phone.saveCallLog", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func saveDefaultGroupCallJoinAs(peer: Api.InputPeer, joinAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1465786252) - peer.serialize(buffer, true) - joinAs.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveDefaultGroupCallJoinAs", parameters: [("peer", String(describing: peer)), ("joinAs", String(describing: joinAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveDefaultGroupCallJoinAs(peer: Api.InputPeer, joinAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1465786252) + peer.serialize(buffer, true) + joinAs.serialize(buffer, true) + return (FunctionDescription(name: "phone.saveDefaultGroupCallJoinAs", parameters: [("peer", String(describing: peer)), ("joinAs", String(describing: joinAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func saveDefaultSendAs(call: Api.InputGroupCall, sendAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1097313745) - call.serialize(buffer, true) - sendAs.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveDefaultSendAs", parameters: [("call", String(describing: call)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveDefaultSendAs(call: Api.InputGroupCall, sendAs: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1097313745) + call.serialize(buffer, true) + sendAs.serialize(buffer, true) + return (FunctionDescription(name: "phone.saveDefaultSendAs", parameters: [("call", String(describing: call)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func sendConferenceCallBroadcast(call: Api.InputGroupCall, block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-965732096) - call.serialize(buffer, true) - serializeBytes(block, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendConferenceCallBroadcast", parameters: [("call", String(describing: call)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func sendConferenceCallBroadcast(call: Api.InputGroupCall, block: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-965732096) + call.serialize(buffer, true) + serializeBytes(block, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.sendConferenceCallBroadcast", parameters: [("call", String(describing: call)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func sendGroupCallEncryptedMessage(call: Api.InputGroupCall, encryptedMessage: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-441473683) - call.serialize(buffer, true) - serializeBytes(encryptedMessage, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendGroupCallEncryptedMessage", parameters: [("call", String(describing: call)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func sendGroupCallEncryptedMessage(call: Api.InputGroupCall, encryptedMessage: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-441473683) + call.serialize(buffer, true) + serializeBytes(encryptedMessage, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.sendGroupCallEncryptedMessage", parameters: [("call", String(describing: call)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func sendGroupCallMessage(flags: Int32, call: Api.InputGroupCall, randomId: Int64, message: Api.TextWithEntities, allowPaidStars: Int64?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1311697904) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - serializeInt64(randomId, buffer: buffer, boxed: false) - message.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(allowPaidStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {sendAs!.serialize(buffer, true)} - return (FunctionDescription(name: "phone.sendGroupCallMessage", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("randomId", String(describing: randomId)), ("message", String(describing: message)), ("allowPaidStars", String(describing: allowPaidStars)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func sendGroupCallMessage(flags: Int32, call: Api.InputGroupCall, randomId: Int64, message: Api.TextWithEntities, allowPaidStars: Int64?, sendAs: Api.InputPeer?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1311697904) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + serializeInt64(randomId, buffer: buffer, boxed: false) + message.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + sendAs!.serialize(buffer, true) + } + return (FunctionDescription(name: "phone.sendGroupCallMessage", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("randomId", String(describing: randomId)), ("message", String(describing: message)), ("allowPaidStars", String(describing: allowPaidStars)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func sendSignalingData(peer: Api.InputPhoneCall, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-8744061) - peer.serialize(buffer, true) - serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendSignalingData", parameters: [("peer", String(describing: peer)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func sendSignalingData(peer: Api.InputPhoneCall, data: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-8744061) + peer.serialize(buffer, true) + serializeBytes(data, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.sendSignalingData", parameters: [("peer", String(describing: peer)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.phone { - static func setCallRating(flags: Int32, peer: Api.InputPhoneCall, rating: Int32, comment: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1508562471) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(rating, buffer: buffer, boxed: false) - serializeString(comment, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.setCallRating", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("rating", String(describing: rating)), ("comment", String(describing: comment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func setCallRating(flags: Int32, peer: Api.InputPhoneCall, rating: Int32, comment: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1508562471) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(rating, buffer: buffer, boxed: false) + serializeString(comment, buffer: buffer, boxed: false) + return (FunctionDescription(name: "phone.setCallRating", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("rating", String(describing: rating)), ("comment", String(describing: comment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func startScheduledGroupCall(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1451287362) - call.serialize(buffer, true) - return (FunctionDescription(name: "phone.startScheduledGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func startScheduledGroupCall(call: Api.InputGroupCall) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1451287362) + call.serialize(buffer, true) + return (FunctionDescription(name: "phone.startScheduledGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func toggleGroupCallRecord(flags: Int32, call: Api.InputGroupCall, title: String?, videoPortrait: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-248985848) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {videoPortrait!.serialize(buffer, true)} - return (FunctionDescription(name: "phone.toggleGroupCallRecord", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("title", String(describing: title)), ("videoPortrait", String(describing: videoPortrait))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleGroupCallRecord(flags: Int32, call: Api.InputGroupCall, title: String?, videoPortrait: Api.Bool?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-248985848) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + videoPortrait!.serialize(buffer, true) + } + return (FunctionDescription(name: "phone.toggleGroupCallRecord", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("title", String(describing: title)), ("videoPortrait", String(describing: videoPortrait))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func toggleGroupCallSettings(flags: Int32, call: Api.InputGroupCall, joinMuted: Api.Bool?, messagesEnabled: Api.Bool?, sendPaidMessagesStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1757179150) - serializeInt32(flags, buffer: buffer, boxed: false) - call.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {joinMuted!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {messagesEnabled!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "phone.toggleGroupCallSettings", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinMuted", String(describing: joinMuted)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleGroupCallSettings(flags: Int32, call: Api.InputGroupCall, joinMuted: Api.Bool?, messagesEnabled: Api.Bool?, sendPaidMessagesStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1757179150) + serializeInt32(flags, buffer: buffer, boxed: false) + call.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + joinMuted!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + messagesEnabled!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "phone.toggleGroupCallSettings", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinMuted", String(describing: joinMuted)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.phone { - static func toggleGroupCallStartSubscription(call: Api.InputGroupCall, subscribed: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(563885286) - call.serialize(buffer, true) - subscribed.serialize(buffer, true) - return (FunctionDescription(name: "phone.toggleGroupCallStartSubscription", parameters: [("call", String(describing: call)), ("subscribed", String(describing: subscribed))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func toggleGroupCallStartSubscription(call: Api.InputGroupCall, subscribed: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(563885286) + call.serialize(buffer, true) + subscribed.serialize(buffer, true) + return (FunctionDescription(name: "phone.toggleGroupCallStartSubscription", parameters: [("call", String(describing: call)), ("subscribed", String(describing: subscribed))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.photos { - static func deletePhotos(id: [Api.InputPhoto]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int64]>) { - let buffer = Buffer() - buffer.appendInt32(-2016444625) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "photos.deletePhotos", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in - let reader = BufferReader(buffer) - var result: [Int64]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - return result - }) - } + static func deletePhotos(id: [Api.InputPhoto]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int64]>) { + let buffer = Buffer() + buffer.appendInt32(-2016444625) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "photos.deletePhotos", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in + let reader = BufferReader(buffer) + var result: [Int64]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + return result + }) + } } public extension Api.functions.photos { - static func getUserPhotos(userId: Api.InputUser, offset: Int32, maxId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1848823128) - userId.serialize(buffer, true) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt64(maxId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "photos.getUserPhotos", parameters: [("userId", String(describing: userId)), ("offset", String(describing: offset)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photos? in - let reader = BufferReader(buffer) - var result: Api.photos.Photos? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.photos.Photos - } - return result - }) - } + static func getUserPhotos(userId: Api.InputUser, offset: Int32, maxId: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1848823128) + userId.serialize(buffer, true) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt64(maxId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "photos.getUserPhotos", parameters: [("userId", String(describing: userId)), ("offset", String(describing: offset)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photos? in + let reader = BufferReader(buffer) + var result: Api.photos.Photos? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.photos.Photos + } + return result + }) + } } public extension Api.functions.photos { - static func updateProfilePhoto(flags: Int32, bot: Api.InputUser?, id: Api.InputPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(166207545) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {bot!.serialize(buffer, true)} - id.serialize(buffer, true) - return (FunctionDescription(name: "photos.updateProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in - let reader = BufferReader(buffer) - var result: Api.photos.Photo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.photos.Photo - } - return result - }) - } + static func updateProfilePhoto(flags: Int32, bot: Api.InputUser?, id: Api.InputPhoto) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(166207545) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + bot!.serialize(buffer, true) + } + id.serialize(buffer, true) + return (FunctionDescription(name: "photos.updateProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + let reader = BufferReader(buffer) + var result: Api.photos.Photo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.photos.Photo + } + return result + }) + } } public extension Api.functions.photos { - static func uploadContactProfilePhoto(flags: Int32, userId: Api.InputUser, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-515093903) - serializeInt32(flags, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {file!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {video!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {videoEmojiMarkup!.serialize(buffer, true)} - return (FunctionDescription(name: "photos.uploadContactProfilePhoto", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in - let reader = BufferReader(buffer) - var result: Api.photos.Photo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.photos.Photo - } - return result - }) - } + static func uploadContactProfilePhoto(flags: Int32, userId: Api.InputUser, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-515093903) + serializeInt32(flags, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + file!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + video!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeDouble(videoStartTs!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 5) != 0 { + videoEmojiMarkup!.serialize(buffer, true) + } + return (FunctionDescription(name: "photos.uploadContactProfilePhoto", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + let reader = BufferReader(buffer) + var result: Api.photos.Photo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.photos.Photo + } + return result + }) + } } public extension Api.functions.photos { - static func uploadProfilePhoto(flags: Int32, bot: Api.InputUser?, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(59286453) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {bot!.serialize(buffer, true)} - if Int(flags) & Int(1 << 0) != 0 {file!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {video!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {videoEmojiMarkup!.serialize(buffer, true)} - return (FunctionDescription(name: "photos.uploadProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in - let reader = BufferReader(buffer) - var result: Api.photos.Photo? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.photos.Photo - } - return result - }) - } + static func uploadProfilePhoto(flags: Int32, bot: Api.InputUser?, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(59286453) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 5) != 0 { + bot!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 0) != 0 { + file!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + video!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeDouble(videoStartTs!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 4) != 0 { + videoEmojiMarkup!.serialize(buffer, true) + } + return (FunctionDescription(name: "photos.uploadProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + let reader = BufferReader(buffer) + var result: Api.photos.Photo? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.photos.Photo + } + return result + }) + } } public extension Api.functions.premium { - static func applyBoost(flags: Int32, slots: [Int32]?, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1803396934) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(slots!.count)) - for item in slots! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - peer.serialize(buffer, true) - return (FunctionDescription(name: "premium.applyBoost", parameters: [("flags", String(describing: flags)), ("slots", String(describing: slots)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.MyBoosts? in - let reader = BufferReader(buffer) - var result: Api.premium.MyBoosts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.premium.MyBoosts - } - return result - }) - } + static func applyBoost(flags: Int32, slots: [Int32]?, peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1803396934) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(slots!.count)) + for item in slots! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + peer.serialize(buffer, true) + return (FunctionDescription(name: "premium.applyBoost", parameters: [("flags", String(describing: flags)), ("slots", String(describing: slots)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.MyBoosts? in + let reader = BufferReader(buffer) + var result: Api.premium.MyBoosts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.premium.MyBoosts + } + return result + }) + } } public extension Api.functions.premium { - static func getBoostsList(flags: Int32, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1626764896) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "premium.getBoostsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in - let reader = BufferReader(buffer) - var result: Api.premium.BoostsList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.premium.BoostsList - } - return result - }) - } + static func getBoostsList(flags: Int32, peer: Api.InputPeer, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1626764896) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "premium.getBoostsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in + let reader = BufferReader(buffer) + var result: Api.premium.BoostsList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.premium.BoostsList + } + return result + }) + } } public extension Api.functions.premium { - static func getBoostsStatus(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(70197089) - peer.serialize(buffer, true) - return (FunctionDescription(name: "premium.getBoostsStatus", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsStatus? in - let reader = BufferReader(buffer) - var result: Api.premium.BoostsStatus? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.premium.BoostsStatus - } - return result - }) - } + static func getBoostsStatus(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(70197089) + peer.serialize(buffer, true) + return (FunctionDescription(name: "premium.getBoostsStatus", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsStatus? in + let reader = BufferReader(buffer) + var result: Api.premium.BoostsStatus? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.premium.BoostsStatus + } + return result + }) + } } public extension Api.functions.premium { - static func getMyBoosts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(199719754) - - return (FunctionDescription(name: "premium.getMyBoosts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.MyBoosts? in - let reader = BufferReader(buffer) - var result: Api.premium.MyBoosts? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.premium.MyBoosts - } - return result - }) - } + static func getMyBoosts() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(199719754) + return (FunctionDescription(name: "premium.getMyBoosts", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.MyBoosts? in + let reader = BufferReader(buffer) + var result: Api.premium.MyBoosts? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.premium.MyBoosts + } + return result + }) + } } public extension Api.functions.premium { - static func getUserBoosts(peer: Api.InputPeer, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(965037343) - peer.serialize(buffer, true) - userId.serialize(buffer, true) - return (FunctionDescription(name: "premium.getUserBoosts", parameters: [("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in - let reader = BufferReader(buffer) - var result: Api.premium.BoostsList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.premium.BoostsList - } - return result - }) - } + static func getUserBoosts(peer: Api.InputPeer, userId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(965037343) + peer.serialize(buffer, true) + userId.serialize(buffer, true) + return (FunctionDescription(name: "premium.getUserBoosts", parameters: [("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in + let reader = BufferReader(buffer) + var result: Api.premium.BoostsList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.premium.BoostsList + } + return result + }) + } } public extension Api.functions.smsjobs { - static func finishJob(flags: Int32, jobId: String, error: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1327415076) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(jobId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(error!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "smsjobs.finishJob", parameters: [("flags", String(describing: flags)), ("jobId", String(describing: jobId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func finishJob(flags: Int32, jobId: String, error: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1327415076) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(jobId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(error!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "smsjobs.finishJob", parameters: [("flags", String(describing: flags)), ("jobId", String(describing: jobId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.smsjobs { - static func getSmsJob(jobId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2005766191) - serializeString(jobId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "smsjobs.getSmsJob", parameters: [("jobId", String(describing: jobId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SmsJob? in - let reader = BufferReader(buffer) - var result: Api.SmsJob? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.SmsJob - } - return result - }) - } + static func getSmsJob(jobId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2005766191) + serializeString(jobId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "smsjobs.getSmsJob", parameters: [("jobId", String(describing: jobId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SmsJob? in + let reader = BufferReader(buffer) + var result: Api.SmsJob? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.SmsJob + } + return result + }) + } } public extension Api.functions.smsjobs { - static func getStatus() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(279353576) - - return (FunctionDescription(name: "smsjobs.getStatus", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.smsjobs.Status? in - let reader = BufferReader(buffer) - var result: Api.smsjobs.Status? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.smsjobs.Status - } - return result - }) - } + static func getStatus() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(279353576) + return (FunctionDescription(name: "smsjobs.getStatus", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.smsjobs.Status? in + let reader = BufferReader(buffer) + var result: Api.smsjobs.Status? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.smsjobs.Status + } + return result + }) + } } public extension Api.functions.smsjobs { - static func isEligibleToJoin() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(249313744) - - return (FunctionDescription(name: "smsjobs.isEligibleToJoin", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.smsjobs.EligibilityToJoin? in - let reader = BufferReader(buffer) - var result: Api.smsjobs.EligibilityToJoin? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.smsjobs.EligibilityToJoin - } - return result - }) - } + static func isEligibleToJoin() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(249313744) + return (FunctionDescription(name: "smsjobs.isEligibleToJoin", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.smsjobs.EligibilityToJoin? in + let reader = BufferReader(buffer) + var result: Api.smsjobs.EligibilityToJoin? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.smsjobs.EligibilityToJoin + } + return result + }) + } } public extension Api.functions.smsjobs { - static func join() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1488007635) - - return (FunctionDescription(name: "smsjobs.join", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func join() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1488007635) + return (FunctionDescription(name: "smsjobs.join", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.smsjobs { - static func leave() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1734824589) - - return (FunctionDescription(name: "smsjobs.leave", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func leave() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1734824589) + return (FunctionDescription(name: "smsjobs.leave", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.smsjobs { - static func updateSettings(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(155164863) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "smsjobs.updateSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func updateSettings(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(155164863) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "smsjobs.updateSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stats { - static func getBroadcastStats(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1421720550) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - return (FunctionDescription(name: "stats.getBroadcastStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.BroadcastStats? in - let reader = BufferReader(buffer) - var result: Api.stats.BroadcastStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.BroadcastStats - } - return result - }) - } + static func getBroadcastStats(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1421720550) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + return (FunctionDescription(name: "stats.getBroadcastStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.BroadcastStats? in + let reader = BufferReader(buffer) + var result: Api.stats.BroadcastStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.BroadcastStats + } + return result + }) + } } public extension Api.functions.stats { - static func getMegagroupStats(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-589330937) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - return (FunctionDescription(name: "stats.getMegagroupStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MegagroupStats? in - let reader = BufferReader(buffer) - var result: Api.stats.MegagroupStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.MegagroupStats - } - return result - }) - } + static func getMegagroupStats(flags: Int32, channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-589330937) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + return (FunctionDescription(name: "stats.getMegagroupStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MegagroupStats? in + let reader = BufferReader(buffer) + var result: Api.stats.MegagroupStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.MegagroupStats + } + return result + }) + } } public extension Api.functions.stats { - static func getMessagePublicForwards(channel: Api.InputChannel, msgId: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1595212100) - channel.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getMessagePublicForwards", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in - let reader = BufferReader(buffer) - var result: Api.stats.PublicForwards? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.PublicForwards - } - return result - }) - } + static func getMessagePublicForwards(channel: Api.InputChannel, msgId: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1595212100) + channel.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stats.getMessagePublicForwards", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in + let reader = BufferReader(buffer) + var result: Api.stats.PublicForwards? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.PublicForwards + } + return result + }) + } } public extension Api.functions.stats { - static func getMessageStats(flags: Int32, channel: Api.InputChannel, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1226791947) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getMessageStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MessageStats? in - let reader = BufferReader(buffer) - var result: Api.stats.MessageStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.MessageStats - } - return result - }) - } + static func getMessageStats(flags: Int32, channel: Api.InputChannel, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1226791947) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stats.getMessageStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MessageStats? in + let reader = BufferReader(buffer) + var result: Api.stats.MessageStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.MessageStats + } + return result + }) + } } public extension Api.functions.stats { - static func getStoryPublicForwards(peer: Api.InputPeer, id: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1505526026) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getStoryPublicForwards", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in - let reader = BufferReader(buffer) - var result: Api.stats.PublicForwards? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.PublicForwards - } - return result - }) - } + static func getStoryPublicForwards(peer: Api.InputPeer, id: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1505526026) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stats.getStoryPublicForwards", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in + let reader = BufferReader(buffer) + var result: Api.stats.PublicForwards? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.PublicForwards + } + return result + }) + } } public extension Api.functions.stats { - static func getStoryStats(flags: Int32, peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(927985472) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getStoryStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.StoryStats? in - let reader = BufferReader(buffer) - var result: Api.stats.StoryStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.StoryStats - } - return result - }) - } + static func getStoryStats(flags: Int32, peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(927985472) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stats.getStoryStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.StoryStats? in + let reader = BufferReader(buffer) + var result: Api.stats.StoryStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.StoryStats + } + return result + }) + } } public extension Api.functions.stats { - static func loadAsyncGraph(flags: Int32, token: String, x: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1646092192) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(token, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(x!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stats.loadAsyncGraph", parameters: [("flags", String(describing: flags)), ("token", String(describing: token)), ("x", String(describing: x))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StatsGraph? in - let reader = BufferReader(buffer) - var result: Api.StatsGraph? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - return result - }) - } + static func loadAsyncGraph(flags: Int32, token: String, x: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1646092192) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(token, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt64(x!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stats.loadAsyncGraph", parameters: [("flags", String(describing: flags)), ("token", String(describing: token)), ("x", String(describing: x))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StatsGraph? in + let reader = BufferReader(buffer) + var result: Api.StatsGraph? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + return result + }) + } } public extension Api.functions.stickers { - static func addStickerToSet(stickerset: Api.InputStickerSet, sticker: Api.InputStickerSetItem) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2041315650) - stickerset.serialize(buffer, true) - sticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.addStickerToSet", parameters: [("stickerset", String(describing: stickerset)), ("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func addStickerToSet(stickerset: Api.InputStickerSet, sticker: Api.InputStickerSetItem) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2041315650) + stickerset.serialize(buffer, true) + sticker.serialize(buffer, true) + return (FunctionDescription(name: "stickers.addStickerToSet", parameters: [("stickerset", String(describing: stickerset)), ("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func changeSticker(flags: Int32, sticker: Api.InputDocument, emoji: String?, maskCoords: Api.MaskCoords?, keywords: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-179077444) - serializeInt32(flags, buffer: buffer, boxed: false) - sticker.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(emoji!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {maskCoords!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(keywords!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stickers.changeSticker", parameters: [("flags", String(describing: flags)), ("sticker", String(describing: sticker)), ("emoji", String(describing: emoji)), ("maskCoords", String(describing: maskCoords)), ("keywords", String(describing: keywords))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func changeSticker(flags: Int32, sticker: Api.InputDocument, emoji: String?, maskCoords: Api.MaskCoords?, keywords: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-179077444) + serializeInt32(flags, buffer: buffer, boxed: false) + sticker.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(emoji!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + maskCoords!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(keywords!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stickers.changeSticker", parameters: [("flags", String(describing: flags)), ("sticker", String(describing: sticker)), ("emoji", String(describing: emoji)), ("maskCoords", String(describing: maskCoords)), ("keywords", String(describing: keywords))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func changeStickerPosition(sticker: Api.InputDocument, position: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-4795190) - sticker.serialize(buffer, true) - serializeInt32(position, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.changeStickerPosition", parameters: [("sticker", String(describing: sticker)), ("position", String(describing: position))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func changeStickerPosition(sticker: Api.InputDocument, position: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-4795190) + sticker.serialize(buffer, true) + serializeInt32(position, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stickers.changeStickerPosition", parameters: [("sticker", String(describing: sticker)), ("position", String(describing: position))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func checkShortName(shortName: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(676017721) - serializeString(shortName, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.checkShortName", parameters: [("shortName", String(describing: shortName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func checkShortName(shortName: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(676017721) + serializeString(shortName, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stickers.checkShortName", parameters: [("shortName", String(describing: shortName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stickers { - static func createStickerSet(flags: Int32, userId: Api.InputUser, title: String, shortName: String, thumb: Api.InputDocument?, stickers: [Api.InputStickerSetItem], software: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1876841625) - serializeInt32(flags, buffer: buffer, boxed: false) - userId.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {thumb!.serialize(buffer, true)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stickers.count)) - for item in stickers { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 3) != 0 {serializeString(software!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stickers.createStickerSet", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("title", String(describing: title)), ("shortName", String(describing: shortName)), ("thumb", String(describing: thumb)), ("stickers", String(describing: stickers)), ("software", String(describing: software))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func createStickerSet(flags: Int32, userId: Api.InputUser, title: String, shortName: String, thumb: Api.InputDocument?, stickers: [Api.InputStickerSetItem], software: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1876841625) + serializeInt32(flags, buffer: buffer, boxed: false) + userId.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + serializeString(shortName, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + thumb!.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stickers.count)) + for item in stickers { + item.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeString(software!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stickers.createStickerSet", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("title", String(describing: title)), ("shortName", String(describing: shortName)), ("thumb", String(describing: thumb)), ("stickers", String(describing: stickers)), ("software", String(describing: software))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func deleteStickerSet(stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2022685804) - stickerset.serialize(buffer, true) - return (FunctionDescription(name: "stickers.deleteStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deleteStickerSet(stickerset: Api.InputStickerSet) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2022685804) + stickerset.serialize(buffer, true) + return (FunctionDescription(name: "stickers.deleteStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stickers { - static func removeStickerFromSet(sticker: Api.InputDocument) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-143257775) - sticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.removeStickerFromSet", parameters: [("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func removeStickerFromSet(sticker: Api.InputDocument) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-143257775) + sticker.serialize(buffer, true) + return (FunctionDescription(name: "stickers.removeStickerFromSet", parameters: [("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func renameStickerSet(stickerset: Api.InputStickerSet, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(306912256) - stickerset.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.renameStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func renameStickerSet(stickerset: Api.InputStickerSet, title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(306912256) + stickerset.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stickers.renameStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func replaceSticker(sticker: Api.InputDocument, newSticker: Api.InputStickerSetItem) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1184253338) - sticker.serialize(buffer, true) - newSticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.replaceSticker", parameters: [("sticker", String(describing: sticker)), ("newSticker", String(describing: newSticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func replaceSticker(sticker: Api.InputDocument, newSticker: Api.InputStickerSetItem) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1184253338) + sticker.serialize(buffer, true) + newSticker.serialize(buffer, true) + return (FunctionDescription(name: "stickers.replaceSticker", parameters: [("sticker", String(describing: sticker)), ("newSticker", String(describing: newSticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func setStickerSetThumb(flags: Int32, stickerset: Api.InputStickerSet, thumb: Api.InputDocument?, thumbDocumentId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1486204014) - serializeInt32(flags, buffer: buffer, boxed: false) - stickerset.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {thumb!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(thumbDocumentId!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stickers.setStickerSetThumb", parameters: [("flags", String(describing: flags)), ("stickerset", String(describing: stickerset)), ("thumb", String(describing: thumb)), ("thumbDocumentId", String(describing: thumbDocumentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in - let reader = BufferReader(buffer) - var result: Api.messages.StickerSet? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - return result - }) - } + static func setStickerSetThumb(flags: Int32, stickerset: Api.InputStickerSet, thumb: Api.InputDocument?, thumbDocumentId: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1486204014) + serializeInt32(flags, buffer: buffer, boxed: false) + stickerset.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + thumb!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt64(thumbDocumentId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stickers.setStickerSetThumb", parameters: [("flags", String(describing: flags)), ("stickerset", String(describing: stickerset)), ("thumb", String(describing: thumb)), ("thumbDocumentId", String(describing: thumbDocumentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + let reader = BufferReader(buffer) + var result: Api.messages.StickerSet? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + return result + }) + } } public extension Api.functions.stickers { - static func suggestShortName(title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1303364867) - serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.suggestShortName", parameters: [("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stickers.SuggestedShortName? in - let reader = BufferReader(buffer) - var result: Api.stickers.SuggestedShortName? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stickers.SuggestedShortName - } - return result - }) - } + static func suggestShortName(title: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1303364867) + serializeString(title, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stickers.suggestShortName", parameters: [("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stickers.SuggestedShortName? in + let reader = BufferReader(buffer) + var result: Api.stickers.SuggestedShortName? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stickers.SuggestedShortName + } + return result + }) + } } public extension Api.functions.stories { - static func activateStealthMode(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1471926630) - serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.activateStealthMode", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func activateStealthMode(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1471926630) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.activateStealthMode", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func canSendStory(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(820732912) - peer.serialize(buffer, true) - return (FunctionDescription(name: "stories.canSendStory", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.CanSendStoryCount? in - let reader = BufferReader(buffer) - var result: Api.stories.CanSendStoryCount? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.CanSendStoryCount - } - return result - }) - } + static func canSendStory(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(820732912) + peer.serialize(buffer, true) + return (FunctionDescription(name: "stories.canSendStory", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.CanSendStoryCount? in + let reader = BufferReader(buffer) + var result: Api.stories.CanSendStoryCount? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.CanSendStoryCount + } + return result + }) + } } public extension Api.functions.stories { - static func createAlbum(peer: Api.InputPeer, title: String, stories: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1553754395) - peer.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(stories.count)) - for item in stories { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.createAlbum", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stories", String(describing: stories))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in - let reader = BufferReader(buffer) - var result: Api.StoryAlbum? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StoryAlbum - } - return result - }) - } + static func createAlbum(peer: Api.InputPeer, title: String, stories: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1553754395) + peer.serialize(buffer, true) + serializeString(title, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(stories.count)) + for item in stories { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.createAlbum", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stories", String(describing: stories))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in + let reader = BufferReader(buffer) + var result: Api.StoryAlbum? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StoryAlbum + } + return result + }) + } } public extension Api.functions.stories { - static func deleteAlbum(peer: Api.InputPeer, albumId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1925949744) - peer.serialize(buffer, true) - serializeInt32(albumId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.deleteAlbum", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func deleteAlbum(peer: Api.InputPeer, albumId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1925949744) + peer.serialize(buffer, true) + serializeInt32(albumId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.deleteAlbum", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func deleteStories(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { - let buffer = Buffer() - buffer.appendInt32(-1369842849) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.deleteStories", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - return result - }) - } + static func deleteStories(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { + let buffer = Buffer() + buffer.appendInt32(-1369842849) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.deleteStories", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + let reader = BufferReader(buffer) + var result: [Int32]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + return result + }) + } } public extension Api.functions.stories { - static func editStory(flags: Int32, peer: Api.InputPeer, id: Int32, media: Api.InputMedia?, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1249658298) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {media!.serialize(buffer, true)} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(mediaAreas!.count)) - for item in mediaAreas! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeString(caption!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(privacyRules!.count)) - for item in privacyRules! { - item.serialize(buffer, true) - }} - return (FunctionDescription(name: "stories.editStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func editStory(flags: Int32, peer: Api.InputPeer, id: Int32, media: Api.InputMedia?, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1249658298) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + media!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(mediaAreas!.count)) + for item in mediaAreas! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(caption!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(privacyRules!.count)) + for item in privacyRules! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "stories.editStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func exportStoryLink(peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2072899360) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.exportStoryLink", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedStoryLink? in - let reader = BufferReader(buffer) - var result: Api.ExportedStoryLink? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ExportedStoryLink - } - return result - }) - } + static func exportStoryLink(peer: Api.InputPeer, id: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2072899360) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.exportStoryLink", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedStoryLink? in + let reader = BufferReader(buffer) + var result: Api.ExportedStoryLink? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ExportedStoryLink + } + return result + }) + } } public extension Api.functions.stories { - static func getAlbumStories(peer: Api.InputPeer, albumId: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1400869535) - peer.serialize(buffer, true) - serializeInt32(albumId, buffer: buffer, boxed: false) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getAlbumStories", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in - let reader = BufferReader(buffer) - var result: Api.stories.Stories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.Stories - } - return result - }) - } + static func getAlbumStories(peer: Api.InputPeer, albumId: Int32, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1400869535) + peer.serialize(buffer, true) + serializeInt32(albumId, buffer: buffer, boxed: false) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getAlbumStories", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + let reader = BufferReader(buffer) + var result: Api.stories.Stories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.Stories + } + return result + }) + } } public extension Api.functions.stories { - static func getAlbums(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(632548039) - peer.serialize(buffer, true) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getAlbums", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Albums? in - let reader = BufferReader(buffer) - var result: Api.stories.Albums? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.Albums - } - return result - }) - } + static func getAlbums(peer: Api.InputPeer, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(632548039) + peer.serialize(buffer, true) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getAlbums", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Albums? in + let reader = BufferReader(buffer) + var result: Api.stories.Albums? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.Albums + } + return result + }) + } } public extension Api.functions.stories { - static func getAllReadPeerStories() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1688541191) - - return (FunctionDescription(name: "stories.getAllReadPeerStories", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func getAllReadPeerStories() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1688541191) + return (FunctionDescription(name: "stories.getAllReadPeerStories", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func getAllStories(flags: Int32, state: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-290400731) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(state!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stories.getAllStories", parameters: [("flags", String(describing: flags)), ("state", String(describing: state))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.AllStories? in - let reader = BufferReader(buffer) - var result: Api.stories.AllStories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.AllStories - } - return result - }) - } + static func getAllStories(flags: Int32, state: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-290400731) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(state!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.getAllStories", parameters: [("flags", String(describing: flags)), ("state", String(describing: state))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.AllStories? in + let reader = BufferReader(buffer) + var result: Api.stories.AllStories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.AllStories + } + return result + }) + } } public extension Api.functions.stories { - static func getChatsToSend() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1519744160) - - return (FunctionDescription(name: "stories.getChatsToSend", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in - let reader = BufferReader(buffer) - var result: Api.messages.Chats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Chats - } - return result - }) - } + static func getChatsToSend() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1519744160) + return (FunctionDescription(name: "stories.getChatsToSend", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + let reader = BufferReader(buffer) + var result: Api.messages.Chats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.Chats + } + return result + }) + } } public extension Api.functions.stories { - static func getPeerMaxIDs(id: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.RecentStory]>) { - let buffer = Buffer() - buffer.appendInt32(2018087280) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "stories.getPeerMaxIDs", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RecentStory]? in - let reader = BufferReader(buffer) - var result: [Api.RecentStory]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentStory.self) - } - return result - }) - } + static func getPeerMaxIDs(id: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.RecentStory]>) { + let buffer = Buffer() + buffer.appendInt32(2018087280) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "stories.getPeerMaxIDs", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RecentStory]? in + let reader = BufferReader(buffer) + var result: [Api.RecentStory]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentStory.self) + } + return result + }) + } } public extension Api.functions.stories { - static func getPeerStories(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(743103056) - peer.serialize(buffer, true) - return (FunctionDescription(name: "stories.getPeerStories", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.PeerStories? in - let reader = BufferReader(buffer) - var result: Api.stories.PeerStories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.PeerStories - } - return result - }) - } + static func getPeerStories(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(743103056) + peer.serialize(buffer, true) + return (FunctionDescription(name: "stories.getPeerStories", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.PeerStories? in + let reader = BufferReader(buffer) + var result: Api.stories.PeerStories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.PeerStories + } + return result + }) + } } public extension Api.functions.stories { - static func getPinnedStories(peer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1478600156) - peer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getPinnedStories", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in - let reader = BufferReader(buffer) - var result: Api.stories.Stories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.Stories - } - return result - }) - } + static func getPinnedStories(peer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1478600156) + peer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getPinnedStories", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + let reader = BufferReader(buffer) + var result: Api.stories.Stories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.Stories + } + return result + }) + } } public extension Api.functions.stories { - static func getStoriesArchive(peer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1271586794) - peer.serialize(buffer, true) - serializeInt32(offsetId, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoriesArchive", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in - let reader = BufferReader(buffer) - var result: Api.stories.Stories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.Stories - } - return result - }) - } + static func getStoriesArchive(peer: Api.InputPeer, offsetId: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1271586794) + peer.serialize(buffer, true) + serializeInt32(offsetId, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getStoriesArchive", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + let reader = BufferReader(buffer) + var result: Api.stories.Stories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.Stories + } + return result + }) + } } public extension Api.functions.stories { - static func getStoriesByID(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1467271796) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.getStoriesByID", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in - let reader = BufferReader(buffer) - var result: Api.stories.Stories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.Stories - } - return result - }) - } + static func getStoriesByID(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1467271796) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.getStoriesByID", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + let reader = BufferReader(buffer) + var result: Api.stories.Stories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.Stories + } + return result + }) + } } public extension Api.functions.stories { - static func getStoriesViews(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(685862088) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.getStoriesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViews? in - let reader = BufferReader(buffer) - var result: Api.stories.StoryViews? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.StoryViews - } - return result - }) - } + static func getStoriesViews(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(685862088) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.getStoriesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViews? in + let reader = BufferReader(buffer) + var result: Api.stories.StoryViews? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.StoryViews + } + return result + }) + } } public extension Api.functions.stories { - static func getStoryReactionsList(flags: Int32, peer: Api.InputPeer, id: Int32, reaction: Api.Reaction?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1179482081) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(id, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {reaction!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(offset!, buffer: buffer, boxed: false)} - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoryReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryReactionsList? in - let reader = BufferReader(buffer) - var result: Api.stories.StoryReactionsList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.StoryReactionsList - } - return result - }) - } + static func getStoryReactionsList(flags: Int32, peer: Api.InputPeer, id: Int32, reaction: Api.Reaction?, offset: String?, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1179482081) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(id, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + reaction!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(offset!, buffer: buffer, boxed: false) + } + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getStoryReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryReactionsList? in + let reader = BufferReader(buffer) + var result: Api.stories.StoryReactionsList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.StoryReactionsList + } + return result + }) + } } public extension Api.functions.stories { - static func getStoryViewsList(flags: Int32, peer: Api.InputPeer, q: String?, id: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2127707223) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 {serializeString(q!, buffer: buffer, boxed: false)} - serializeInt32(id, buffer: buffer, boxed: false) - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoryViewsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViewsList? in - let reader = BufferReader(buffer) - var result: Api.stories.StoryViewsList? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.StoryViewsList - } - return result - }) - } + static func getStoryViewsList(flags: Int32, peer: Api.InputPeer, q: String?, id: Int32, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2127707223) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(q!, buffer: buffer, boxed: false) + } + serializeInt32(id, buffer: buffer, boxed: false) + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.getStoryViewsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViewsList? in + let reader = BufferReader(buffer) + var result: Api.stories.StoryViewsList? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.StoryViewsList + } + return result + }) + } } public extension Api.functions.stories { - static func incrementStoryViews(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1308456197) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.incrementStoryViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func incrementStoryViews(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1308456197) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.incrementStoryViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func readStories(peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { - let buffer = Buffer() - buffer.appendInt32(-1521034552) - peer.serialize(buffer, true) - serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.readStories", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - return result - }) - } + static func readStories(peer: Api.InputPeer, maxId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { + let buffer = Buffer() + buffer.appendInt32(-1521034552) + peer.serialize(buffer, true) + serializeInt32(maxId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.readStories", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + let reader = BufferReader(buffer) + var result: [Int32]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + return result + }) + } } public extension Api.functions.stories { - static func reorderAlbums(peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2060059687) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order.count)) - for item in order { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.reorderAlbums", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func reorderAlbums(peer: Api.InputPeer, order: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2060059687) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order.count)) + for item in order { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.reorderAlbums", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func report(peer: Api.InputPeer, id: [Int32], option: Buffer, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(433646405) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - serializeBytes(option, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in - let reader = BufferReader(buffer) - var result: Api.ReportResult? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.ReportResult - } - return result - }) - } + static func report(peer: Api.InputPeer, id: [Int32], option: Buffer, message: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(433646405) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + serializeBytes(option, buffer: buffer, boxed: false) + serializeString(message, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in + let reader = BufferReader(buffer) + var result: Api.ReportResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.ReportResult + } + return result + }) + } } public extension Api.functions.stories { - static func searchPosts(flags: Int32, hashtag: String?, area: Api.MediaArea?, peer: Api.InputPeer?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-780072697) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(hashtag!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {area!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {peer!.serialize(buffer, true)} - serializeString(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("area", String(describing: area)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.FoundStories? in - let reader = BufferReader(buffer) - var result: Api.stories.FoundStories? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stories.FoundStories - } - return result - }) - } + static func searchPosts(flags: Int32, hashtag: String?, area: Api.MediaArea?, peer: Api.InputPeer?, offset: String, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-780072697) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(hashtag!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + area!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 2) != 0 { + peer!.serialize(buffer, true) + } + serializeString(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stories.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("area", String(describing: area)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.FoundStories? in + let reader = BufferReader(buffer) + var result: Api.stories.FoundStories? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stories.FoundStories + } + return result + }) + } } public extension Api.functions.stories { - static func sendReaction(flags: Int32, peer: Api.InputPeer, storyId: Int32, reaction: Api.Reaction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2144810674) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(storyId, buffer: buffer, boxed: false) - reaction.serialize(buffer, true) - return (FunctionDescription(name: "stories.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("storyId", String(describing: storyId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func sendReaction(flags: Int32, peer: Api.InputPeer, storyId: Int32, reaction: Api.Reaction) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2144810674) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(storyId, buffer: buffer, boxed: false) + reaction.serialize(buffer, true) + return (FunctionDescription(name: "stories.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("storyId", String(describing: storyId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func sendStory(flags: Int32, peer: Api.InputPeer, media: Api.InputMedia, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, period: Int32?, fwdFromId: Api.InputPeer?, fwdFromStory: Int32?, albums: [Int32]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1937752812) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - media.serialize(buffer, true) - if Int(flags) & Int(1 << 5) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(mediaAreas!.count)) - for item in mediaAreas! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 0) != 0 {serializeString(caption!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(privacyRules.count)) - for item in privacyRules { - item.serialize(buffer, true) - } - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {fwdFromId!.serialize(buffer, true)} - if Int(flags) & Int(1 << 6) != 0 {serializeInt32(fwdFromStory!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(albums!.count)) - for item in albums! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("period", String(describing: period)), ("fwdFromId", String(describing: fwdFromId)), ("fwdFromStory", String(describing: fwdFromStory)), ("albums", String(describing: albums))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func sendStory(flags: Int32, peer: Api.InputPeer, media: Api.InputMedia, mediaAreas: [Api.MediaArea]?, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, period: Int32?, fwdFromId: Api.InputPeer?, fwdFromStory: Int32?, albums: [Int32]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1937752812) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + media.serialize(buffer, true) + if Int(flags) & Int(1 << 5) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(mediaAreas!.count)) + for item in mediaAreas! { + item.serialize(buffer, true) + } + } + if Int(flags) & Int(1 << 0) != 0 { + serializeString(caption!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(privacyRules.count)) + for item in privacyRules { + item.serialize(buffer, true) + } + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 3) != 0 { + serializeInt32(period!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 6) != 0 { + fwdFromId!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 6) != 0 { + serializeInt32(fwdFromStory!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 8) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(albums!.count)) + for item in albums! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("period", String(describing: period)), ("fwdFromId", String(describing: fwdFromId)), ("fwdFromStory", String(describing: fwdFromStory)), ("albums", String(describing: albums))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func startLive(flags: Int32, peer: Api.InputPeer, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, messagesEnabled: Api.Bool?, sendPaidMessagesStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-798372642) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeString(caption!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { - item.serialize(buffer, true) - }} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(privacyRules.count)) - for item in privacyRules { - item.serialize(buffer, true) - } - serializeInt64(randomId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 6) != 0 {messagesEnabled!.serialize(buffer, true)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "stories.startLive", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func startLive(flags: Int32, peer: Api.InputPeer, caption: String?, entities: [Api.MessageEntity]?, privacyRules: [Api.InputPrivacyRule], randomId: Int64, messagesEnabled: Api.Bool?, sendPaidMessagesStars: Int64?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-798372642) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(caption!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(entities!.count)) + for item in entities! { + item.serialize(buffer, true) + } + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(privacyRules.count)) + for item in privacyRules { + item.serialize(buffer, true) + } + serializeInt64(randomId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 6) != 0 { + messagesEnabled!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 7) != 0 { + serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.startLive", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } public extension Api.functions.stories { - static func toggleAllStoriesHidden(hidden: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2082822084) - hidden.serialize(buffer, true) - return (FunctionDescription(name: "stories.toggleAllStoriesHidden", parameters: [("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func toggleAllStoriesHidden(hidden: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2082822084) + hidden.serialize(buffer, true) + return (FunctionDescription(name: "stories.toggleAllStoriesHidden", parameters: [("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func togglePeerStoriesHidden(peer: Api.InputPeer, hidden: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1123805756) - peer.serialize(buffer, true) - hidden.serialize(buffer, true) - return (FunctionDescription(name: "stories.togglePeerStoriesHidden", parameters: [("peer", String(describing: peer)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func togglePeerStoriesHidden(peer: Api.InputPeer, hidden: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1123805756) + peer.serialize(buffer, true) + hidden.serialize(buffer, true) + return (FunctionDescription(name: "stories.togglePeerStoriesHidden", parameters: [("peer", String(describing: peer)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func togglePinned(peer: Api.InputPeer, id: [Int32], pinned: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { - let buffer = Buffer() - buffer.appendInt32(-1703566865) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - pinned.serialize(buffer, true) - return (FunctionDescription(name: "stories.togglePinned", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - return result - }) - } + static func togglePinned(peer: Api.InputPeer, id: [Int32], pinned: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Int32]>) { + let buffer = Buffer() + buffer.appendInt32(-1703566865) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + pinned.serialize(buffer, true) + return (FunctionDescription(name: "stories.togglePinned", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + let reader = BufferReader(buffer) + var result: [Int32]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + return result + }) + } } public extension Api.functions.stories { - static func togglePinnedToTop(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(187268763) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - serializeInt32(item, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "stories.togglePinnedToTop", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func togglePinnedToTop(peer: Api.InputPeer, id: [Int32]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(187268763) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + serializeInt32(item, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "stories.togglePinnedToTop", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.stories { - static func updateAlbum(flags: Int32, peer: Api.InputPeer, albumId: Int32, title: String?, deleteStories: [Int32]?, addStories: [Int32]?, order: [Int32]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1582455222) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(albumId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(deleteStories!.count)) - for item in deleteStories! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(addStories!.count)) - for item in addStories! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(order!.count)) - for item in order! { - serializeInt32(item, buffer: buffer, boxed: false) - }} - return (FunctionDescription(name: "stories.updateAlbum", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("title", String(describing: title)), ("deleteStories", String(describing: deleteStories)), ("addStories", String(describing: addStories)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in - let reader = BufferReader(buffer) - var result: Api.StoryAlbum? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.StoryAlbum - } - return result - }) - } + static func updateAlbum(flags: Int32, peer: Api.InputPeer, albumId: Int32, title: String?, deleteStories: [Int32]?, addStories: [Int32]?, order: [Int32]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1582455222) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(albumId, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(title!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(deleteStories!.count)) + for item in deleteStories! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + if Int(flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(addStories!.count)) + for item in addStories! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + if Int(flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(order!.count)) + for item in order! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + return (FunctionDescription(name: "stories.updateAlbum", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("title", String(describing: title)), ("deleteStories", String(describing: deleteStories)), ("addStories", String(describing: addStories)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in + let reader = BufferReader(buffer) + var result: Api.StoryAlbum? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.StoryAlbum + } + return result + }) + } } public extension Api.functions.updates { - static func getChannelDifference(flags: Int32, channel: Api.InputChannel, filter: Api.ChannelMessagesFilter, pts: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(51854712) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - filter.serialize(buffer, true) - serializeInt32(pts, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "updates.getChannelDifference", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("filter", String(describing: filter)), ("pts", String(describing: pts)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.ChannelDifference? in - let reader = BufferReader(buffer) - var result: Api.updates.ChannelDifference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.updates.ChannelDifference - } - return result - }) - } + static func getChannelDifference(flags: Int32, channel: Api.InputChannel, filter: Api.ChannelMessagesFilter, pts: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(51854712) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + filter.serialize(buffer, true) + serializeInt32(pts, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "updates.getChannelDifference", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("filter", String(describing: filter)), ("pts", String(describing: pts)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.ChannelDifference? in + let reader = BufferReader(buffer) + var result: Api.updates.ChannelDifference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.updates.ChannelDifference + } + return result + }) + } } public extension Api.functions.updates { - static func getDifference(flags: Int32, pts: Int32, ptsLimit: Int32?, ptsTotalLimit: Int32?, date: Int32, qts: Int32, qtsLimit: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(432207715) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(pts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(ptsLimit!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(ptsTotalLimit!, buffer: buffer, boxed: false)} - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(qts, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(qtsLimit!, buffer: buffer, boxed: false)} - return (FunctionDescription(name: "updates.getDifference", parameters: [("flags", String(describing: flags)), ("pts", String(describing: pts)), ("ptsLimit", String(describing: ptsLimit)), ("ptsTotalLimit", String(describing: ptsTotalLimit)), ("date", String(describing: date)), ("qts", String(describing: qts)), ("qtsLimit", String(describing: qtsLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.Difference? in - let reader = BufferReader(buffer) - var result: Api.updates.Difference? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.updates.Difference - } - return result - }) - } + static func getDifference(flags: Int32, pts: Int32, ptsLimit: Int32?, ptsTotalLimit: Int32?, date: Int32, qts: Int32, qtsLimit: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(432207715) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt32(pts, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 1) != 0 { + serializeInt32(ptsLimit!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(ptsTotalLimit!, buffer: buffer, boxed: false) + } + serializeInt32(date, buffer: buffer, boxed: false) + serializeInt32(qts, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 2) != 0 { + serializeInt32(qtsLimit!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "updates.getDifference", parameters: [("flags", String(describing: flags)), ("pts", String(describing: pts)), ("ptsLimit", String(describing: ptsLimit)), ("ptsTotalLimit", String(describing: ptsTotalLimit)), ("date", String(describing: date)), ("qts", String(describing: qts)), ("qtsLimit", String(describing: qtsLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.Difference? in + let reader = BufferReader(buffer) + var result: Api.updates.Difference? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.updates.Difference + } + return result + }) + } } public extension Api.functions.updates { - static func getState() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-304838614) - - return (FunctionDescription(name: "updates.getState", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.State? in - let reader = BufferReader(buffer) - var result: Api.updates.State? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.updates.State - } - return result - }) - } + static func getState() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-304838614) + return (FunctionDescription(name: "updates.getState", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.State? in + let reader = BufferReader(buffer) + var result: Api.updates.State? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.updates.State + } + return result + }) + } } public extension Api.functions.upload { - static func getCdnFile(fileToken: Buffer, offset: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(962554330) - serializeBytes(fileToken, buffer: buffer, boxed: false) - serializeInt64(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.CdnFile? in - let reader = BufferReader(buffer) - var result: Api.upload.CdnFile? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.upload.CdnFile - } - return result - }) - } + static func getCdnFile(fileToken: Buffer, offset: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(962554330) + serializeBytes(fileToken, buffer: buffer, boxed: false) + serializeInt64(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.getCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.CdnFile? in + let reader = BufferReader(buffer) + var result: Api.upload.CdnFile? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.upload.CdnFile + } + return result + }) + } } public extension Api.functions.upload { - static func getCdnFileHashes(fileToken: Buffer, offset: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { - let buffer = Buffer() - buffer.appendInt32(-1847836879) - serializeBytes(fileToken, buffer: buffer, boxed: false) - serializeInt64(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getCdnFileHashes", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in - let reader = BufferReader(buffer) - var result: [Api.FileHash]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) - } - return result - }) - } + static func getCdnFileHashes(fileToken: Buffer, offset: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { + let buffer = Buffer() + buffer.appendInt32(-1847836879) + serializeBytes(fileToken, buffer: buffer, boxed: false) + serializeInt64(offset, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.getCdnFileHashes", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + let reader = BufferReader(buffer) + var result: [Api.FileHash]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) + } + return result + }) + } } public extension Api.functions.upload { - static func getFile(flags: Int32, location: Api.InputFileLocation, offset: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1101843010) - serializeInt32(flags, buffer: buffer, boxed: false) - location.serialize(buffer, true) - serializeInt64(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getFile", parameters: [("flags", String(describing: flags)), ("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.File? in - let reader = BufferReader(buffer) - var result: Api.upload.File? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.upload.File - } - return result - }) - } + static func getFile(flags: Int32, location: Api.InputFileLocation, offset: Int64, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1101843010) + serializeInt32(flags, buffer: buffer, boxed: false) + location.serialize(buffer, true) + serializeInt64(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.getFile", parameters: [("flags", String(describing: flags)), ("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.File? in + let reader = BufferReader(buffer) + var result: Api.upload.File? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.upload.File + } + return result + }) + } } public extension Api.functions.upload { - static func getFileHashes(location: Api.InputFileLocation, offset: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { - let buffer = Buffer() - buffer.appendInt32(-1856595926) - location.serialize(buffer, true) - serializeInt64(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getFileHashes", parameters: [("location", String(describing: location)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in - let reader = BufferReader(buffer) - var result: [Api.FileHash]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) - } - return result - }) - } + static func getFileHashes(location: Api.InputFileLocation, offset: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { + let buffer = Buffer() + buffer.appendInt32(-1856595926) + location.serialize(buffer, true) + serializeInt64(offset, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.getFileHashes", parameters: [("location", String(describing: location)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + let reader = BufferReader(buffer) + var result: [Api.FileHash]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) + } + return result + }) + } } public extension Api.functions.upload { - static func getWebFile(location: Api.InputWebFileLocation, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(619086221) - location.serialize(buffer, true) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getWebFile", parameters: [("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.WebFile? in - let reader = BufferReader(buffer) - var result: Api.upload.WebFile? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.upload.WebFile - } - return result - }) - } + static func getWebFile(location: Api.InputWebFileLocation, offset: Int32, limit: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(619086221) + location.serialize(buffer, true) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.getWebFile", parameters: [("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.WebFile? in + let reader = BufferReader(buffer) + var result: Api.upload.WebFile? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.upload.WebFile + } + return result + }) + } } public extension Api.functions.upload { - static func reuploadCdnFile(fileToken: Buffer, requestToken: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { - let buffer = Buffer() - buffer.appendInt32(-1691921240) - serializeBytes(fileToken, buffer: buffer, boxed: false) - serializeBytes(requestToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.reuploadCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("requestToken", String(describing: requestToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in - let reader = BufferReader(buffer) - var result: [Api.FileHash]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) - } - return result - }) - } + static func reuploadCdnFile(fileToken: Buffer, requestToken: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.FileHash]>) { + let buffer = Buffer() + buffer.appendInt32(-1691921240) + serializeBytes(fileToken, buffer: buffer, boxed: false) + serializeBytes(requestToken, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.reuploadCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("requestToken", String(describing: requestToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + let reader = BufferReader(buffer) + var result: [Api.FileHash]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) + } + return result + }) + } } public extension Api.functions.upload { - static func saveBigFilePart(fileId: Int64, filePart: Int32, fileTotalParts: Int32, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-562337987) - serializeInt64(fileId, buffer: buffer, boxed: false) - serializeInt32(filePart, buffer: buffer, boxed: false) - serializeInt32(fileTotalParts, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.saveBigFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("fileTotalParts", String(describing: fileTotalParts)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveBigFilePart(fileId: Int64, filePart: Int32, fileTotalParts: Int32, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-562337987) + serializeInt64(fileId, buffer: buffer, boxed: false) + serializeInt32(filePart, buffer: buffer, boxed: false) + serializeInt32(fileTotalParts, buffer: buffer, boxed: false) + serializeBytes(bytes, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.saveBigFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("fileTotalParts", String(describing: fileTotalParts)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.upload { - static func saveFilePart(fileId: Int64, filePart: Int32, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1291540959) - serializeInt64(fileId, buffer: buffer, boxed: false) - serializeInt32(filePart, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.saveFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func saveFilePart(fileId: Int64, filePart: Int32, bytes: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1291540959) + serializeInt64(fileId, buffer: buffer, boxed: false) + serializeInt32(filePart, buffer: buffer, boxed: false) + serializeBytes(bytes, buffer: buffer, boxed: false) + return (FunctionDescription(name: "upload.saveFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.users { - static func getFullUser(id: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1240508136) - id.serialize(buffer, true) - return (FunctionDescription(name: "users.getFullUser", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.UserFull? in - let reader = BufferReader(buffer) - var result: Api.users.UserFull? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.users.UserFull - } - return result - }) - } + static func getFullUser(id: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1240508136) + id.serialize(buffer, true) + return (FunctionDescription(name: "users.getFullUser", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.UserFull? in + let reader = BufferReader(buffer) + var result: Api.users.UserFull? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.users.UserFull + } + return result + }) + } } public extension Api.functions.users { - static func getRequirementsToContact(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.RequirementToContact]>) { - let buffer = Buffer() - buffer.appendInt32(-660962397) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "users.getRequirementsToContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RequirementToContact]? in - let reader = BufferReader(buffer) - var result: [Api.RequirementToContact]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.RequirementToContact.self) - } - return result - }) - } + static func getRequirementsToContact(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.RequirementToContact]>) { + let buffer = Buffer() + buffer.appendInt32(-660962397) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "users.getRequirementsToContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RequirementToContact]? in + let reader = BufferReader(buffer) + var result: [Api.RequirementToContact]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.RequirementToContact.self) + } + return result + }) + } } public extension Api.functions.users { - static func getSavedMusic(id: Api.InputUser, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(2022539235) - id.serialize(buffer, true) - serializeInt32(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "users.getSavedMusic", parameters: [("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in - let reader = BufferReader(buffer) - var result: Api.users.SavedMusic? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.users.SavedMusic - } - return result - }) - } + static func getSavedMusic(id: Api.InputUser, offset: Int32, limit: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(2022539235) + id.serialize(buffer, true) + serializeInt32(offset, buffer: buffer, boxed: false) + serializeInt32(limit, buffer: buffer, boxed: false) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "users.getSavedMusic", parameters: [("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in + let reader = BufferReader(buffer) + var result: Api.users.SavedMusic? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.users.SavedMusic + } + return result + }) + } } public extension Api.functions.users { - static func getSavedMusicByID(id: Api.InputUser, documents: [Api.InputDocument]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1970513129) - id.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documents.count)) - for item in documents { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "users.getSavedMusicByID", parameters: [("id", String(describing: id)), ("documents", String(describing: documents))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in - let reader = BufferReader(buffer) - var result: Api.users.SavedMusic? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.users.SavedMusic - } - return result - }) - } + static func getSavedMusicByID(id: Api.InputUser, documents: [Api.InputDocument]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1970513129) + id.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(documents.count)) + for item in documents { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "users.getSavedMusicByID", parameters: [("id", String(describing: id)), ("documents", String(describing: documents))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in + let reader = BufferReader(buffer) + var result: Api.users.SavedMusic? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.users.SavedMusic + } + return result + }) + } } public extension Api.functions.users { - static func getUsers(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) { - let buffer = Buffer() - buffer.appendInt32(227648840) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(id.count)) - for item in id { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "users.getUsers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.User]? in - let reader = BufferReader(buffer) - var result: [Api.User]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - return result - }) - } + static func getUsers(id: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.User]>) { + let buffer = Buffer() + buffer.appendInt32(227648840) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(id.count)) + for item in id { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "users.getUsers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.User]? in + let reader = BufferReader(buffer) + var result: [Api.User]? + if let _ = reader.readInt32() { + result = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + return result + }) + } } public extension Api.functions.users { - static func setSecureValueErrors(id: Api.InputUser, errors: [Api.SecureValueError]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1865902923) - id.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(errors.count)) - for item in errors { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "users.setSecureValueErrors", parameters: [("id", String(describing: id)), ("errors", String(describing: errors))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } + static func setSecureValueErrors(id: Api.InputUser, errors: [Api.SecureValueError]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1865902923) + id.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(errors.count)) + for item in errors { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "users.setSecureValueErrors", parameters: [("id", String(describing: id)), ("errors", String(describing: errors))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } } public extension Api.functions.users { - static func suggestBirthday(id: Api.InputUser, birthday: Api.Birthday) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-61656206) - id.serialize(buffer, true) - birthday.serialize(buffer, true) - return (FunctionDescription(name: "users.suggestBirthday", parameters: [("id", String(describing: id)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in - let reader = BufferReader(buffer) - var result: Api.Updates? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Updates - } - return result - }) - } + static func suggestBirthday(id: Api.InputUser, birthday: Api.Birthday) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-61656206) + id.serialize(buffer, true) + birthday.serialize(buffer, true) + return (FunctionDescription(name: "users.suggestBirthday", parameters: [("id", String(describing: id)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + let reader = BufferReader(buffer) + var result: Api.Updates? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Updates + } + return result + }) + } } diff --git a/submodules/TelegramApi/Sources/Api5.swift b/submodules/TelegramApi/Sources/Api5.swift index 2ce916e3f5..006fc66147 100644 --- a/submodules/TelegramApi/Sources/Api5.swift +++ b/submodules/TelegramApi/Sources/Api5.swift @@ -1,29 +1,47 @@ public extension Api { enum ChatInviteImporter: TypeConstructorDescription { - case chatInviteImporter(flags: Int32, userId: Int64, date: Int32, about: String?, approvedBy: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatInviteImporter(let flags, let userId, let date, let about, let approvedBy): - if boxed { - buffer.appendInt32(-1940201511) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt64(approvedBy!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatInviteImporter(let flags, let userId, let date, let about, let approvedBy): - return ("chatInviteImporter", [("flags", flags as Any), ("userId", userId as Any), ("date", date as Any), ("about", about as Any), ("approvedBy", approvedBy as Any)]) - } - } - + public class Cons_chatInviteImporter { + public var flags: Int32 + public var userId: Int64 + public var date: Int32 + public var about: String? + public var approvedBy: Int64? + public init(flags: Int32, userId: Int64, date: Int32, about: String?, approvedBy: Int64?) { + self.flags = flags + self.userId = userId + self.date = date + self.about = about + self.approvedBy = approvedBy + } + } + case chatInviteImporter(Cons_chatInviteImporter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatInviteImporter(let _data): + if boxed { + buffer.appendInt32(-1940201511) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.about!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt64(_data.approvedBy!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatInviteImporter(let _data): + return ("chatInviteImporter", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("about", _data.about as Any), ("approvedBy", _data.approvedBy as Any)]) + } + } + public static func parse_chatInviteImporter(_ reader: BufferReader) -> ChatInviteImporter? { var _1: Int32? _1 = reader.readInt32() @@ -32,104 +50,138 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: String? - if Int(_1!) & Int(1 << 2) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } var _5: Int64? - if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt64() } + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.ChatInviteImporter.chatInviteImporter(flags: _1!, userId: _2!, date: _3!, about: _4, approvedBy: _5) + return Api.ChatInviteImporter.chatInviteImporter(Cons_chatInviteImporter(flags: _1!, userId: _2!, date: _3!, about: _4, approvedBy: _5)) } else { return nil } } - } } public extension Api { enum ChatOnlines: TypeConstructorDescription { - case chatOnlines(onlines: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatOnlines(let onlines): - if boxed { - buffer.appendInt32(-264117680) - } - serializeInt32(onlines, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatOnlines(let onlines): - return ("chatOnlines", [("onlines", onlines as Any)]) - } - } - + public class Cons_chatOnlines { + public var onlines: Int32 + public init(onlines: Int32) { + self.onlines = onlines + } + } + case chatOnlines(Cons_chatOnlines) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatOnlines(let _data): + if boxed { + buffer.appendInt32(-264117680) + } + serializeInt32(_data.onlines, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatOnlines(let _data): + return ("chatOnlines", [("onlines", _data.onlines as Any)]) + } + } + public static func parse_chatOnlines(_ reader: BufferReader) -> ChatOnlines? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ChatOnlines.chatOnlines(onlines: _1!) + return Api.ChatOnlines.chatOnlines(Cons_chatOnlines(onlines: _1!)) } else { return nil } } - } } public extension Api { enum ChatParticipant: TypeConstructorDescription { - case chatParticipant(userId: Int64, inviterId: Int64, date: Int32) - case chatParticipantAdmin(userId: Int64, inviterId: Int64, date: Int32) - case chatParticipantCreator(userId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatParticipant(let userId, let inviterId, let date): - if boxed { - buffer.appendInt32(-1070776313) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(inviterId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .chatParticipantAdmin(let userId, let inviterId, let date): - if boxed { - buffer.appendInt32(-1600962725) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(inviterId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - break - case .chatParticipantCreator(let userId): - if boxed { - buffer.appendInt32(-462696732) - } - serializeInt64(userId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatParticipant(let userId, let inviterId, let date): - return ("chatParticipant", [("userId", userId as Any), ("inviterId", inviterId as Any), ("date", date as Any)]) - case .chatParticipantAdmin(let userId, let inviterId, let date): - return ("chatParticipantAdmin", [("userId", userId as Any), ("inviterId", inviterId as Any), ("date", date as Any)]) - case .chatParticipantCreator(let userId): - return ("chatParticipantCreator", [("userId", userId as Any)]) - } - } - + public class Cons_chatParticipant { + public var userId: Int64 + public var inviterId: Int64 + public var date: Int32 + public init(userId: Int64, inviterId: Int64, date: Int32) { + self.userId = userId + self.inviterId = inviterId + self.date = date + } + } + public class Cons_chatParticipantAdmin { + public var userId: Int64 + public var inviterId: Int64 + public var date: Int32 + public init(userId: Int64, inviterId: Int64, date: Int32) { + self.userId = userId + self.inviterId = inviterId + self.date = date + } + } + public class Cons_chatParticipantCreator { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + } + case chatParticipant(Cons_chatParticipant) + case chatParticipantAdmin(Cons_chatParticipantAdmin) + case chatParticipantCreator(Cons_chatParticipantCreator) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatParticipant(let _data): + if boxed { + buffer.appendInt32(-1070776313) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.inviterId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .chatParticipantAdmin(let _data): + if boxed { + buffer.appendInt32(-1600962725) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.inviterId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + break + case .chatParticipantCreator(let _data): + if boxed { + buffer.appendInt32(-462696732) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatParticipant(let _data): + return ("chatParticipant", [("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any)]) + case .chatParticipantAdmin(let _data): + return ("chatParticipantAdmin", [("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any)]) + case .chatParticipantCreator(let _data): + return ("chatParticipantCreator", [("userId", _data.userId as Any)]) + } + } + public static func parse_chatParticipant(_ reader: BufferReader) -> ChatParticipant? { var _1: Int64? _1 = reader.readInt64() @@ -141,7 +193,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.ChatParticipant.chatParticipant(userId: _1!, inviterId: _2!, date: _3!) + return Api.ChatParticipant.chatParticipant(Cons_chatParticipant(userId: _1!, inviterId: _2!, date: _3!)) } else { return nil @@ -158,7 +210,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.ChatParticipant.chatParticipantAdmin(userId: _1!, inviterId: _2!, date: _3!) + return Api.ChatParticipant.chatParticipantAdmin(Cons_chatParticipantAdmin(userId: _1!, inviterId: _2!, date: _3!)) } else { return nil @@ -169,54 +221,75 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.ChatParticipant.chatParticipantCreator(userId: _1!) + return Api.ChatParticipant.chatParticipantCreator(Cons_chatParticipantCreator(userId: _1!)) } else { return nil } } - } } public extension Api { enum ChatParticipants: TypeConstructorDescription { - case chatParticipants(chatId: Int64, participants: [Api.ChatParticipant], version: Int32) - case chatParticipantsForbidden(flags: Int32, chatId: Int64, selfParticipant: Api.ChatParticipant?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatParticipants(let chatId, let participants, let version): - if boxed { - buffer.appendInt32(1018991608) - } - serializeInt64(chatId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(participants.count)) - for item in participants { - item.serialize(buffer, true) - } - serializeInt32(version, buffer: buffer, boxed: false) - break - case .chatParticipantsForbidden(let flags, let chatId, let selfParticipant): - if boxed { - buffer.appendInt32(-2023500831) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(chatId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {selfParticipant!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatParticipants(let chatId, let participants, let version): - return ("chatParticipants", [("chatId", chatId as Any), ("participants", participants as Any), ("version", version as Any)]) - case .chatParticipantsForbidden(let flags, let chatId, let selfParticipant): - return ("chatParticipantsForbidden", [("flags", flags as Any), ("chatId", chatId as Any), ("selfParticipant", selfParticipant as Any)]) - } - } - + public class Cons_chatParticipants { + public var chatId: Int64 + public var participants: [Api.ChatParticipant] + public var version: Int32 + public init(chatId: Int64, participants: [Api.ChatParticipant], version: Int32) { + self.chatId = chatId + self.participants = participants + self.version = version + } + } + public class Cons_chatParticipantsForbidden { + public var flags: Int32 + public var chatId: Int64 + public var selfParticipant: Api.ChatParticipant? + public init(flags: Int32, chatId: Int64, selfParticipant: Api.ChatParticipant?) { + self.flags = flags + self.chatId = chatId + self.selfParticipant = selfParticipant + } + } + case chatParticipants(Cons_chatParticipants) + case chatParticipantsForbidden(Cons_chatParticipantsForbidden) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatParticipants(let _data): + if boxed { + buffer.appendInt32(1018991608) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.participants.count)) + for item in _data.participants { + item.serialize(buffer, true) + } + serializeInt32(_data.version, buffer: buffer, boxed: false) + break + case .chatParticipantsForbidden(let _data): + if boxed { + buffer.appendInt32(-2023500831) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.selfParticipant!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatParticipants(let _data): + return ("chatParticipants", [("chatId", _data.chatId as Any), ("participants", _data.participants as Any), ("version", _data.version as Any)]) + case .chatParticipantsForbidden(let _data): + return ("chatParticipantsForbidden", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("selfParticipant", _data.selfParticipant as Any)]) + } + } + public static func parse_chatParticipants(_ reader: BufferReader) -> ChatParticipants? { var _1: Int64? _1 = reader.readInt64() @@ -230,7 +303,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.ChatParticipants.chatParticipants(chatId: _1!, participants: _2!, version: _3!) + return Api.ChatParticipants.chatParticipants(Cons_chatParticipants(chatId: _1!, participants: _2!, version: _3!)) } else { return nil @@ -242,63 +315,79 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Api.ChatParticipant? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ChatParticipant - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ChatParticipant + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.ChatParticipants.chatParticipantsForbidden(flags: _1!, chatId: _2!, selfParticipant: _3) + return Api.ChatParticipants.chatParticipantsForbidden(Cons_chatParticipantsForbidden(flags: _1!, chatId: _2!, selfParticipant: _3)) } else { return nil } } - } } public extension Api { enum ChatPhoto: TypeConstructorDescription { - case chatPhoto(flags: Int32, photoId: Int64, strippedThumb: Buffer?, dcId: Int32) + public class Cons_chatPhoto { + public var flags: Int32 + public var photoId: Int64 + public var strippedThumb: Buffer? + public var dcId: Int32 + public init(flags: Int32, photoId: Int64, strippedThumb: Buffer?, dcId: Int32) { + self.flags = flags + self.photoId = photoId + self.strippedThumb = strippedThumb + self.dcId = dcId + } + } + case chatPhoto(Cons_chatPhoto) case chatPhotoEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatPhoto(let flags, let photoId, let strippedThumb, let dcId): - if boxed { - buffer.appendInt32(476978193) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(photoId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeBytes(strippedThumb!, buffer: buffer, boxed: false)} - serializeInt32(dcId, buffer: buffer, boxed: false) - break - case .chatPhotoEmpty: - if boxed { - buffer.appendInt32(935395612) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatPhoto(let flags, let photoId, let strippedThumb, let dcId): - return ("chatPhoto", [("flags", flags as Any), ("photoId", photoId as Any), ("strippedThumb", strippedThumb as Any), ("dcId", dcId as Any)]) - case .chatPhotoEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatPhoto(let _data): + if boxed { + buffer.appendInt32(476978193) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.photoId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeBytes(_data.strippedThumb!, buffer: buffer, boxed: false) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + break + case .chatPhotoEmpty: + if boxed { + buffer.appendInt32(935395612) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatPhoto(let _data): + return ("chatPhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("strippedThumb", _data.strippedThumb as Any), ("dcId", _data.dcId as Any)]) + case .chatPhotoEmpty: return ("chatPhotoEmpty", []) - } - } - + } + } + public static func parse_chatPhoto(_ reader: BufferReader) -> ChatPhoto? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: Buffer? - if Int(_1!) & Int(1 << 1) != 0 {_3 = parseBytes(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _3 = parseBytes(reader) + } var _4: Int32? _4 = reader.readInt32() let _c1 = _1 != nil @@ -306,7 +395,7 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ChatPhoto.chatPhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!) + return Api.ChatPhoto.chatPhoto(Cons_chatPhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!)) } else { return nil @@ -315,59 +404,69 @@ public extension Api { public static func parse_chatPhotoEmpty(_ reader: BufferReader) -> ChatPhoto? { return Api.ChatPhoto.chatPhotoEmpty } - } } public extension Api { enum ChatReactions: TypeConstructorDescription { - case chatReactionsAll(flags: Int32) + public class Cons_chatReactionsAll { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + public class Cons_chatReactionsSome { + public var reactions: [Api.Reaction] + public init(reactions: [Api.Reaction]) { + self.reactions = reactions + } + } + case chatReactionsAll(Cons_chatReactionsAll) case chatReactionsNone - case chatReactionsSome(reactions: [Api.Reaction]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatReactionsAll(let flags): - if boxed { - buffer.appendInt32(1385335754) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - case .chatReactionsNone: - if boxed { - buffer.appendInt32(-352570692) - } - - break - case .chatReactionsSome(let reactions): - if boxed { - buffer.appendInt32(1713193015) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(reactions.count)) - for item in reactions { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatReactionsAll(let flags): - return ("chatReactionsAll", [("flags", flags as Any)]) - case .chatReactionsNone: + case chatReactionsSome(Cons_chatReactionsSome) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatReactionsAll(let _data): + if boxed { + buffer.appendInt32(1385335754) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + case .chatReactionsNone: + if boxed { + buffer.appendInt32(-352570692) + } + break + case .chatReactionsSome(let _data): + if boxed { + buffer.appendInt32(1713193015) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatReactionsAll(let _data): + return ("chatReactionsAll", [("flags", _data.flags as Any)]) + case .chatReactionsNone: return ("chatReactionsNone", []) - case .chatReactionsSome(let reactions): - return ("chatReactionsSome", [("reactions", reactions as Any)]) - } - } - + case .chatReactionsSome(let _data): + return ("chatReactionsSome", [("reactions", _data.reactions as Any)]) + } + } + public static func parse_chatReactionsAll(_ reader: BufferReader) -> ChatReactions? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ChatReactions.chatReactionsAll(flags: _1!) + return Api.ChatReactions.chatReactionsAll(Cons_chatReactionsAll(flags: _1!)) } else { return nil @@ -383,57 +482,70 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.ChatReactions.chatReactionsSome(reactions: _1!) + return Api.ChatReactions.chatReactionsSome(Cons_chatReactionsSome(reactions: _1!)) } else { return nil } } - } } public extension Api { enum ChatTheme: TypeConstructorDescription { - case chatTheme(emoticon: String) - case chatThemeUniqueGift(gift: Api.StarGift, themeSettings: [Api.ThemeSettings]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatTheme(let emoticon): - if boxed { - buffer.appendInt32(-1008731132) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .chatThemeUniqueGift(let gift, let themeSettings): - if boxed { - buffer.appendInt32(878246344) - } - gift.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(themeSettings.count)) - for item in themeSettings { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatTheme(let emoticon): - return ("chatTheme", [("emoticon", emoticon as Any)]) - case .chatThemeUniqueGift(let gift, let themeSettings): - return ("chatThemeUniqueGift", [("gift", gift as Any), ("themeSettings", themeSettings as Any)]) - } - } - + public class Cons_chatTheme { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + public class Cons_chatThemeUniqueGift { + public var gift: Api.StarGift + public var themeSettings: [Api.ThemeSettings] + public init(gift: Api.StarGift, themeSettings: [Api.ThemeSettings]) { + self.gift = gift + self.themeSettings = themeSettings + } + } + case chatTheme(Cons_chatTheme) + case chatThemeUniqueGift(Cons_chatThemeUniqueGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatTheme(let _data): + if boxed { + buffer.appendInt32(-1008731132) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .chatThemeUniqueGift(let _data): + if boxed { + buffer.appendInt32(878246344) + } + _data.gift.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.themeSettings.count)) + for item in _data.themeSettings { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatTheme(let _data): + return ("chatTheme", [("emoticon", _data.emoticon as Any)]) + case .chatThemeUniqueGift(let _data): + return ("chatThemeUniqueGift", [("gift", _data.gift as Any), ("themeSettings", _data.themeSettings as Any)]) + } + } + public static func parse_chatTheme(_ reader: BufferReader) -> ChatTheme? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ChatTheme.chatTheme(emoticon: _1!) + return Api.ChatTheme.chatTheme(Cons_chatTheme(emoticon: _1!)) } else { return nil @@ -451,139 +563,273 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ChatTheme.chatThemeUniqueGift(gift: _1!, themeSettings: _2!) + return Api.ChatTheme.chatThemeUniqueGift(Cons_chatThemeUniqueGift(gift: _1!, themeSettings: _2!)) } else { return nil } } - } } public extension Api { enum CodeSettings: TypeConstructorDescription { - case codeSettings(flags: Int32, logoutTokens: [Buffer]?, token: String?, appSandbox: Api.Bool?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .codeSettings(let flags, let logoutTokens, let token, let appSandbox): - if boxed { - buffer.appendInt32(-1390068360) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(logoutTokens!.count)) - for item in logoutTokens! { + public class Cons_codeSettings { + public var flags: Int32 + public var logoutTokens: [Buffer]? + public var token: String? + public var appSandbox: Api.Bool? + public init(flags: Int32, logoutTokens: [Buffer]?, token: String?, appSandbox: Api.Bool?) { + self.flags = flags + self.logoutTokens = logoutTokens + self.token = token + self.appSandbox = appSandbox + } + } + case codeSettings(Cons_codeSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .codeSettings(let _data): + if boxed { + buffer.appendInt32(-1390068360) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.logoutTokens!.count)) + for item in _data.logoutTokens! { serializeBytes(item, buffer: buffer, boxed: false) - }} - if Int(flags) & Int(1 << 8) != 0 {serializeString(token!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {appSandbox!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .codeSettings(let flags, let logoutTokens, let token, let appSandbox): - return ("codeSettings", [("flags", flags as Any), ("logoutTokens", logoutTokens as Any), ("token", token as Any), ("appSandbox", appSandbox as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeString(_data.token!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.appSandbox!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .codeSettings(let _data): + return ("codeSettings", [("flags", _data.flags as Any), ("logoutTokens", _data.logoutTokens as Any), ("token", _data.token as Any), ("appSandbox", _data.appSandbox as Any)]) + } + } + public static func parse_codeSettings(_ reader: BufferReader) -> CodeSettings? { var _1: Int32? _1 = reader.readInt32() var _2: [Buffer]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + } var _3: String? - if Int(_1!) & Int(1 << 8) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 8) != 0 { + _3 = parseString(reader) + } var _4: Api.Bool? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Bool - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Bool + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 6) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 8) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 8) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.CodeSettings.codeSettings(flags: _1!, logoutTokens: _2, token: _3, appSandbox: _4) + return Api.CodeSettings.codeSettings(Cons_codeSettings(flags: _1!, logoutTokens: _2, token: _3, appSandbox: _4)) } else { return nil } } - } } public extension Api { enum Config: TypeConstructorDescription { - case config(flags: Int32, date: Int32, expires: Int32, testMode: Api.Bool, thisDc: Int32, dcOptions: [Api.DcOption], dcTxtDomainName: String, chatSizeMax: Int32, megagroupSizeMax: Int32, forwardedCountMax: Int32, onlineUpdatePeriodMs: Int32, offlineBlurTimeoutMs: Int32, offlineIdleTimeoutMs: Int32, onlineCloudTimeoutMs: Int32, notifyCloudDelayMs: Int32, notifyDefaultDelayMs: Int32, pushChatPeriodMs: Int32, pushChatLimit: Int32, editTimeLimit: Int32, revokeTimeLimit: Int32, revokePmTimeLimit: Int32, ratingEDecay: Int32, stickersRecentLimit: Int32, channelsReadMediaPeriod: Int32, tmpSessions: Int32?, callReceiveTimeoutMs: Int32, callRingTimeoutMs: Int32, callConnectTimeoutMs: Int32, callPacketTimeoutMs: Int32, meUrlPrefix: String, autoupdateUrlPrefix: String?, gifSearchUsername: String?, venueSearchUsername: String?, imgSearchUsername: String?, staticMapsProvider: String?, captionLengthMax: Int32, messageLengthMax: Int32, webfileDcId: Int32, suggestedLangCode: String?, langPackVersion: Int32?, baseLangPackVersion: Int32?, reactionsDefault: Api.Reaction?, autologinToken: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .config(let flags, let date, let expires, let testMode, let thisDc, let dcOptions, let dcTxtDomainName, let chatSizeMax, let megagroupSizeMax, let forwardedCountMax, let onlineUpdatePeriodMs, let offlineBlurTimeoutMs, let offlineIdleTimeoutMs, let onlineCloudTimeoutMs, let notifyCloudDelayMs, let notifyDefaultDelayMs, let pushChatPeriodMs, let pushChatLimit, let editTimeLimit, let revokeTimeLimit, let revokePmTimeLimit, let ratingEDecay, let stickersRecentLimit, let channelsReadMediaPeriod, let tmpSessions, let callReceiveTimeoutMs, let callRingTimeoutMs, let callConnectTimeoutMs, let callPacketTimeoutMs, let meUrlPrefix, let autoupdateUrlPrefix, let gifSearchUsername, let venueSearchUsername, let imgSearchUsername, let staticMapsProvider, let captionLengthMax, let messageLengthMax, let webfileDcId, let suggestedLangCode, let langPackVersion, let baseLangPackVersion, let reactionsDefault, let autologinToken): - if boxed { - buffer.appendInt32(-870702050) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt32(expires, buffer: buffer, boxed: false) - testMode.serialize(buffer, true) - serializeInt32(thisDc, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(dcOptions.count)) - for item in dcOptions { - item.serialize(buffer, true) - } - serializeString(dcTxtDomainName, buffer: buffer, boxed: false) - serializeInt32(chatSizeMax, buffer: buffer, boxed: false) - serializeInt32(megagroupSizeMax, buffer: buffer, boxed: false) - serializeInt32(forwardedCountMax, buffer: buffer, boxed: false) - serializeInt32(onlineUpdatePeriodMs, buffer: buffer, boxed: false) - serializeInt32(offlineBlurTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(offlineIdleTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(onlineCloudTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(notifyCloudDelayMs, buffer: buffer, boxed: false) - serializeInt32(notifyDefaultDelayMs, buffer: buffer, boxed: false) - serializeInt32(pushChatPeriodMs, buffer: buffer, boxed: false) - serializeInt32(pushChatLimit, buffer: buffer, boxed: false) - serializeInt32(editTimeLimit, buffer: buffer, boxed: false) - serializeInt32(revokeTimeLimit, buffer: buffer, boxed: false) - serializeInt32(revokePmTimeLimit, buffer: buffer, boxed: false) - serializeInt32(ratingEDecay, buffer: buffer, boxed: false) - serializeInt32(stickersRecentLimit, buffer: buffer, boxed: false) - serializeInt32(channelsReadMediaPeriod, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(tmpSessions!, buffer: buffer, boxed: false)} - serializeInt32(callReceiveTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(callRingTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(callConnectTimeoutMs, buffer: buffer, boxed: false) - serializeInt32(callPacketTimeoutMs, buffer: buffer, boxed: false) - serializeString(meUrlPrefix, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {serializeString(autoupdateUrlPrefix!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {serializeString(gifSearchUsername!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeString(venueSearchUsername!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeString(imgSearchUsername!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 12) != 0 {serializeString(staticMapsProvider!, buffer: buffer, boxed: false)} - serializeInt32(captionLengthMax, buffer: buffer, boxed: false) - serializeInt32(messageLengthMax, buffer: buffer, boxed: false) - serializeInt32(webfileDcId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeString(suggestedLangCode!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(langPackVersion!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(baseLangPackVersion!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 15) != 0 {reactionsDefault!.serialize(buffer, true)} - if Int(flags) & Int(1 << 16) != 0 {serializeString(autologinToken!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .config(let flags, let date, let expires, let testMode, let thisDc, let dcOptions, let dcTxtDomainName, let chatSizeMax, let megagroupSizeMax, let forwardedCountMax, let onlineUpdatePeriodMs, let offlineBlurTimeoutMs, let offlineIdleTimeoutMs, let onlineCloudTimeoutMs, let notifyCloudDelayMs, let notifyDefaultDelayMs, let pushChatPeriodMs, let pushChatLimit, let editTimeLimit, let revokeTimeLimit, let revokePmTimeLimit, let ratingEDecay, let stickersRecentLimit, let channelsReadMediaPeriod, let tmpSessions, let callReceiveTimeoutMs, let callRingTimeoutMs, let callConnectTimeoutMs, let callPacketTimeoutMs, let meUrlPrefix, let autoupdateUrlPrefix, let gifSearchUsername, let venueSearchUsername, let imgSearchUsername, let staticMapsProvider, let captionLengthMax, let messageLengthMax, let webfileDcId, let suggestedLangCode, let langPackVersion, let baseLangPackVersion, let reactionsDefault, let autologinToken): - return ("config", [("flags", flags as Any), ("date", date as Any), ("expires", expires as Any), ("testMode", testMode as Any), ("thisDc", thisDc as Any), ("dcOptions", dcOptions as Any), ("dcTxtDomainName", dcTxtDomainName as Any), ("chatSizeMax", chatSizeMax as Any), ("megagroupSizeMax", megagroupSizeMax as Any), ("forwardedCountMax", forwardedCountMax as Any), ("onlineUpdatePeriodMs", onlineUpdatePeriodMs as Any), ("offlineBlurTimeoutMs", offlineBlurTimeoutMs as Any), ("offlineIdleTimeoutMs", offlineIdleTimeoutMs as Any), ("onlineCloudTimeoutMs", onlineCloudTimeoutMs as Any), ("notifyCloudDelayMs", notifyCloudDelayMs as Any), ("notifyDefaultDelayMs", notifyDefaultDelayMs as Any), ("pushChatPeriodMs", pushChatPeriodMs as Any), ("pushChatLimit", pushChatLimit as Any), ("editTimeLimit", editTimeLimit as Any), ("revokeTimeLimit", revokeTimeLimit as Any), ("revokePmTimeLimit", revokePmTimeLimit as Any), ("ratingEDecay", ratingEDecay as Any), ("stickersRecentLimit", stickersRecentLimit as Any), ("channelsReadMediaPeriod", channelsReadMediaPeriod as Any), ("tmpSessions", tmpSessions as Any), ("callReceiveTimeoutMs", callReceiveTimeoutMs as Any), ("callRingTimeoutMs", callRingTimeoutMs as Any), ("callConnectTimeoutMs", callConnectTimeoutMs as Any), ("callPacketTimeoutMs", callPacketTimeoutMs as Any), ("meUrlPrefix", meUrlPrefix as Any), ("autoupdateUrlPrefix", autoupdateUrlPrefix as Any), ("gifSearchUsername", gifSearchUsername as Any), ("venueSearchUsername", venueSearchUsername as Any), ("imgSearchUsername", imgSearchUsername as Any), ("staticMapsProvider", staticMapsProvider as Any), ("captionLengthMax", captionLengthMax as Any), ("messageLengthMax", messageLengthMax as Any), ("webfileDcId", webfileDcId as Any), ("suggestedLangCode", suggestedLangCode as Any), ("langPackVersion", langPackVersion as Any), ("baseLangPackVersion", baseLangPackVersion as Any), ("reactionsDefault", reactionsDefault as Any), ("autologinToken", autologinToken as Any)]) - } - } - + public class Cons_config { + public var flags: Int32 + public var date: Int32 + public var expires: Int32 + public var testMode: Api.Bool + public var thisDc: Int32 + public var dcOptions: [Api.DcOption] + public var dcTxtDomainName: String + public var chatSizeMax: Int32 + public var megagroupSizeMax: Int32 + public var forwardedCountMax: Int32 + public var onlineUpdatePeriodMs: Int32 + public var offlineBlurTimeoutMs: Int32 + public var offlineIdleTimeoutMs: Int32 + public var onlineCloudTimeoutMs: Int32 + public var notifyCloudDelayMs: Int32 + public var notifyDefaultDelayMs: Int32 + public var pushChatPeriodMs: Int32 + public var pushChatLimit: Int32 + public var editTimeLimit: Int32 + public var revokeTimeLimit: Int32 + public var revokePmTimeLimit: Int32 + public var ratingEDecay: Int32 + public var stickersRecentLimit: Int32 + public var channelsReadMediaPeriod: Int32 + public var tmpSessions: Int32? + public var callReceiveTimeoutMs: Int32 + public var callRingTimeoutMs: Int32 + public var callConnectTimeoutMs: Int32 + public var callPacketTimeoutMs: Int32 + public var meUrlPrefix: String + public var autoupdateUrlPrefix: String? + public var gifSearchUsername: String? + public var venueSearchUsername: String? + public var imgSearchUsername: String? + public var staticMapsProvider: String? + public var captionLengthMax: Int32 + public var messageLengthMax: Int32 + public var webfileDcId: Int32 + public var suggestedLangCode: String? + public var langPackVersion: Int32? + public var baseLangPackVersion: Int32? + public var reactionsDefault: Api.Reaction? + public var autologinToken: String? + public init(flags: Int32, date: Int32, expires: Int32, testMode: Api.Bool, thisDc: Int32, dcOptions: [Api.DcOption], dcTxtDomainName: String, chatSizeMax: Int32, megagroupSizeMax: Int32, forwardedCountMax: Int32, onlineUpdatePeriodMs: Int32, offlineBlurTimeoutMs: Int32, offlineIdleTimeoutMs: Int32, onlineCloudTimeoutMs: Int32, notifyCloudDelayMs: Int32, notifyDefaultDelayMs: Int32, pushChatPeriodMs: Int32, pushChatLimit: Int32, editTimeLimit: Int32, revokeTimeLimit: Int32, revokePmTimeLimit: Int32, ratingEDecay: Int32, stickersRecentLimit: Int32, channelsReadMediaPeriod: Int32, tmpSessions: Int32?, callReceiveTimeoutMs: Int32, callRingTimeoutMs: Int32, callConnectTimeoutMs: Int32, callPacketTimeoutMs: Int32, meUrlPrefix: String, autoupdateUrlPrefix: String?, gifSearchUsername: String?, venueSearchUsername: String?, imgSearchUsername: String?, staticMapsProvider: String?, captionLengthMax: Int32, messageLengthMax: Int32, webfileDcId: Int32, suggestedLangCode: String?, langPackVersion: Int32?, baseLangPackVersion: Int32?, reactionsDefault: Api.Reaction?, autologinToken: String?) { + self.flags = flags + self.date = date + self.expires = expires + self.testMode = testMode + self.thisDc = thisDc + self.dcOptions = dcOptions + self.dcTxtDomainName = dcTxtDomainName + self.chatSizeMax = chatSizeMax + self.megagroupSizeMax = megagroupSizeMax + self.forwardedCountMax = forwardedCountMax + self.onlineUpdatePeriodMs = onlineUpdatePeriodMs + self.offlineBlurTimeoutMs = offlineBlurTimeoutMs + self.offlineIdleTimeoutMs = offlineIdleTimeoutMs + self.onlineCloudTimeoutMs = onlineCloudTimeoutMs + self.notifyCloudDelayMs = notifyCloudDelayMs + self.notifyDefaultDelayMs = notifyDefaultDelayMs + self.pushChatPeriodMs = pushChatPeriodMs + self.pushChatLimit = pushChatLimit + self.editTimeLimit = editTimeLimit + self.revokeTimeLimit = revokeTimeLimit + self.revokePmTimeLimit = revokePmTimeLimit + self.ratingEDecay = ratingEDecay + self.stickersRecentLimit = stickersRecentLimit + self.channelsReadMediaPeriod = channelsReadMediaPeriod + self.tmpSessions = tmpSessions + self.callReceiveTimeoutMs = callReceiveTimeoutMs + self.callRingTimeoutMs = callRingTimeoutMs + self.callConnectTimeoutMs = callConnectTimeoutMs + self.callPacketTimeoutMs = callPacketTimeoutMs + self.meUrlPrefix = meUrlPrefix + self.autoupdateUrlPrefix = autoupdateUrlPrefix + self.gifSearchUsername = gifSearchUsername + self.venueSearchUsername = venueSearchUsername + self.imgSearchUsername = imgSearchUsername + self.staticMapsProvider = staticMapsProvider + self.captionLengthMax = captionLengthMax + self.messageLengthMax = messageLengthMax + self.webfileDcId = webfileDcId + self.suggestedLangCode = suggestedLangCode + self.langPackVersion = langPackVersion + self.baseLangPackVersion = baseLangPackVersion + self.reactionsDefault = reactionsDefault + self.autologinToken = autologinToken + } + } + case config(Cons_config) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .config(let _data): + if boxed { + buffer.appendInt32(-870702050) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + _data.testMode.serialize(buffer, true) + serializeInt32(_data.thisDc, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.dcOptions.count)) + for item in _data.dcOptions { + item.serialize(buffer, true) + } + serializeString(_data.dcTxtDomainName, buffer: buffer, boxed: false) + serializeInt32(_data.chatSizeMax, buffer: buffer, boxed: false) + serializeInt32(_data.megagroupSizeMax, buffer: buffer, boxed: false) + serializeInt32(_data.forwardedCountMax, buffer: buffer, boxed: false) + serializeInt32(_data.onlineUpdatePeriodMs, buffer: buffer, boxed: false) + serializeInt32(_data.offlineBlurTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.offlineIdleTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.onlineCloudTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.notifyCloudDelayMs, buffer: buffer, boxed: false) + serializeInt32(_data.notifyDefaultDelayMs, buffer: buffer, boxed: false) + serializeInt32(_data.pushChatPeriodMs, buffer: buffer, boxed: false) + serializeInt32(_data.pushChatLimit, buffer: buffer, boxed: false) + serializeInt32(_data.editTimeLimit, buffer: buffer, boxed: false) + serializeInt32(_data.revokeTimeLimit, buffer: buffer, boxed: false) + serializeInt32(_data.revokePmTimeLimit, buffer: buffer, boxed: false) + serializeInt32(_data.ratingEDecay, buffer: buffer, boxed: false) + serializeInt32(_data.stickersRecentLimit, buffer: buffer, boxed: false) + serializeInt32(_data.channelsReadMediaPeriod, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.tmpSessions!, buffer: buffer, boxed: false) + } + serializeInt32(_data.callReceiveTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.callRingTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.callConnectTimeoutMs, buffer: buffer, boxed: false) + serializeInt32(_data.callPacketTimeoutMs, buffer: buffer, boxed: false) + serializeString(_data.meUrlPrefix, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeString(_data.autoupdateUrlPrefix!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + serializeString(_data.gifSearchUsername!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeString(_data.venueSearchUsername!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeString(_data.imgSearchUsername!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeString(_data.staticMapsProvider!, buffer: buffer, boxed: false) + } + serializeInt32(_data.captionLengthMax, buffer: buffer, boxed: false) + serializeInt32(_data.messageLengthMax, buffer: buffer, boxed: false) + serializeInt32(_data.webfileDcId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.suggestedLangCode!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.langPackVersion!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.baseLangPackVersion!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 15) != 0 { + _data.reactionsDefault!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.autologinToken!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .config(let _data): + return ("config", [("flags", _data.flags as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("testMode", _data.testMode as Any), ("thisDc", _data.thisDc as Any), ("dcOptions", _data.dcOptions as Any), ("dcTxtDomainName", _data.dcTxtDomainName as Any), ("chatSizeMax", _data.chatSizeMax as Any), ("megagroupSizeMax", _data.megagroupSizeMax as Any), ("forwardedCountMax", _data.forwardedCountMax as Any), ("onlineUpdatePeriodMs", _data.onlineUpdatePeriodMs as Any), ("offlineBlurTimeoutMs", _data.offlineBlurTimeoutMs as Any), ("offlineIdleTimeoutMs", _data.offlineIdleTimeoutMs as Any), ("onlineCloudTimeoutMs", _data.onlineCloudTimeoutMs as Any), ("notifyCloudDelayMs", _data.notifyCloudDelayMs as Any), ("notifyDefaultDelayMs", _data.notifyDefaultDelayMs as Any), ("pushChatPeriodMs", _data.pushChatPeriodMs as Any), ("pushChatLimit", _data.pushChatLimit as Any), ("editTimeLimit", _data.editTimeLimit as Any), ("revokeTimeLimit", _data.revokeTimeLimit as Any), ("revokePmTimeLimit", _data.revokePmTimeLimit as Any), ("ratingEDecay", _data.ratingEDecay as Any), ("stickersRecentLimit", _data.stickersRecentLimit as Any), ("channelsReadMediaPeriod", _data.channelsReadMediaPeriod as Any), ("tmpSessions", _data.tmpSessions as Any), ("callReceiveTimeoutMs", _data.callReceiveTimeoutMs as Any), ("callRingTimeoutMs", _data.callRingTimeoutMs as Any), ("callConnectTimeoutMs", _data.callConnectTimeoutMs as Any), ("callPacketTimeoutMs", _data.callPacketTimeoutMs as Any), ("meUrlPrefix", _data.meUrlPrefix as Any), ("autoupdateUrlPrefix", _data.autoupdateUrlPrefix as Any), ("gifSearchUsername", _data.gifSearchUsername as Any), ("venueSearchUsername", _data.venueSearchUsername as Any), ("imgSearchUsername", _data.imgSearchUsername as Any), ("staticMapsProvider", _data.staticMapsProvider as Any), ("captionLengthMax", _data.captionLengthMax as Any), ("messageLengthMax", _data.messageLengthMax as Any), ("webfileDcId", _data.webfileDcId as Any), ("suggestedLangCode", _data.suggestedLangCode as Any), ("langPackVersion", _data.langPackVersion as Any), ("baseLangPackVersion", _data.baseLangPackVersion as Any), ("reactionsDefault", _data.reactionsDefault as Any), ("autologinToken", _data.autologinToken as Any)]) + } + } + public static func parse_config(_ reader: BufferReader) -> Config? { var _1: Int32? _1 = reader.readInt32() @@ -638,7 +884,9 @@ public extension Api { var _24: Int32? _24 = reader.readInt32() var _25: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_25 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _25 = reader.readInt32() + } var _26: Int32? _26 = reader.readInt32() var _27: Int32? @@ -650,15 +898,25 @@ public extension Api { var _30: String? _30 = parseString(reader) var _31: String? - if Int(_1!) & Int(1 << 7) != 0 {_31 = parseString(reader) } + if Int(_1!) & Int(1 << 7) != 0 { + _31 = parseString(reader) + } var _32: String? - if Int(_1!) & Int(1 << 9) != 0 {_32 = parseString(reader) } + if Int(_1!) & Int(1 << 9) != 0 { + _32 = parseString(reader) + } var _33: String? - if Int(_1!) & Int(1 << 10) != 0 {_33 = parseString(reader) } + if Int(_1!) & Int(1 << 10) != 0 { + _33 = parseString(reader) + } var _34: String? - if Int(_1!) & Int(1 << 11) != 0 {_34 = parseString(reader) } + if Int(_1!) & Int(1 << 11) != 0 { + _34 = parseString(reader) + } var _35: String? - if Int(_1!) & Int(1 << 12) != 0 {_35 = parseString(reader) } + if Int(_1!) & Int(1 << 12) != 0 { + _35 = parseString(reader) + } var _36: Int32? _36 = reader.readInt32() var _37: Int32? @@ -666,17 +924,27 @@ public extension Api { var _38: Int32? _38 = reader.readInt32() var _39: String? - if Int(_1!) & Int(1 << 2) != 0 {_39 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _39 = parseString(reader) + } var _40: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_40 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _40 = reader.readInt32() + } var _41: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_41 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _41 = reader.readInt32() + } var _42: Api.Reaction? - if Int(_1!) & Int(1 << 15) != 0 {if let signature = reader.readInt32() { - _42 = Api.parse(reader, signature: signature) as? Api.Reaction - } } + if Int(_1!) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _42 = Api.parse(reader, signature: signature) as? Api.Reaction + } + } var _43: String? - if Int(_1!) & Int(1 << 16) != 0 {_43 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _43 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -721,40 +989,51 @@ public extension Api { let _c42 = (Int(_1!) & Int(1 << 15) == 0) || _42 != nil let _c43 = (Int(_1!) & Int(1 << 16) == 0) || _43 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 && _c19 && _c20 && _c21 && _c22 && _c23 && _c24 && _c25 && _c26 && _c27 && _c28 && _c29 && _c30 && _c31 && _c32 && _c33 && _c34 && _c35 && _c36 && _c37 && _c38 && _c39 && _c40 && _c41 && _c42 && _c43 { - return Api.Config.config(flags: _1!, date: _2!, expires: _3!, testMode: _4!, thisDc: _5!, dcOptions: _6!, dcTxtDomainName: _7!, chatSizeMax: _8!, megagroupSizeMax: _9!, forwardedCountMax: _10!, onlineUpdatePeriodMs: _11!, offlineBlurTimeoutMs: _12!, offlineIdleTimeoutMs: _13!, onlineCloudTimeoutMs: _14!, notifyCloudDelayMs: _15!, notifyDefaultDelayMs: _16!, pushChatPeriodMs: _17!, pushChatLimit: _18!, editTimeLimit: _19!, revokeTimeLimit: _20!, revokePmTimeLimit: _21!, ratingEDecay: _22!, stickersRecentLimit: _23!, channelsReadMediaPeriod: _24!, tmpSessions: _25, callReceiveTimeoutMs: _26!, callRingTimeoutMs: _27!, callConnectTimeoutMs: _28!, callPacketTimeoutMs: _29!, meUrlPrefix: _30!, autoupdateUrlPrefix: _31, gifSearchUsername: _32, venueSearchUsername: _33, imgSearchUsername: _34, staticMapsProvider: _35, captionLengthMax: _36!, messageLengthMax: _37!, webfileDcId: _38!, suggestedLangCode: _39, langPackVersion: _40, baseLangPackVersion: _41, reactionsDefault: _42, autologinToken: _43) + return Api.Config.config(Cons_config(flags: _1!, date: _2!, expires: _3!, testMode: _4!, thisDc: _5!, dcOptions: _6!, dcTxtDomainName: _7!, chatSizeMax: _8!, megagroupSizeMax: _9!, forwardedCountMax: _10!, onlineUpdatePeriodMs: _11!, offlineBlurTimeoutMs: _12!, offlineIdleTimeoutMs: _13!, onlineCloudTimeoutMs: _14!, notifyCloudDelayMs: _15!, notifyDefaultDelayMs: _16!, pushChatPeriodMs: _17!, pushChatLimit: _18!, editTimeLimit: _19!, revokeTimeLimit: _20!, revokePmTimeLimit: _21!, ratingEDecay: _22!, stickersRecentLimit: _23!, channelsReadMediaPeriod: _24!, tmpSessions: _25, callReceiveTimeoutMs: _26!, callRingTimeoutMs: _27!, callConnectTimeoutMs: _28!, callPacketTimeoutMs: _29!, meUrlPrefix: _30!, autoupdateUrlPrefix: _31, gifSearchUsername: _32, venueSearchUsername: _33, imgSearchUsername: _34, staticMapsProvider: _35, captionLengthMax: _36!, messageLengthMax: _37!, webfileDcId: _38!, suggestedLangCode: _39, langPackVersion: _40, baseLangPackVersion: _41, reactionsDefault: _42, autologinToken: _43)) } else { return nil } } - } } public extension Api { enum ConnectedBot: TypeConstructorDescription { - case connectedBot(flags: Int32, botId: Int64, recipients: Api.BusinessBotRecipients, rights: Api.BusinessBotRights) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .connectedBot(let flags, let botId, let recipients, let rights): - if boxed { - buffer.appendInt32(-849058964) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - recipients.serialize(buffer, true) - rights.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .connectedBot(let flags, let botId, let recipients, let rights): - return ("connectedBot", [("flags", flags as Any), ("botId", botId as Any), ("recipients", recipients as Any), ("rights", rights as Any)]) - } - } - + public class Cons_connectedBot { + public var flags: Int32 + public var botId: Int64 + public var recipients: Api.BusinessBotRecipients + public var rights: Api.BusinessBotRights + public init(flags: Int32, botId: Int64, recipients: Api.BusinessBotRecipients, rights: Api.BusinessBotRights) { + self.flags = flags + self.botId = botId + self.recipients = recipients + self.rights = rights + } + } + case connectedBot(Cons_connectedBot) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .connectedBot(let _data): + if boxed { + buffer.appendInt32(-849058964) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + _data.recipients.serialize(buffer, true) + _data.rights.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .connectedBot(let _data): + return ("connectedBot", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("recipients", _data.recipients as Any), ("rights", _data.rights as Any)]) + } + } + public static func parse_connectedBot(_ reader: BufferReader) -> ConnectedBot? { var _1: Int32? _1 = reader.readInt32() @@ -773,44 +1052,65 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ConnectedBot.connectedBot(flags: _1!, botId: _2!, recipients: _3!, rights: _4!) + return Api.ConnectedBot.connectedBot(Cons_connectedBot(flags: _1!, botId: _2!, recipients: _3!, rights: _4!)) } else { return nil } } - } } public extension Api { enum ConnectedBotStarRef: TypeConstructorDescription { - case connectedBotStarRef(flags: Int32, url: String, date: Int32, botId: Int64, commissionPermille: Int32, durationMonths: Int32?, participants: Int64, revenue: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .connectedBotStarRef(let flags, let url, let date, let botId, let commissionPermille, let durationMonths, let participants, let revenue): - if boxed { - buffer.appendInt32(429997937) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(botId, buffer: buffer, boxed: false) - serializeInt32(commissionPermille, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(durationMonths!, buffer: buffer, boxed: false)} - serializeInt64(participants, buffer: buffer, boxed: false) - serializeInt64(revenue, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .connectedBotStarRef(let flags, let url, let date, let botId, let commissionPermille, let durationMonths, let participants, let revenue): - return ("connectedBotStarRef", [("flags", flags as Any), ("url", url as Any), ("date", date as Any), ("botId", botId as Any), ("commissionPermille", commissionPermille as Any), ("durationMonths", durationMonths as Any), ("participants", participants as Any), ("revenue", revenue as Any)]) - } - } - + public class Cons_connectedBotStarRef { + public var flags: Int32 + public var url: String + public var date: Int32 + public var botId: Int64 + public var commissionPermille: Int32 + public var durationMonths: Int32? + public var participants: Int64 + public var revenue: Int64 + public init(flags: Int32, url: String, date: Int32, botId: Int64, commissionPermille: Int32, durationMonths: Int32?, participants: Int64, revenue: Int64) { + self.flags = flags + self.url = url + self.date = date + self.botId = botId + self.commissionPermille = commissionPermille + self.durationMonths = durationMonths + self.participants = participants + self.revenue = revenue + } + } + case connectedBotStarRef(Cons_connectedBotStarRef) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .connectedBotStarRef(let _data): + if boxed { + buffer.appendInt32(429997937) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt32(_data.commissionPermille, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.durationMonths!, buffer: buffer, boxed: false) + } + serializeInt64(_data.participants, buffer: buffer, boxed: false) + serializeInt64(_data.revenue, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .connectedBotStarRef(let _data): + return ("connectedBotStarRef", [("flags", _data.flags as Any), ("url", _data.url as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("commissionPermille", _data.commissionPermille as Any), ("durationMonths", _data.durationMonths as Any), ("participants", _data.participants as Any), ("revenue", _data.revenue as Any)]) + } + } + public static func parse_connectedBotStarRef(_ reader: BufferReader) -> ConnectedBotStarRef? { var _1: Int32? _1 = reader.readInt32() @@ -823,7 +1123,9 @@ public extension Api { var _5: Int32? _5 = reader.readInt32() var _6: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } var _7: Int64? _7 = reader.readInt64() var _8: Int64? @@ -837,38 +1139,45 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.ConnectedBotStarRef.connectedBotStarRef(flags: _1!, url: _2!, date: _3!, botId: _4!, commissionPermille: _5!, durationMonths: _6, participants: _7!, revenue: _8!) + return Api.ConnectedBotStarRef.connectedBotStarRef(Cons_connectedBotStarRef(flags: _1!, url: _2!, date: _3!, botId: _4!, commissionPermille: _5!, durationMonths: _6, participants: _7!, revenue: _8!)) } else { return nil } } - } } public extension Api { enum Contact: TypeConstructorDescription { - case contact(userId: Int64, mutual: Api.Bool) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contact(let userId, let mutual): - if boxed { - buffer.appendInt32(341499403) - } - serializeInt64(userId, buffer: buffer, boxed: false) - mutual.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contact(let userId, let mutual): - return ("contact", [("userId", userId as Any), ("mutual", mutual as Any)]) - } - } - + public class Cons_contact { + public var userId: Int64 + public var mutual: Api.Bool + public init(userId: Int64, mutual: Api.Bool) { + self.userId = userId + self.mutual = mutual + } + } + case contact(Cons_contact) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contact(let _data): + if boxed { + buffer.appendInt32(341499403) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.mutual.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contact(let _data): + return ("contact", [("userId", _data.userId as Any), ("mutual", _data.mutual as Any)]) + } + } + public static func parse_contact(_ reader: BufferReader) -> Contact? { var _1: Int64? _1 = reader.readInt64() @@ -879,38 +1188,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Contact.contact(userId: _1!, mutual: _2!) + return Api.Contact.contact(Cons_contact(userId: _1!, mutual: _2!)) } else { return nil } } - } } public extension Api { enum ContactBirthday: TypeConstructorDescription { - case contactBirthday(contactId: Int64, birthday: Api.Birthday) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contactBirthday(let contactId, let birthday): - if boxed { - buffer.appendInt32(496600883) - } - serializeInt64(contactId, buffer: buffer, boxed: false) - birthday.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contactBirthday(let contactId, let birthday): - return ("contactBirthday", [("contactId", contactId as Any), ("birthday", birthday as Any)]) - } - } - + public class Cons_contactBirthday { + public var contactId: Int64 + public var birthday: Api.Birthday + public init(contactId: Int64, birthday: Api.Birthday) { + self.contactId = contactId + self.birthday = birthday + } + } + case contactBirthday(Cons_contactBirthday) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contactBirthday(let _data): + if boxed { + buffer.appendInt32(496600883) + } + serializeInt64(_data.contactId, buffer: buffer, boxed: false) + _data.birthday.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contactBirthday(let _data): + return ("contactBirthday", [("contactId", _data.contactId as Any), ("birthday", _data.birthday as Any)]) + } + } + public static func parse_contactBirthday(_ reader: BufferReader) -> ContactBirthday? { var _1: Int64? _1 = reader.readInt64() @@ -921,38 +1237,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ContactBirthday.contactBirthday(contactId: _1!, birthday: _2!) + return Api.ContactBirthday.contactBirthday(Cons_contactBirthday(contactId: _1!, birthday: _2!)) } else { return nil } } - } } public extension Api { enum ContactStatus: TypeConstructorDescription { - case contactStatus(userId: Int64, status: Api.UserStatus) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .contactStatus(let userId, let status): - if boxed { - buffer.appendInt32(383348795) - } - serializeInt64(userId, buffer: buffer, boxed: false) - status.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .contactStatus(let userId, let status): - return ("contactStatus", [("userId", userId as Any), ("status", status as Any)]) - } - } - + public class Cons_contactStatus { + public var userId: Int64 + public var status: Api.UserStatus + public init(userId: Int64, status: Api.UserStatus) { + self.userId = userId + self.status = status + } + } + case contactStatus(Cons_contactStatus) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .contactStatus(let _data): + if boxed { + buffer.appendInt32(383348795) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + _data.status.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .contactStatus(let _data): + return ("contactStatus", [("userId", _data.userId as Any), ("status", _data.status as Any)]) + } + } + public static func parse_contactStatus(_ reader: BufferReader) -> ContactStatus? { var _1: Int64? _1 = reader.readInt64() @@ -963,77 +1286,97 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ContactStatus.contactStatus(userId: _1!, status: _2!) + return Api.ContactStatus.contactStatus(Cons_contactStatus(userId: _1!, status: _2!)) } else { return nil } } - } } public extension Api { enum DataJSON: TypeConstructorDescription { - case dataJSON(data: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dataJSON(let data): - if boxed { - buffer.appendInt32(2104790276) - } - serializeString(data, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dataJSON(let data): - return ("dataJSON", [("data", data as Any)]) - } - } - + public class Cons_dataJSON { + public var data: String + public init(data: String) { + self.data = data + } + } + case dataJSON(Cons_dataJSON) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dataJSON(let _data): + if boxed { + buffer.appendInt32(2104790276) + } + serializeString(_data.data, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dataJSON(let _data): + return ("dataJSON", [("data", _data.data as Any)]) + } + } + public static func parse_dataJSON(_ reader: BufferReader) -> DataJSON? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.DataJSON.dataJSON(data: _1!) + return Api.DataJSON.dataJSON(Cons_dataJSON(data: _1!)) } else { return nil } } - } } public extension Api { enum DcOption: TypeConstructorDescription { - case dcOption(flags: Int32, id: Int32, ipAddress: String, port: Int32, secret: Buffer?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dcOption(let flags, let id, let ipAddress, let port, let secret): - if boxed { - buffer.appendInt32(414687501) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeString(ipAddress, buffer: buffer, boxed: false) - serializeInt32(port, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 10) != 0 {serializeBytes(secret!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dcOption(let flags, let id, let ipAddress, let port, let secret): - return ("dcOption", [("flags", flags as Any), ("id", id as Any), ("ipAddress", ipAddress as Any), ("port", port as Any), ("secret", secret as Any)]) - } - } - + public class Cons_dcOption { + public var flags: Int32 + public var id: Int32 + public var ipAddress: String + public var port: Int32 + public var secret: Buffer? + public init(flags: Int32, id: Int32, ipAddress: String, port: Int32, secret: Buffer?) { + self.flags = flags + self.id = id + self.ipAddress = ipAddress + self.port = port + self.secret = secret + } + } + case dcOption(Cons_dcOption) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dcOption(let _data): + if boxed { + buffer.appendInt32(414687501) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeString(_data.ipAddress, buffer: buffer, boxed: false) + serializeInt32(_data.port, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeBytes(_data.secret!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dcOption(let _data): + return ("dcOption", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ipAddress", _data.ipAddress as Any), ("port", _data.port as Any), ("secret", _data.secret as Any)]) + } + } + public static func parse_dcOption(_ reader: BufferReader) -> DcOption? { var _1: Int32? _1 = reader.readInt32() @@ -1044,108 +1387,172 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Buffer? - if Int(_1!) & Int(1 << 10) != 0 {_5 = parseBytes(reader) } + if Int(_1!) & Int(1 << 10) != 0 { + _5 = parseBytes(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 10) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.DcOption.dcOption(flags: _1!, id: _2!, ipAddress: _3!, port: _4!, secret: _5) + return Api.DcOption.dcOption(Cons_dcOption(flags: _1!, id: _2!, ipAddress: _3!, port: _4!, secret: _5)) } else { return nil } } - } } public extension Api { enum DefaultHistoryTTL: TypeConstructorDescription { - case defaultHistoryTTL(period: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .defaultHistoryTTL(let period): - if boxed { - buffer.appendInt32(1135897376) - } - serializeInt32(period, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .defaultHistoryTTL(let period): - return ("defaultHistoryTTL", [("period", period as Any)]) - } - } - + public class Cons_defaultHistoryTTL { + public var period: Int32 + public init(period: Int32) { + self.period = period + } + } + case defaultHistoryTTL(Cons_defaultHistoryTTL) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .defaultHistoryTTL(let _data): + if boxed { + buffer.appendInt32(1135897376) + } + serializeInt32(_data.period, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .defaultHistoryTTL(let _data): + return ("defaultHistoryTTL", [("period", _data.period as Any)]) + } + } + public static func parse_defaultHistoryTTL(_ reader: BufferReader) -> DefaultHistoryTTL? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.DefaultHistoryTTL.defaultHistoryTTL(period: _1!) + return Api.DefaultHistoryTTL.defaultHistoryTTL(Cons_defaultHistoryTTL(period: _1!)) } else { return nil } } - } } public extension Api { indirect enum Dialog: TypeConstructorDescription { - case dialog(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?, folderId: Int32?, ttlPeriod: Int32?) - case dialogFolder(flags: Int32, folder: Api.Folder, peer: Api.Peer, topMessage: Int32, unreadMutedPeersCount: Int32, unreadUnmutedPeersCount: Int32, unreadMutedMessagesCount: Int32, unreadUnmutedMessagesCount: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialog(let flags, let peer, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadMentionsCount, let unreadReactionsCount, let notifySettings, let pts, let draft, let folderId, let ttlPeriod): - if boxed { - buffer.appendInt32(-712374074) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(readInboxMaxId, buffer: buffer, boxed: false) - serializeInt32(readOutboxMaxId, buffer: buffer, boxed: false) - serializeInt32(unreadCount, buffer: buffer, boxed: false) - serializeInt32(unreadMentionsCount, buffer: buffer, boxed: false) - serializeInt32(unreadReactionsCount, buffer: buffer, boxed: false) - notifySettings.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(pts!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {draft!.serialize(buffer, true)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(ttlPeriod!, buffer: buffer, boxed: false)} - break - case .dialogFolder(let flags, let folder, let peer, let topMessage, let unreadMutedPeersCount, let unreadUnmutedPeersCount, let unreadMutedMessagesCount, let unreadUnmutedMessagesCount): - if boxed { - buffer.appendInt32(1908216652) - } - serializeInt32(flags, buffer: buffer, boxed: false) - folder.serialize(buffer, true) - peer.serialize(buffer, true) - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(unreadMutedPeersCount, buffer: buffer, boxed: false) - serializeInt32(unreadUnmutedPeersCount, buffer: buffer, boxed: false) - serializeInt32(unreadMutedMessagesCount, buffer: buffer, boxed: false) - serializeInt32(unreadUnmutedMessagesCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialog(let flags, let peer, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadMentionsCount, let unreadReactionsCount, let notifySettings, let pts, let draft, let folderId, let ttlPeriod): - return ("dialog", [("flags", flags as Any), ("peer", peer as Any), ("topMessage", topMessage as Any), ("readInboxMaxId", readInboxMaxId as Any), ("readOutboxMaxId", readOutboxMaxId as Any), ("unreadCount", unreadCount as Any), ("unreadMentionsCount", unreadMentionsCount as Any), ("unreadReactionsCount", unreadReactionsCount as Any), ("notifySettings", notifySettings as Any), ("pts", pts as Any), ("draft", draft as Any), ("folderId", folderId as Any), ("ttlPeriod", ttlPeriod as Any)]) - case .dialogFolder(let flags, let folder, let peer, let topMessage, let unreadMutedPeersCount, let unreadUnmutedPeersCount, let unreadMutedMessagesCount, let unreadUnmutedMessagesCount): - return ("dialogFolder", [("flags", flags as Any), ("folder", folder as Any), ("peer", peer as Any), ("topMessage", topMessage as Any), ("unreadMutedPeersCount", unreadMutedPeersCount as Any), ("unreadUnmutedPeersCount", unreadUnmutedPeersCount as Any), ("unreadMutedMessagesCount", unreadMutedMessagesCount as Any), ("unreadUnmutedMessagesCount", unreadUnmutedMessagesCount as Any)]) - } - } - + public class Cons_dialog { + public var flags: Int32 + public var peer: Api.Peer + public var topMessage: Int32 + public var readInboxMaxId: Int32 + public var readOutboxMaxId: Int32 + public var unreadCount: Int32 + public var unreadMentionsCount: Int32 + public var unreadReactionsCount: Int32 + public var notifySettings: Api.PeerNotifySettings + public var pts: Int32? + public var draft: Api.DraftMessage? + public var folderId: Int32? + public var ttlPeriod: Int32? + public init(flags: Int32, peer: Api.Peer, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, notifySettings: Api.PeerNotifySettings, pts: Int32?, draft: Api.DraftMessage?, folderId: Int32?, ttlPeriod: Int32?) { + self.flags = flags + self.peer = peer + self.topMessage = topMessage + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount + self.unreadMentionsCount = unreadMentionsCount + self.unreadReactionsCount = unreadReactionsCount + self.notifySettings = notifySettings + self.pts = pts + self.draft = draft + self.folderId = folderId + self.ttlPeriod = ttlPeriod + } + } + public class Cons_dialogFolder { + public var flags: Int32 + public var folder: Api.Folder + public var peer: Api.Peer + public var topMessage: Int32 + public var unreadMutedPeersCount: Int32 + public var unreadUnmutedPeersCount: Int32 + public var unreadMutedMessagesCount: Int32 + public var unreadUnmutedMessagesCount: Int32 + public init(flags: Int32, folder: Api.Folder, peer: Api.Peer, topMessage: Int32, unreadMutedPeersCount: Int32, unreadUnmutedPeersCount: Int32, unreadMutedMessagesCount: Int32, unreadUnmutedMessagesCount: Int32) { + self.flags = flags + self.folder = folder + self.peer = peer + self.topMessage = topMessage + self.unreadMutedPeersCount = unreadMutedPeersCount + self.unreadUnmutedPeersCount = unreadUnmutedPeersCount + self.unreadMutedMessagesCount = unreadMutedMessagesCount + self.unreadUnmutedMessagesCount = unreadUnmutedMessagesCount + } + } + case dialog(Cons_dialog) + case dialogFolder(Cons_dialogFolder) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialog(let _data): + if boxed { + buffer.appendInt32(-712374074) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + serializeInt32(_data.readInboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.readOutboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadMentionsCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadReactionsCount, buffer: buffer, boxed: false) + _data.notifySettings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.pts!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.draft!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + } + break + case .dialogFolder(let _data): + if boxed { + buffer.appendInt32(1908216652) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.folder.serialize(buffer, true) + _data.peer.serialize(buffer, true) + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + serializeInt32(_data.unreadMutedPeersCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadUnmutedPeersCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadMutedMessagesCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadUnmutedMessagesCount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialog(let _data): + return ("dialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("notifySettings", _data.notifySettings as Any), ("pts", _data.pts as Any), ("draft", _data.draft as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + case .dialogFolder(let _data): + return ("dialogFolder", [("flags", _data.flags as Any), ("folder", _data.folder as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("unreadMutedPeersCount", _data.unreadMutedPeersCount as Any), ("unreadUnmutedPeersCount", _data.unreadUnmutedPeersCount as Any), ("unreadMutedMessagesCount", _data.unreadMutedMessagesCount as Any), ("unreadUnmutedMessagesCount", _data.unreadUnmutedMessagesCount as Any)]) + } + } + public static func parse_dialog(_ reader: BufferReader) -> Dialog? { var _1: Int32? _1 = reader.readInt32() @@ -1170,15 +1577,23 @@ public extension Api { _9 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } var _10: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _10 = reader.readInt32() + } var _11: Api.DraftMessage? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.DraftMessage - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.DraftMessage + } + } var _12: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_12 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _12 = reader.readInt32() + } var _13: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_13 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _13 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1193,7 +1608,7 @@ public extension Api { let _c12 = (Int(_1!) & Int(1 << 4) == 0) || _12 != nil let _c13 = (Int(_1!) & Int(1 << 5) == 0) || _13 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - return Api.Dialog.dialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadMentionsCount: _7!, unreadReactionsCount: _8!, notifySettings: _9!, pts: _10, draft: _11, folderId: _12, ttlPeriod: _13) + return Api.Dialog.dialog(Cons_dialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadMentionsCount: _7!, unreadReactionsCount: _8!, notifySettings: _9!, pts: _10, draft: _11, folderId: _12, ttlPeriod: _13)) } else { return nil @@ -1229,88 +1644,132 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Dialog.dialogFolder(flags: _1!, folder: _2!, peer: _3!, topMessage: _4!, unreadMutedPeersCount: _5!, unreadUnmutedPeersCount: _6!, unreadMutedMessagesCount: _7!, unreadUnmutedMessagesCount: _8!) + return Api.Dialog.dialogFolder(Cons_dialogFolder(flags: _1!, folder: _2!, peer: _3!, topMessage: _4!, unreadMutedPeersCount: _5!, unreadUnmutedPeersCount: _6!, unreadMutedMessagesCount: _7!, unreadUnmutedMessagesCount: _8!)) } else { return nil } } - } } public extension Api { enum DialogFilter: TypeConstructorDescription { - case dialogFilter(flags: Int32, id: Int32, title: Api.TextWithEntities, emoticon: String?, color: Int32?, pinnedPeers: [Api.InputPeer], includePeers: [Api.InputPeer], excludePeers: [Api.InputPeer]) - case dialogFilterChatlist(flags: Int32, id: Int32, title: Api.TextWithEntities, emoticon: String?, color: Int32?, pinnedPeers: [Api.InputPeer], includePeers: [Api.InputPeer]) + public class Cons_dialogFilter { + public var flags: Int32 + public var id: Int32 + public var title: Api.TextWithEntities + public var emoticon: String? + public var color: Int32? + public var pinnedPeers: [Api.InputPeer] + public var includePeers: [Api.InputPeer] + public var excludePeers: [Api.InputPeer] + public init(flags: Int32, id: Int32, title: Api.TextWithEntities, emoticon: String?, color: Int32?, pinnedPeers: [Api.InputPeer], includePeers: [Api.InputPeer], excludePeers: [Api.InputPeer]) { + self.flags = flags + self.id = id + self.title = title + self.emoticon = emoticon + self.color = color + self.pinnedPeers = pinnedPeers + self.includePeers = includePeers + self.excludePeers = excludePeers + } + } + public class Cons_dialogFilterChatlist { + public var flags: Int32 + public var id: Int32 + public var title: Api.TextWithEntities + public var emoticon: String? + public var color: Int32? + public var pinnedPeers: [Api.InputPeer] + public var includePeers: [Api.InputPeer] + public init(flags: Int32, id: Int32, title: Api.TextWithEntities, emoticon: String?, color: Int32?, pinnedPeers: [Api.InputPeer], includePeers: [Api.InputPeer]) { + self.flags = flags + self.id = id + self.title = title + self.emoticon = emoticon + self.color = color + self.pinnedPeers = pinnedPeers + self.includePeers = includePeers + } + } + case dialogFilter(Cons_dialogFilter) + case dialogFilterChatlist(Cons_dialogFilterChatlist) case dialogFilterDefault - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialogFilter(let flags, let id, let title, let emoticon, let color, let pinnedPeers, let includePeers, let excludePeers): - if boxed { - buffer.appendInt32(-1438177711) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - title.serialize(buffer, true) - if Int(flags) & Int(1 << 25) != 0 {serializeString(emoticon!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 27) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(pinnedPeers.count)) - for item in pinnedPeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(includePeers.count)) - for item in includePeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(excludePeers.count)) - for item in excludePeers { - item.serialize(buffer, true) - } - break - case .dialogFilterChatlist(let flags, let id, let title, let emoticon, let color, let pinnedPeers, let includePeers): - if boxed { - buffer.appendInt32(-1772913705) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - title.serialize(buffer, true) - if Int(flags) & Int(1 << 25) != 0 {serializeString(emoticon!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 27) != 0 {serializeInt32(color!, buffer: buffer, boxed: false)} - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(pinnedPeers.count)) - for item in pinnedPeers { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(includePeers.count)) - for item in includePeers { - item.serialize(buffer, true) - } - break - case .dialogFilterDefault: - if boxed { - buffer.appendInt32(909284270) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialogFilter(let flags, let id, let title, let emoticon, let color, let pinnedPeers, let includePeers, let excludePeers): - return ("dialogFilter", [("flags", flags as Any), ("id", id as Any), ("title", title as Any), ("emoticon", emoticon as Any), ("color", color as Any), ("pinnedPeers", pinnedPeers as Any), ("includePeers", includePeers as Any), ("excludePeers", excludePeers as Any)]) - case .dialogFilterChatlist(let flags, let id, let title, let emoticon, let color, let pinnedPeers, let includePeers): - return ("dialogFilterChatlist", [("flags", flags as Any), ("id", id as Any), ("title", title as Any), ("emoticon", emoticon as Any), ("color", color as Any), ("pinnedPeers", pinnedPeers as Any), ("includePeers", includePeers as Any)]) - case .dialogFilterDefault: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialogFilter(let _data): + if boxed { + buffer.appendInt32(-1438177711) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 27) != 0 { + serializeInt32(_data.color!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.pinnedPeers.count)) + for item in _data.pinnedPeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.includePeers.count)) + for item in _data.includePeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.excludePeers.count)) + for item in _data.excludePeers { + item.serialize(buffer, true) + } + break + case .dialogFilterChatlist(let _data): + if boxed { + buffer.appendInt32(-1772913705) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + _data.title.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 27) != 0 { + serializeInt32(_data.color!, buffer: buffer, boxed: false) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.pinnedPeers.count)) + for item in _data.pinnedPeers { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.includePeers.count)) + for item in _data.includePeers { + item.serialize(buffer, true) + } + break + case .dialogFilterDefault: + if boxed { + buffer.appendInt32(909284270) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialogFilter(let _data): + return ("dialogFilter", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("color", _data.color as Any), ("pinnedPeers", _data.pinnedPeers as Any), ("includePeers", _data.includePeers as Any), ("excludePeers", _data.excludePeers as Any)]) + case .dialogFilterChatlist(let _data): + return ("dialogFilterChatlist", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("color", _data.color as Any), ("pinnedPeers", _data.pinnedPeers as Any), ("includePeers", _data.includePeers as Any)]) + case .dialogFilterDefault: return ("dialogFilterDefault", []) - } - } - + } + } + public static func parse_dialogFilter(_ reader: BufferReader) -> DialogFilter? { var _1: Int32? _1 = reader.readInt32() @@ -1321,9 +1780,13 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } var _4: String? - if Int(_1!) & Int(1 << 25) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 25) != 0 { + _4 = parseString(reader) + } var _5: Int32? - if Int(_1!) & Int(1 << 27) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 27) != 0 { + _5 = reader.readInt32() + } var _6: [Api.InputPeer]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) @@ -1345,7 +1808,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.DialogFilter.dialogFilter(flags: _1!, id: _2!, title: _3!, emoticon: _4, color: _5, pinnedPeers: _6!, includePeers: _7!, excludePeers: _8!) + return Api.DialogFilter.dialogFilter(Cons_dialogFilter(flags: _1!, id: _2!, title: _3!, emoticon: _4, color: _5, pinnedPeers: _6!, includePeers: _7!, excludePeers: _8!)) } else { return nil @@ -1361,9 +1824,13 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } var _4: String? - if Int(_1!) & Int(1 << 25) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 25) != 0 { + _4 = parseString(reader) + } var _5: Int32? - if Int(_1!) & Int(1 << 27) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 27) != 0 { + _5 = reader.readInt32() + } var _6: [Api.InputPeer]? if let _ = reader.readInt32() { _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) @@ -1380,7 +1847,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.DialogFilter.dialogFilterChatlist(flags: _1!, id: _2!, title: _3!, emoticon: _4, color: _5, pinnedPeers: _6!, includePeers: _7!) + return Api.DialogFilter.dialogFilterChatlist(Cons_dialogFilterChatlist(flags: _1!, id: _2!, title: _3!, emoticon: _4, color: _5, pinnedPeers: _6!, includePeers: _7!)) } else { return nil @@ -1389,32 +1856,39 @@ public extension Api { public static func parse_dialogFilterDefault(_ reader: BufferReader) -> DialogFilter? { return Api.DialogFilter.dialogFilterDefault } - } } public extension Api { enum DialogFilterSuggested: TypeConstructorDescription { - case dialogFilterSuggested(filter: Api.DialogFilter, description: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialogFilterSuggested(let filter, let description): - if boxed { - buffer.appendInt32(2004110666) - } - filter.serialize(buffer, true) - serializeString(description, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialogFilterSuggested(let filter, let description): - return ("dialogFilterSuggested", [("filter", filter as Any), ("description", description as Any)]) - } - } - + public class Cons_dialogFilterSuggested { + public var filter: Api.DialogFilter + public var description: String + public init(filter: Api.DialogFilter, description: String) { + self.filter = filter + self.description = description + } + } + case dialogFilterSuggested(Cons_dialogFilterSuggested) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialogFilterSuggested(let _data): + if boxed { + buffer.appendInt32(2004110666) + } + _data.filter.serialize(buffer, true) + serializeString(_data.description, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialogFilterSuggested(let _data): + return ("dialogFilterSuggested", [("filter", _data.filter as Any), ("description", _data.description as Any)]) + } + } + public static func parse_dialogFilterSuggested(_ reader: BufferReader) -> DialogFilterSuggested? { var _1: Api.DialogFilter? if let signature = reader.readInt32() { @@ -1425,46 +1899,57 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.DialogFilterSuggested.dialogFilterSuggested(filter: _1!, description: _2!) + return Api.DialogFilterSuggested.dialogFilterSuggested(Cons_dialogFilterSuggested(filter: _1!, description: _2!)) } else { return nil } } - } } public extension Api { enum DialogPeer: TypeConstructorDescription { - case dialogPeer(peer: Api.Peer) - case dialogPeerFolder(folderId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .dialogPeer(let peer): - if boxed { - buffer.appendInt32(-445792507) - } - peer.serialize(buffer, true) - break - case .dialogPeerFolder(let folderId): - if boxed { - buffer.appendInt32(1363483106) - } - serializeInt32(folderId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .dialogPeer(let peer): - return ("dialogPeer", [("peer", peer as Any)]) - case .dialogPeerFolder(let folderId): - return ("dialogPeerFolder", [("folderId", folderId as Any)]) - } - } - + public class Cons_dialogPeer { + public var peer: Api.Peer + public init(peer: Api.Peer) { + self.peer = peer + } + } + public class Cons_dialogPeerFolder { + public var folderId: Int32 + public init(folderId: Int32) { + self.folderId = folderId + } + } + case dialogPeer(Cons_dialogPeer) + case dialogPeerFolder(Cons_dialogPeerFolder) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .dialogPeer(let _data): + if boxed { + buffer.appendInt32(-445792507) + } + _data.peer.serialize(buffer, true) + break + case .dialogPeerFolder(let _data): + if boxed { + buffer.appendInt32(1363483106) + } + serializeInt32(_data.folderId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .dialogPeer(let _data): + return ("dialogPeer", [("peer", _data.peer as Any)]) + case .dialogPeerFolder(let _data): + return ("dialogPeerFolder", [("folderId", _data.folderId as Any)]) + } + } + public static func parse_dialogPeer(_ reader: BufferReader) -> DialogPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -1472,7 +1957,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.DialogPeer.dialogPeer(peer: _1!) + return Api.DialogPeer.dialogPeer(Cons_dialogPeer(peer: _1!)) } else { return nil @@ -1483,12 +1968,11 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.DialogPeer.dialogPeerFolder(folderId: _1!) + return Api.DialogPeer.dialogPeerFolder(Cons_dialogPeerFolder(folderId: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api6.swift b/submodules/TelegramApi/Sources/Api6.swift index ca7545a09a..3683abb335 100644 --- a/submodules/TelegramApi/Sources/Api6.swift +++ b/submodules/TelegramApi/Sources/Api6.swift @@ -1,92 +1,133 @@ public extension Api { enum DisallowedGiftsSettings: TypeConstructorDescription { - case disallowedGiftsSettings(flags: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .disallowedGiftsSettings(let flags): - if boxed { - buffer.appendInt32(1911715524) - } - serializeInt32(flags, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .disallowedGiftsSettings(let flags): - return ("disallowedGiftsSettings", [("flags", flags as Any)]) - } - } - + public class Cons_disallowedGiftsSettings { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + } + case disallowedGiftsSettings(Cons_disallowedGiftsSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .disallowedGiftsSettings(let _data): + if boxed { + buffer.appendInt32(1911715524) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .disallowedGiftsSettings(let _data): + return ("disallowedGiftsSettings", [("flags", _data.flags as Any)]) + } + } + public static func parse_disallowedGiftsSettings(_ reader: BufferReader) -> DisallowedGiftsSettings? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.DisallowedGiftsSettings.disallowedGiftsSettings(flags: _1!) + return Api.DisallowedGiftsSettings.disallowedGiftsSettings(Cons_disallowedGiftsSettings(flags: _1!)) } else { return nil } } - } } public extension Api { enum Document: TypeConstructorDescription { - case document(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, mimeType: String, size: Int64, thumbs: [Api.PhotoSize]?, videoThumbs: [Api.VideoSize]?, dcId: Int32, attributes: [Api.DocumentAttribute]) - case documentEmpty(id: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .document(let flags, let id, let accessHash, let fileReference, let date, let mimeType, let size, let thumbs, let videoThumbs, let dcId, let attributes): - if boxed { - buffer.appendInt32(-1881881384) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeString(mimeType, buffer: buffer, boxed: false) - serializeInt64(size, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(thumbs!.count)) - for item in thumbs! { - item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(videoThumbs!.count)) - for item in videoThumbs! { - item.serialize(buffer, true) - }} - serializeInt32(dcId, buffer: buffer, boxed: false) + public class Cons_document { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public var date: Int32 + public var mimeType: String + public var size: Int64 + public var thumbs: [Api.PhotoSize]? + public var videoThumbs: [Api.VideoSize]? + public var dcId: Int32 + public var attributes: [Api.DocumentAttribute] + public init(flags: Int32, id: Int64, accessHash: Int64, fileReference: Buffer, date: Int32, mimeType: String, size: Int64, thumbs: [Api.PhotoSize]?, videoThumbs: [Api.VideoSize]?, dcId: Int32, attributes: [Api.DocumentAttribute]) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + self.date = date + self.mimeType = mimeType + self.size = size + self.thumbs = thumbs + self.videoThumbs = videoThumbs + self.dcId = dcId + self.attributes = attributes + } + } + public class Cons_documentEmpty { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + } + case document(Cons_document) + case documentEmpty(Cons_documentEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .document(let _data): + if boxed { + buffer.appendInt32(-1881881384) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeString(_data.mimeType, buffer: buffer, boxed: false) + serializeInt64(_data.size, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(attributes.count)) - for item in attributes { + buffer.appendInt32(Int32(_data.thumbs!.count)) + for item in _data.thumbs! { item.serialize(buffer, true) } - break - case .documentEmpty(let id): - if boxed { - buffer.appendInt32(922273905) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.videoThumbs!.count)) + for item in _data.videoThumbs! { + item.serialize(buffer, true) } - serializeInt64(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .document(let flags, let id, let accessHash, let fileReference, let date, let mimeType, let size, let thumbs, let videoThumbs, let dcId, let attributes): - return ("document", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any), ("date", date as Any), ("mimeType", mimeType as Any), ("size", size as Any), ("thumbs", thumbs as Any), ("videoThumbs", videoThumbs as Any), ("dcId", dcId as Any), ("attributes", attributes as Any)]) - case .documentEmpty(let id): - return ("documentEmpty", [("id", id as Any)]) - } - } - + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.attributes.count)) + for item in _data.attributes { + item.serialize(buffer, true) + } + break + case .documentEmpty(let _data): + if boxed { + buffer.appendInt32(922273905) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .document(let _data): + return ("document", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("date", _data.date as Any), ("mimeType", _data.mimeType as Any), ("size", _data.size as Any), ("thumbs", _data.thumbs as Any), ("videoThumbs", _data.videoThumbs as Any), ("dcId", _data.dcId as Any), ("attributes", _data.attributes as Any)]) + case .documentEmpty(let _data): + return ("documentEmpty", [("id", _data.id as Any)]) + } + } + public static func parse_document(_ reader: BufferReader) -> Document? { var _1: Int32? _1 = reader.readInt32() @@ -103,13 +144,17 @@ public extension Api { var _7: Int64? _7 = reader.readInt64() var _8: [Api.PhotoSize]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + } + } var _9: [Api.VideoSize]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.VideoSize.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.VideoSize.self) + } + } var _10: Int32? _10 = reader.readInt32() var _11: [Api.DocumentAttribute]? @@ -128,7 +173,7 @@ public extension Api { let _c10 = _10 != nil let _c11 = _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.Document.document(flags: _1!, id: _2!, accessHash: _3!, fileReference: _4!, date: _5!, mimeType: _6!, size: _7!, thumbs: _8, videoThumbs: _9, dcId: _10!, attributes: _11!) + return Api.Document.document(Cons_document(flags: _1!, id: _2!, accessHash: _3!, fileReference: _4!, date: _5!, mimeType: _6!, size: _7!, thumbs: _8, videoThumbs: _9, dcId: _10!, attributes: _11!)) } else { return nil @@ -139,116 +184,195 @@ public extension Api { _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.Document.documentEmpty(id: _1!) + return Api.Document.documentEmpty(Cons_documentEmpty(id: _1!)) } else { return nil } } - } } public extension Api { enum DocumentAttribute: TypeConstructorDescription { + public class Cons_documentAttributeAudio { + public var flags: Int32 + public var duration: Int32 + public var title: String? + public var performer: String? + public var waveform: Buffer? + public init(flags: Int32, duration: Int32, title: String?, performer: String?, waveform: Buffer?) { + self.flags = flags + self.duration = duration + self.title = title + self.performer = performer + self.waveform = waveform + } + } + public class Cons_documentAttributeCustomEmoji { + public var flags: Int32 + public var alt: String + public var stickerset: Api.InputStickerSet + public init(flags: Int32, alt: String, stickerset: Api.InputStickerSet) { + self.flags = flags + self.alt = alt + self.stickerset = stickerset + } + } + public class Cons_documentAttributeFilename { + public var fileName: String + public init(fileName: String) { + self.fileName = fileName + } + } + public class Cons_documentAttributeImageSize { + public var w: Int32 + public var h: Int32 + public init(w: Int32, h: Int32) { + self.w = w + self.h = h + } + } + public class Cons_documentAttributeSticker { + public var flags: Int32 + public var alt: String + public var stickerset: Api.InputStickerSet + public var maskCoords: Api.MaskCoords? + public init(flags: Int32, alt: String, stickerset: Api.InputStickerSet, maskCoords: Api.MaskCoords?) { + self.flags = flags + self.alt = alt + self.stickerset = stickerset + self.maskCoords = maskCoords + } + } + public class Cons_documentAttributeVideo { + public var flags: Int32 + public var duration: Double + public var w: Int32 + public var h: Int32 + public var preloadPrefixSize: Int32? + public var videoStartTs: Double? + public var videoCodec: String? + public init(flags: Int32, duration: Double, w: Int32, h: Int32, preloadPrefixSize: Int32?, videoStartTs: Double?, videoCodec: String?) { + self.flags = flags + self.duration = duration + self.w = w + self.h = h + self.preloadPrefixSize = preloadPrefixSize + self.videoStartTs = videoStartTs + self.videoCodec = videoCodec + } + } case documentAttributeAnimated - case documentAttributeAudio(flags: Int32, duration: Int32, title: String?, performer: String?, waveform: Buffer?) - case documentAttributeCustomEmoji(flags: Int32, alt: String, stickerset: Api.InputStickerSet) - case documentAttributeFilename(fileName: String) + case documentAttributeAudio(Cons_documentAttributeAudio) + case documentAttributeCustomEmoji(Cons_documentAttributeCustomEmoji) + case documentAttributeFilename(Cons_documentAttributeFilename) case documentAttributeHasStickers - case documentAttributeImageSize(w: Int32, h: Int32) - case documentAttributeSticker(flags: Int32, alt: String, stickerset: Api.InputStickerSet, maskCoords: Api.MaskCoords?) - case documentAttributeVideo(flags: Int32, duration: Double, w: Int32, h: Int32, preloadPrefixSize: Int32?, videoStartTs: Double?, videoCodec: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .documentAttributeAnimated: - if boxed { - buffer.appendInt32(297109817) - } - - break - case .documentAttributeAudio(let flags, let duration, let title, let performer, let waveform): - if boxed { - buffer.appendInt32(-1739392570) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(duration, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(performer!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeBytes(waveform!, buffer: buffer, boxed: false)} - break - case .documentAttributeCustomEmoji(let flags, let alt, let stickerset): - if boxed { - buffer.appendInt32(-48981863) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(alt, buffer: buffer, boxed: false) - stickerset.serialize(buffer, true) - break - case .documentAttributeFilename(let fileName): - if boxed { - buffer.appendInt32(358154344) - } - serializeString(fileName, buffer: buffer, boxed: false) - break - case .documentAttributeHasStickers: - if boxed { - buffer.appendInt32(-1744710921) - } - - break - case .documentAttributeImageSize(let w, let h): - if boxed { - buffer.appendInt32(1815593308) - } - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - break - case .documentAttributeSticker(let flags, let alt, let stickerset, let maskCoords): - if boxed { - buffer.appendInt32(1662637586) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(alt, buffer: buffer, boxed: false) - stickerset.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {maskCoords!.serialize(buffer, true)} - break - case .documentAttributeVideo(let flags, let duration, let w, let h, let preloadPrefixSize, let videoStartTs, let videoCodec): - if boxed { - buffer.appendInt32(1137015880) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeDouble(duration, buffer: buffer, boxed: false) - serializeInt32(w, buffer: buffer, boxed: false) - serializeInt32(h, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(preloadPrefixSize!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeString(videoCodec!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .documentAttributeAnimated: + case documentAttributeImageSize(Cons_documentAttributeImageSize) + case documentAttributeSticker(Cons_documentAttributeSticker) + case documentAttributeVideo(Cons_documentAttributeVideo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .documentAttributeAnimated: + if boxed { + buffer.appendInt32(297109817) + } + break + case .documentAttributeAudio(let _data): + if boxed { + buffer.appendInt32(-1739392570) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.duration, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.performer!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeBytes(_data.waveform!, buffer: buffer, boxed: false) + } + break + case .documentAttributeCustomEmoji(let _data): + if boxed { + buffer.appendInt32(-48981863) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.alt, buffer: buffer, boxed: false) + _data.stickerset.serialize(buffer, true) + break + case .documentAttributeFilename(let _data): + if boxed { + buffer.appendInt32(358154344) + } + serializeString(_data.fileName, buffer: buffer, boxed: false) + break + case .documentAttributeHasStickers: + if boxed { + buffer.appendInt32(-1744710921) + } + break + case .documentAttributeImageSize(let _data): + if boxed { + buffer.appendInt32(1815593308) + } + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + break + case .documentAttributeSticker(let _data): + if boxed { + buffer.appendInt32(1662637586) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.alt, buffer: buffer, boxed: false) + _data.stickerset.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.maskCoords!.serialize(buffer, true) + } + break + case .documentAttributeVideo(let _data): + if boxed { + buffer.appendInt32(1137015880) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeDouble(_data.duration, buffer: buffer, boxed: false) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.preloadPrefixSize!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeDouble(_data.videoStartTs!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeString(_data.videoCodec!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .documentAttributeAnimated: return ("documentAttributeAnimated", []) - case .documentAttributeAudio(let flags, let duration, let title, let performer, let waveform): - return ("documentAttributeAudio", [("flags", flags as Any), ("duration", duration as Any), ("title", title as Any), ("performer", performer as Any), ("waveform", waveform as Any)]) - case .documentAttributeCustomEmoji(let flags, let alt, let stickerset): - return ("documentAttributeCustomEmoji", [("flags", flags as Any), ("alt", alt as Any), ("stickerset", stickerset as Any)]) - case .documentAttributeFilename(let fileName): - return ("documentAttributeFilename", [("fileName", fileName as Any)]) - case .documentAttributeHasStickers: + case .documentAttributeAudio(let _data): + return ("documentAttributeAudio", [("flags", _data.flags as Any), ("duration", _data.duration as Any), ("title", _data.title as Any), ("performer", _data.performer as Any), ("waveform", _data.waveform as Any)]) + case .documentAttributeCustomEmoji(let _data): + return ("documentAttributeCustomEmoji", [("flags", _data.flags as Any), ("alt", _data.alt as Any), ("stickerset", _data.stickerset as Any)]) + case .documentAttributeFilename(let _data): + return ("documentAttributeFilename", [("fileName", _data.fileName as Any)]) + case .documentAttributeHasStickers: return ("documentAttributeHasStickers", []) - case .documentAttributeImageSize(let w, let h): - return ("documentAttributeImageSize", [("w", w as Any), ("h", h as Any)]) - case .documentAttributeSticker(let flags, let alt, let stickerset, let maskCoords): - return ("documentAttributeSticker", [("flags", flags as Any), ("alt", alt as Any), ("stickerset", stickerset as Any), ("maskCoords", maskCoords as Any)]) - case .documentAttributeVideo(let flags, let duration, let w, let h, let preloadPrefixSize, let videoStartTs, let videoCodec): - return ("documentAttributeVideo", [("flags", flags as Any), ("duration", duration as Any), ("w", w as Any), ("h", h as Any), ("preloadPrefixSize", preloadPrefixSize as Any), ("videoStartTs", videoStartTs as Any), ("videoCodec", videoCodec as Any)]) - } - } - + case .documentAttributeImageSize(let _data): + return ("documentAttributeImageSize", [("w", _data.w as Any), ("h", _data.h as Any)]) + case .documentAttributeSticker(let _data): + return ("documentAttributeSticker", [("flags", _data.flags as Any), ("alt", _data.alt as Any), ("stickerset", _data.stickerset as Any), ("maskCoords", _data.maskCoords as Any)]) + case .documentAttributeVideo(let _data): + return ("documentAttributeVideo", [("flags", _data.flags as Any), ("duration", _data.duration as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("preloadPrefixSize", _data.preloadPrefixSize as Any), ("videoStartTs", _data.videoStartTs as Any), ("videoCodec", _data.videoCodec as Any)]) + } + } + public static func parse_documentAttributeAnimated(_ reader: BufferReader) -> DocumentAttribute? { return Api.DocumentAttribute.documentAttributeAnimated } @@ -258,18 +382,24 @@ public extension Api { var _2: Int32? _2 = reader.readInt32() var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: Buffer? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseBytes(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseBytes(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.DocumentAttribute.documentAttributeAudio(flags: _1!, duration: _2!, title: _3, performer: _4, waveform: _5) + return Api.DocumentAttribute.documentAttributeAudio(Cons_documentAttributeAudio(flags: _1!, duration: _2!, title: _3, performer: _4, waveform: _5)) } else { return nil @@ -288,7 +418,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.DocumentAttribute.documentAttributeCustomEmoji(flags: _1!, alt: _2!, stickerset: _3!) + return Api.DocumentAttribute.documentAttributeCustomEmoji(Cons_documentAttributeCustomEmoji(flags: _1!, alt: _2!, stickerset: _3!)) } else { return nil @@ -299,7 +429,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.DocumentAttribute.documentAttributeFilename(fileName: _1!) + return Api.DocumentAttribute.documentAttributeFilename(Cons_documentAttributeFilename(fileName: _1!)) } else { return nil @@ -316,7 +446,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.DocumentAttribute.documentAttributeImageSize(w: _1!, h: _2!) + return Api.DocumentAttribute.documentAttributeImageSize(Cons_documentAttributeImageSize(w: _1!, h: _2!)) } else { return nil @@ -332,15 +462,17 @@ public extension Api { _3 = Api.parse(reader, signature: signature) as? Api.InputStickerSet } var _4: Api.MaskCoords? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.DocumentAttribute.documentAttributeSticker(flags: _1!, alt: _2!, stickerset: _3!, maskCoords: _4) + return Api.DocumentAttribute.documentAttributeSticker(Cons_documentAttributeSticker(flags: _1!, alt: _2!, stickerset: _3!, maskCoords: _4)) } else { return nil @@ -356,11 +488,17 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } var _6: Double? - if Int(_1!) & Int(1 << 4) != 0 {_6 = reader.readDouble() } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = reader.readDouble() + } var _7: String? - if Int(_1!) & Int(1 << 5) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 5) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -369,83 +507,132 @@ public extension Api { let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil let _c7 = (Int(_1!) & Int(1 << 5) == 0) || _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.DocumentAttribute.documentAttributeVideo(flags: _1!, duration: _2!, w: _3!, h: _4!, preloadPrefixSize: _5, videoStartTs: _6, videoCodec: _7) + return Api.DocumentAttribute.documentAttributeVideo(Cons_documentAttributeVideo(flags: _1!, duration: _2!, w: _3!, h: _4!, preloadPrefixSize: _5, videoStartTs: _6, videoCodec: _7)) } else { return nil } } - } } public extension Api { indirect enum DraftMessage: TypeConstructorDescription { - case draftMessage(flags: Int32, replyTo: Api.InputReplyTo?, message: String, entities: [Api.MessageEntity]?, media: Api.InputMedia?, date: Int32, effect: Int64?, suggestedPost: Api.SuggestedPost?) - case draftMessageEmpty(flags: Int32, date: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .draftMessage(let flags, let replyTo, let message, let entities, let media, let date, let effect, let suggestedPost): - if boxed { - buffer.appendInt32(-1763006997) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {replyTo!.serialize(buffer, true)} - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_draftMessage { + public var flags: Int32 + public var replyTo: Api.InputReplyTo? + public var message: String + public var entities: [Api.MessageEntity]? + public var media: Api.InputMedia? + public var date: Int32 + public var effect: Int64? + public var suggestedPost: Api.SuggestedPost? + public init(flags: Int32, replyTo: Api.InputReplyTo?, message: String, entities: [Api.MessageEntity]?, media: Api.InputMedia?, date: Int32, effect: Int64?, suggestedPost: Api.SuggestedPost?) { + self.flags = flags + self.replyTo = replyTo + self.message = message + self.entities = entities + self.media = media + self.date = date + self.effect = effect + self.suggestedPost = suggestedPost + } + } + public class Cons_draftMessageEmpty { + public var flags: Int32 + public var date: Int32? + public init(flags: Int32, date: Int32?) { + self.flags = flags + self.date = date + } + } + case draftMessage(Cons_draftMessage) + case draftMessageEmpty(Cons_draftMessageEmpty) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .draftMessage(let _data): + if boxed { + buffer.appendInt32(-1763006997) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.replyTo!.serialize(buffer, true) + } + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 5) != 0 {media!.serialize(buffer, true)} - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {serializeInt64(effect!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {suggestedPost!.serialize(buffer, true)} - break - case .draftMessageEmpty(let flags, let date): - if boxed { - buffer.appendInt32(453805082) } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(date!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .draftMessage(let flags, let replyTo, let message, let entities, let media, let date, let effect, let suggestedPost): - return ("draftMessage", [("flags", flags as Any), ("replyTo", replyTo as Any), ("message", message as Any), ("entities", entities as Any), ("media", media as Any), ("date", date as Any), ("effect", effect as Any), ("suggestedPost", suggestedPost as Any)]) - case .draftMessageEmpty(let flags, let date): - return ("draftMessageEmpty", [("flags", flags as Any), ("date", date as Any)]) - } - } - + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.media!.serialize(buffer, true) + } + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt64(_data.effect!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + _data.suggestedPost!.serialize(buffer, true) + } + break + case .draftMessageEmpty(let _data): + if boxed { + buffer.appendInt32(453805082) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .draftMessage(let _data): + return ("draftMessage", [("flags", _data.flags as Any), ("replyTo", _data.replyTo as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("media", _data.media as Any), ("date", _data.date as Any), ("effect", _data.effect as Any), ("suggestedPost", _data.suggestedPost as Any)]) + case .draftMessageEmpty(let _data): + return ("draftMessageEmpty", [("flags", _data.flags as Any), ("date", _data.date as Any)]) + } + } + public static func parse_draftMessage(_ reader: BufferReader) -> DraftMessage? { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputReplyTo? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputReplyTo - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputReplyTo + } + } var _3: String? _3 = parseString(reader) var _4: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _5: Api.InputMedia? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.InputMedia - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.InputMedia + } + } var _6: Int32? _6 = reader.readInt32() var _7: Int64? - if Int(_1!) & Int(1 << 7) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 7) != 0 { + _7 = reader.readInt64() + } var _8: Api.SuggestedPost? - if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.SuggestedPost - } } + if Int(_1!) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.SuggestedPost + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil let _c3 = _3 != nil @@ -455,7 +642,7 @@ public extension Api { let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil let _c8 = (Int(_1!) & Int(1 << 8) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.DraftMessage.draftMessage(flags: _1!, replyTo: _2, message: _3!, entities: _4, media: _5, date: _6!, effect: _7, suggestedPost: _8) + return Api.DraftMessage.draftMessage(Cons_draftMessage(flags: _1!, replyTo: _2, message: _3!, entities: _4, media: _5, date: _6!, effect: _7, suggestedPost: _8)) } else { return nil @@ -465,65 +652,84 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.DraftMessage.draftMessageEmpty(flags: _1!, date: _2) + return Api.DraftMessage.draftMessageEmpty(Cons_draftMessageEmpty(flags: _1!, date: _2)) } else { return nil } } - } } public extension Api { enum EmailVerification: TypeConstructorDescription { - case emailVerificationApple(token: String) - case emailVerificationCode(code: String) - case emailVerificationGoogle(token: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emailVerificationApple(let token): - if boxed { - buffer.appendInt32(-1764723459) - } - serializeString(token, buffer: buffer, boxed: false) - break - case .emailVerificationCode(let code): - if boxed { - buffer.appendInt32(-1842457175) - } - serializeString(code, buffer: buffer, boxed: false) - break - case .emailVerificationGoogle(let token): - if boxed { - buffer.appendInt32(-611279166) - } - serializeString(token, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emailVerificationApple(let token): - return ("emailVerificationApple", [("token", token as Any)]) - case .emailVerificationCode(let code): - return ("emailVerificationCode", [("code", code as Any)]) - case .emailVerificationGoogle(let token): - return ("emailVerificationGoogle", [("token", token as Any)]) - } - } - + public class Cons_emailVerificationApple { + public var token: String + public init(token: String) { + self.token = token + } + } + public class Cons_emailVerificationCode { + public var code: String + public init(code: String) { + self.code = code + } + } + public class Cons_emailVerificationGoogle { + public var token: String + public init(token: String) { + self.token = token + } + } + case emailVerificationApple(Cons_emailVerificationApple) + case emailVerificationCode(Cons_emailVerificationCode) + case emailVerificationGoogle(Cons_emailVerificationGoogle) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emailVerificationApple(let _data): + if boxed { + buffer.appendInt32(-1764723459) + } + serializeString(_data.token, buffer: buffer, boxed: false) + break + case .emailVerificationCode(let _data): + if boxed { + buffer.appendInt32(-1842457175) + } + serializeString(_data.code, buffer: buffer, boxed: false) + break + case .emailVerificationGoogle(let _data): + if boxed { + buffer.appendInt32(-611279166) + } + serializeString(_data.token, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emailVerificationApple(let _data): + return ("emailVerificationApple", [("token", _data.token as Any)]) + case .emailVerificationCode(let _data): + return ("emailVerificationCode", [("code", _data.code as Any)]) + case .emailVerificationGoogle(let _data): + return ("emailVerificationGoogle", [("token", _data.token as Any)]) + } + } + public static func parse_emailVerificationApple(_ reader: BufferReader) -> EmailVerification? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.EmailVerification.emailVerificationApple(token: _1!) + return Api.EmailVerification.emailVerificationApple(Cons_emailVerificationApple(token: _1!)) } else { return nil @@ -534,7 +740,7 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.EmailVerification.emailVerificationCode(code: _1!) + return Api.EmailVerification.emailVerificationCode(Cons_emailVerificationCode(code: _1!)) } else { return nil @@ -545,56 +751,61 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.EmailVerification.emailVerificationGoogle(token: _1!) + return Api.EmailVerification.emailVerificationGoogle(Cons_emailVerificationGoogle(token: _1!)) } else { return nil } } - } } public extension Api { enum EmailVerifyPurpose: TypeConstructorDescription { + public class Cons_emailVerifyPurposeLoginSetup { + public var phoneNumber: String + public var phoneCodeHash: String + public init(phoneNumber: String, phoneCodeHash: String) { + self.phoneNumber = phoneNumber + self.phoneCodeHash = phoneCodeHash + } + } case emailVerifyPurposeLoginChange - case emailVerifyPurposeLoginSetup(phoneNumber: String, phoneCodeHash: String) + case emailVerifyPurposeLoginSetup(Cons_emailVerifyPurposeLoginSetup) case emailVerifyPurposePassport - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emailVerifyPurposeLoginChange: - if boxed { - buffer.appendInt32(1383932651) - } - - break - case .emailVerifyPurposeLoginSetup(let phoneNumber, let phoneCodeHash): - if boxed { - buffer.appendInt32(1128644211) - } - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(phoneCodeHash, buffer: buffer, boxed: false) - break - case .emailVerifyPurposePassport: - if boxed { - buffer.appendInt32(-1141565819) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emailVerifyPurposeLoginChange: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emailVerifyPurposeLoginChange: + if boxed { + buffer.appendInt32(1383932651) + } + break + case .emailVerifyPurposeLoginSetup(let _data): + if boxed { + buffer.appendInt32(1128644211) + } + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) + break + case .emailVerifyPurposePassport: + if boxed { + buffer.appendInt32(-1141565819) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emailVerifyPurposeLoginChange: return ("emailVerifyPurposeLoginChange", []) - case .emailVerifyPurposeLoginSetup(let phoneNumber, let phoneCodeHash): - return ("emailVerifyPurposeLoginSetup", [("phoneNumber", phoneNumber as Any), ("phoneCodeHash", phoneCodeHash as Any)]) - case .emailVerifyPurposePassport: + case .emailVerifyPurposeLoginSetup(let _data): + return ("emailVerifyPurposeLoginSetup", [("phoneNumber", _data.phoneNumber as Any), ("phoneCodeHash", _data.phoneCodeHash as Any)]) + case .emailVerifyPurposePassport: return ("emailVerifyPurposePassport", []) - } - } - + } + } + public static func parse_emailVerifyPurposeLoginChange(_ reader: BufferReader) -> EmailVerifyPurpose? { return Api.EmailVerifyPurpose.emailVerifyPurposeLoginChange } @@ -606,7 +817,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EmailVerifyPurpose.emailVerifyPurposeLoginSetup(phoneNumber: _1!, phoneCodeHash: _2!) + return Api.EmailVerifyPurpose.emailVerifyPurposeLoginSetup(Cons_emailVerifyPurposeLoginSetup(phoneNumber: _1!, phoneCodeHash: _2!)) } else { return nil @@ -615,62 +826,89 @@ public extension Api { public static func parse_emailVerifyPurposePassport(_ reader: BufferReader) -> EmailVerifyPurpose? { return Api.EmailVerifyPurpose.emailVerifyPurposePassport } - } } public extension Api { enum EmojiGroup: TypeConstructorDescription { - case emojiGroup(title: String, iconEmojiId: Int64, emoticons: [String]) - case emojiGroupGreeting(title: String, iconEmojiId: Int64, emoticons: [String]) - case emojiGroupPremium(title: String, iconEmojiId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiGroup(let title, let iconEmojiId, let emoticons): - if boxed { - buffer.appendInt32(2056961449) - } - serializeString(title, buffer: buffer, boxed: false) - serializeInt64(iconEmojiId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(emoticons.count)) - for item in emoticons { - serializeString(item, buffer: buffer, boxed: false) - } - break - case .emojiGroupGreeting(let title, let iconEmojiId, let emoticons): - if boxed { - buffer.appendInt32(-2133693241) - } - serializeString(title, buffer: buffer, boxed: false) - serializeInt64(iconEmojiId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(emoticons.count)) - for item in emoticons { - serializeString(item, buffer: buffer, boxed: false) - } - break - case .emojiGroupPremium(let title, let iconEmojiId): - if boxed { - buffer.appendInt32(154914612) - } - serializeString(title, buffer: buffer, boxed: false) - serializeInt64(iconEmojiId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiGroup(let title, let iconEmojiId, let emoticons): - return ("emojiGroup", [("title", title as Any), ("iconEmojiId", iconEmojiId as Any), ("emoticons", emoticons as Any)]) - case .emojiGroupGreeting(let title, let iconEmojiId, let emoticons): - return ("emojiGroupGreeting", [("title", title as Any), ("iconEmojiId", iconEmojiId as Any), ("emoticons", emoticons as Any)]) - case .emojiGroupPremium(let title, let iconEmojiId): - return ("emojiGroupPremium", [("title", title as Any), ("iconEmojiId", iconEmojiId as Any)]) - } - } - + public class Cons_emojiGroup { + public var title: String + public var iconEmojiId: Int64 + public var emoticons: [String] + public init(title: String, iconEmojiId: Int64, emoticons: [String]) { + self.title = title + self.iconEmojiId = iconEmojiId + self.emoticons = emoticons + } + } + public class Cons_emojiGroupGreeting { + public var title: String + public var iconEmojiId: Int64 + public var emoticons: [String] + public init(title: String, iconEmojiId: Int64, emoticons: [String]) { + self.title = title + self.iconEmojiId = iconEmojiId + self.emoticons = emoticons + } + } + public class Cons_emojiGroupPremium { + public var title: String + public var iconEmojiId: Int64 + public init(title: String, iconEmojiId: Int64) { + self.title = title + self.iconEmojiId = iconEmojiId + } + } + case emojiGroup(Cons_emojiGroup) + case emojiGroupGreeting(Cons_emojiGroupGreeting) + case emojiGroupPremium(Cons_emojiGroupPremium) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiGroup(let _data): + if boxed { + buffer.appendInt32(2056961449) + } + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt64(_data.iconEmojiId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.emoticons.count)) + for item in _data.emoticons { + serializeString(item, buffer: buffer, boxed: false) + } + break + case .emojiGroupGreeting(let _data): + if boxed { + buffer.appendInt32(-2133693241) + } + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt64(_data.iconEmojiId, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.emoticons.count)) + for item in _data.emoticons { + serializeString(item, buffer: buffer, boxed: false) + } + break + case .emojiGroupPremium(let _data): + if boxed { + buffer.appendInt32(154914612) + } + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt64(_data.iconEmojiId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiGroup(let _data): + return ("emojiGroup", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("emoticons", _data.emoticons as Any)]) + case .emojiGroupGreeting(let _data): + return ("emojiGroupGreeting", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("emoticons", _data.emoticons as Any)]) + case .emojiGroupPremium(let _data): + return ("emojiGroupPremium", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any)]) + } + } + public static func parse_emojiGroup(_ reader: BufferReader) -> EmojiGroup? { var _1: String? _1 = parseString(reader) @@ -684,7 +922,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.EmojiGroup.emojiGroup(title: _1!, iconEmojiId: _2!, emoticons: _3!) + return Api.EmojiGroup.emojiGroup(Cons_emojiGroup(title: _1!, iconEmojiId: _2!, emoticons: _3!)) } else { return nil @@ -703,7 +941,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.EmojiGroup.emojiGroupGreeting(title: _1!, iconEmojiId: _2!, emoticons: _3!) + return Api.EmojiGroup.emojiGroupGreeting(Cons_emojiGroupGreeting(title: _1!, iconEmojiId: _2!, emoticons: _3!)) } else { return nil @@ -717,56 +955,71 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EmojiGroup.emojiGroupPremium(title: _1!, iconEmojiId: _2!) + return Api.EmojiGroup.emojiGroupPremium(Cons_emojiGroupPremium(title: _1!, iconEmojiId: _2!)) } else { return nil } } - } } public extension Api { enum EmojiKeyword: TypeConstructorDescription { - case emojiKeyword(keyword: String, emoticons: [String]) - case emojiKeywordDeleted(keyword: String, emoticons: [String]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiKeyword(let keyword, let emoticons): - if boxed { - buffer.appendInt32(-709641735) - } - serializeString(keyword, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(emoticons.count)) - for item in emoticons { - serializeString(item, buffer: buffer, boxed: false) - } - break - case .emojiKeywordDeleted(let keyword, let emoticons): - if boxed { - buffer.appendInt32(594408994) - } - serializeString(keyword, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(emoticons.count)) - for item in emoticons { - serializeString(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiKeyword(let keyword, let emoticons): - return ("emojiKeyword", [("keyword", keyword as Any), ("emoticons", emoticons as Any)]) - case .emojiKeywordDeleted(let keyword, let emoticons): - return ("emojiKeywordDeleted", [("keyword", keyword as Any), ("emoticons", emoticons as Any)]) - } - } - + public class Cons_emojiKeyword { + public var keyword: String + public var emoticons: [String] + public init(keyword: String, emoticons: [String]) { + self.keyword = keyword + self.emoticons = emoticons + } + } + public class Cons_emojiKeywordDeleted { + public var keyword: String + public var emoticons: [String] + public init(keyword: String, emoticons: [String]) { + self.keyword = keyword + self.emoticons = emoticons + } + } + case emojiKeyword(Cons_emojiKeyword) + case emojiKeywordDeleted(Cons_emojiKeywordDeleted) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiKeyword(let _data): + if boxed { + buffer.appendInt32(-709641735) + } + serializeString(_data.keyword, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.emoticons.count)) + for item in _data.emoticons { + serializeString(item, buffer: buffer, boxed: false) + } + break + case .emojiKeywordDeleted(let _data): + if boxed { + buffer.appendInt32(594408994) + } + serializeString(_data.keyword, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.emoticons.count)) + for item in _data.emoticons { + serializeString(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiKeyword(let _data): + return ("emojiKeyword", [("keyword", _data.keyword as Any), ("emoticons", _data.emoticons as Any)]) + case .emojiKeywordDeleted(let _data): + return ("emojiKeywordDeleted", [("keyword", _data.keyword as Any), ("emoticons", _data.emoticons as Any)]) + } + } + public static func parse_emojiKeyword(_ reader: BufferReader) -> EmojiKeyword? { var _1: String? _1 = parseString(reader) @@ -777,7 +1030,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EmojiKeyword.emojiKeyword(keyword: _1!, emoticons: _2!) + return Api.EmojiKeyword.emojiKeyword(Cons_emojiKeyword(keyword: _1!, emoticons: _2!)) } else { return nil @@ -793,44 +1046,55 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EmojiKeyword.emojiKeywordDeleted(keyword: _1!, emoticons: _2!) + return Api.EmojiKeyword.emojiKeywordDeleted(Cons_emojiKeywordDeleted(keyword: _1!, emoticons: _2!)) } else { return nil } } - } } public extension Api { enum EmojiKeywordsDifference: TypeConstructorDescription { - case emojiKeywordsDifference(langCode: String, fromVersion: Int32, version: Int32, keywords: [Api.EmojiKeyword]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiKeywordsDifference(let langCode, let fromVersion, let version, let keywords): - if boxed { - buffer.appendInt32(1556570557) - } - serializeString(langCode, buffer: buffer, boxed: false) - serializeInt32(fromVersion, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(keywords.count)) - for item in keywords { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiKeywordsDifference(let langCode, let fromVersion, let version, let keywords): - return ("emojiKeywordsDifference", [("langCode", langCode as Any), ("fromVersion", fromVersion as Any), ("version", version as Any), ("keywords", keywords as Any)]) - } - } - + public class Cons_emojiKeywordsDifference { + public var langCode: String + public var fromVersion: Int32 + public var version: Int32 + public var keywords: [Api.EmojiKeyword] + public init(langCode: String, fromVersion: Int32, version: Int32, keywords: [Api.EmojiKeyword]) { + self.langCode = langCode + self.fromVersion = fromVersion + self.version = version + self.keywords = keywords + } + } + case emojiKeywordsDifference(Cons_emojiKeywordsDifference) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiKeywordsDifference(let _data): + if boxed { + buffer.appendInt32(1556570557) + } + serializeString(_data.langCode, buffer: buffer, boxed: false) + serializeInt32(_data.fromVersion, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.keywords.count)) + for item in _data.keywords { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiKeywordsDifference(let _data): + return ("emojiKeywordsDifference", [("langCode", _data.langCode as Any), ("fromVersion", _data.fromVersion as Any), ("version", _data.version as Any), ("keywords", _data.keywords as Any)]) + } + } + public static func parse_emojiKeywordsDifference(_ reader: BufferReader) -> EmojiKeywordsDifference? { var _1: String? _1 = parseString(reader) @@ -847,87 +1111,98 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.EmojiKeywordsDifference.emojiKeywordsDifference(langCode: _1!, fromVersion: _2!, version: _3!, keywords: _4!) + return Api.EmojiKeywordsDifference.emojiKeywordsDifference(Cons_emojiKeywordsDifference(langCode: _1!, fromVersion: _2!, version: _3!, keywords: _4!)) } else { return nil } } - } } public extension Api { enum EmojiLanguage: TypeConstructorDescription { - case emojiLanguage(langCode: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiLanguage(let langCode): - if boxed { - buffer.appendInt32(-1275374751) - } - serializeString(langCode, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiLanguage(let langCode): - return ("emojiLanguage", [("langCode", langCode as Any)]) - } - } - + public class Cons_emojiLanguage { + public var langCode: String + public init(langCode: String) { + self.langCode = langCode + } + } + case emojiLanguage(Cons_emojiLanguage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiLanguage(let _data): + if boxed { + buffer.appendInt32(-1275374751) + } + serializeString(_data.langCode, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiLanguage(let _data): + return ("emojiLanguage", [("langCode", _data.langCode as Any)]) + } + } + public static func parse_emojiLanguage(_ reader: BufferReader) -> EmojiLanguage? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.EmojiLanguage.emojiLanguage(langCode: _1!) + return Api.EmojiLanguage.emojiLanguage(Cons_emojiLanguage(langCode: _1!)) } else { return nil } } - } } public extension Api { enum EmojiList: TypeConstructorDescription { - case emojiList(hash: Int64, documentId: [Int64]) + public class Cons_emojiList { + public var hash: Int64 + public var documentId: [Int64] + public init(hash: Int64, documentId: [Int64]) { + self.hash = hash + self.documentId = documentId + } + } + case emojiList(Cons_emojiList) case emojiListNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiList(let hash, let documentId): - if boxed { - buffer.appendInt32(2048790993) - } - serializeInt64(hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(documentId.count)) - for item in documentId { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - case .emojiListNotModified: - if boxed { - buffer.appendInt32(1209970170) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiList(let hash, let documentId): - return ("emojiList", [("hash", hash as Any), ("documentId", documentId as Any)]) - case .emojiListNotModified: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiList(let _data): + if boxed { + buffer.appendInt32(2048790993) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.documentId.count)) + for item in _data.documentId { + serializeInt64(item, buffer: buffer, boxed: false) + } + break + case .emojiListNotModified: + if boxed { + buffer.appendInt32(1209970170) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiList(let _data): + return ("emojiList", [("hash", _data.hash as Any), ("documentId", _data.documentId as Any)]) + case .emojiListNotModified: return ("emojiListNotModified", []) - } - } - + } + } + public static func parse_emojiList(_ reader: BufferReader) -> EmojiList? { var _1: Int64? _1 = reader.readInt64() @@ -938,7 +1213,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EmojiList.emojiList(hash: _1!, documentId: _2!) + return Api.EmojiList.emojiList(Cons_emojiList(hash: _1!, documentId: _2!)) } else { return nil @@ -947,84 +1222,136 @@ public extension Api { public static func parse_emojiListNotModified(_ reader: BufferReader) -> EmojiList? { return Api.EmojiList.emojiListNotModified } - } } public extension Api { enum EmojiStatus: TypeConstructorDescription { - case emojiStatus(flags: Int32, documentId: Int64, until: Int32?) - case emojiStatusCollectible(flags: Int32, collectibleId: Int64, documentId: Int64, title: String, slug: String, patternDocumentId: Int64, centerColor: Int32, edgeColor: Int32, patternColor: Int32, textColor: Int32, until: Int32?) + public class Cons_emojiStatus { + public var flags: Int32 + public var documentId: Int64 + public var until: Int32? + public init(flags: Int32, documentId: Int64, until: Int32?) { + self.flags = flags + self.documentId = documentId + self.until = until + } + } + public class Cons_emojiStatusCollectible { + public var flags: Int32 + public var collectibleId: Int64 + public var documentId: Int64 + public var title: String + public var slug: String + public var patternDocumentId: Int64 + public var centerColor: Int32 + public var edgeColor: Int32 + public var patternColor: Int32 + public var textColor: Int32 + public var until: Int32? + public init(flags: Int32, collectibleId: Int64, documentId: Int64, title: String, slug: String, patternDocumentId: Int64, centerColor: Int32, edgeColor: Int32, patternColor: Int32, textColor: Int32, until: Int32?) { + self.flags = flags + self.collectibleId = collectibleId + self.documentId = documentId + self.title = title + self.slug = slug + self.patternDocumentId = patternDocumentId + self.centerColor = centerColor + self.edgeColor = edgeColor + self.patternColor = patternColor + self.textColor = textColor + self.until = until + } + } + public class Cons_inputEmojiStatusCollectible { + public var flags: Int32 + public var collectibleId: Int64 + public var until: Int32? + public init(flags: Int32, collectibleId: Int64, until: Int32?) { + self.flags = flags + self.collectibleId = collectibleId + self.until = until + } + } + case emojiStatus(Cons_emojiStatus) + case emojiStatusCollectible(Cons_emojiStatusCollectible) case emojiStatusEmpty - case inputEmojiStatusCollectible(flags: Int32, collectibleId: Int64, until: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiStatus(let flags, let documentId, let until): - if boxed { - buffer.appendInt32(-402717046) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(documentId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(until!, buffer: buffer, boxed: false)} - break - case .emojiStatusCollectible(let flags, let collectibleId, let documentId, let title, let slug, let patternDocumentId, let centerColor, let edgeColor, let patternColor, let textColor, let until): - if boxed { - buffer.appendInt32(1904500795) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(collectibleId, buffer: buffer, boxed: false) - serializeInt64(documentId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(slug, buffer: buffer, boxed: false) - serializeInt64(patternDocumentId, buffer: buffer, boxed: false) - serializeInt32(centerColor, buffer: buffer, boxed: false) - serializeInt32(edgeColor, buffer: buffer, boxed: false) - serializeInt32(patternColor, buffer: buffer, boxed: false) - serializeInt32(textColor, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(until!, buffer: buffer, boxed: false)} - break - case .emojiStatusEmpty: - if boxed { - buffer.appendInt32(769727150) - } - - break - case .inputEmojiStatusCollectible(let flags, let collectibleId, let until): - if boxed { - buffer.appendInt32(118758847) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(collectibleId, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(until!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiStatus(let flags, let documentId, let until): - return ("emojiStatus", [("flags", flags as Any), ("documentId", documentId as Any), ("until", until as Any)]) - case .emojiStatusCollectible(let flags, let collectibleId, let documentId, let title, let slug, let patternDocumentId, let centerColor, let edgeColor, let patternColor, let textColor, let until): - return ("emojiStatusCollectible", [("flags", flags as Any), ("collectibleId", collectibleId as Any), ("documentId", documentId as Any), ("title", title as Any), ("slug", slug as Any), ("patternDocumentId", patternDocumentId as Any), ("centerColor", centerColor as Any), ("edgeColor", edgeColor as Any), ("patternColor", patternColor as Any), ("textColor", textColor as Any), ("until", until as Any)]) - case .emojiStatusEmpty: + case inputEmojiStatusCollectible(Cons_inputEmojiStatusCollectible) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiStatus(let _data): + if boxed { + buffer.appendInt32(-402717046) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.until!, buffer: buffer, boxed: false) + } + break + case .emojiStatusCollectible(let _data): + if boxed { + buffer.appendInt32(1904500795) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.collectibleId, buffer: buffer, boxed: false) + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + serializeInt64(_data.patternDocumentId, buffer: buffer, boxed: false) + serializeInt32(_data.centerColor, buffer: buffer, boxed: false) + serializeInt32(_data.edgeColor, buffer: buffer, boxed: false) + serializeInt32(_data.patternColor, buffer: buffer, boxed: false) + serializeInt32(_data.textColor, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.until!, buffer: buffer, boxed: false) + } + break + case .emojiStatusEmpty: + if boxed { + buffer.appendInt32(769727150) + } + break + case .inputEmojiStatusCollectible(let _data): + if boxed { + buffer.appendInt32(118758847) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.collectibleId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.until!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiStatus(let _data): + return ("emojiStatus", [("flags", _data.flags as Any), ("documentId", _data.documentId as Any), ("until", _data.until as Any)]) + case .emojiStatusCollectible(let _data): + return ("emojiStatusCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("documentId", _data.documentId as Any), ("title", _data.title as Any), ("slug", _data.slug as Any), ("patternDocumentId", _data.patternDocumentId as Any), ("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("patternColor", _data.patternColor as Any), ("textColor", _data.textColor as Any), ("until", _data.until as Any)]) + case .emojiStatusEmpty: return ("emojiStatusEmpty", []) - case .inputEmojiStatusCollectible(let flags, let collectibleId, let until): - return ("inputEmojiStatusCollectible", [("flags", flags as Any), ("collectibleId", collectibleId as Any), ("until", until as Any)]) - } - } - + case .inputEmojiStatusCollectible(let _data): + return ("inputEmojiStatusCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("until", _data.until as Any)]) + } + } + public static func parse_emojiStatus(_ reader: BufferReader) -> EmojiStatus? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.EmojiStatus.emojiStatus(flags: _1!, documentId: _2!, until: _3) + return Api.EmojiStatus.emojiStatus(Cons_emojiStatus(flags: _1!, documentId: _2!, until: _3)) } else { return nil @@ -1052,7 +1379,9 @@ public extension Api { var _10: Int32? _10 = reader.readInt32() var _11: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_11 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _11 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1065,7 +1394,7 @@ public extension Api { let _c10 = _10 != nil let _c11 = (Int(_1!) & Int(1 << 0) == 0) || _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.EmojiStatus.emojiStatusCollectible(flags: _1!, collectibleId: _2!, documentId: _3!, title: _4!, slug: _5!, patternDocumentId: _6!, centerColor: _7!, edgeColor: _8!, patternColor: _9!, textColor: _10!, until: _11) + return Api.EmojiStatus.emojiStatusCollectible(Cons_emojiStatusCollectible(flags: _1!, collectibleId: _2!, documentId: _3!, title: _4!, slug: _5!, patternDocumentId: _6!, centerColor: _7!, edgeColor: _8!, patternColor: _9!, textColor: _10!, until: _11)) } else { return nil @@ -1080,17 +1409,18 @@ public extension Api { var _2: Int64? _2 = reader.readInt64() var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.EmojiStatus.inputEmojiStatusCollectible(flags: _1!, collectibleId: _2!, until: _3) + return Api.EmojiStatus.inputEmojiStatusCollectible(Cons_inputEmojiStatusCollectible(flags: _1!, collectibleId: _2!, until: _3)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api7.swift b/submodules/TelegramApi/Sources/Api7.swift index 1ad2e7de78..aaa09d3509 100644 --- a/submodules/TelegramApi/Sources/Api7.swift +++ b/submodules/TelegramApi/Sources/Api7.swift @@ -1,115 +1,188 @@ public extension Api { enum EmojiURL: TypeConstructorDescription { - case emojiURL(url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .emojiURL(let url): - if boxed { - buffer.appendInt32(-1519029347) - } - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .emojiURL(let url): - return ("emojiURL", [("url", url as Any)]) - } - } - + public class Cons_emojiURL { + public var url: String + public init(url: String) { + self.url = url + } + } + case emojiURL(Cons_emojiURL) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .emojiURL(let _data): + if boxed { + buffer.appendInt32(-1519029347) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .emojiURL(let _data): + return ("emojiURL", [("url", _data.url as Any)]) + } + } + public static func parse_emojiURL(_ reader: BufferReader) -> EmojiURL? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.EmojiURL.emojiURL(url: _1!) + return Api.EmojiURL.emojiURL(Cons_emojiURL(url: _1!)) } else { return nil } } - } } public extension Api { enum EncryptedChat: TypeConstructorDescription { - case encryptedChat(id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64) - case encryptedChatDiscarded(flags: Int32, id: Int32) - case encryptedChatEmpty(id: Int32) - case encryptedChatRequested(flags: Int32, folderId: Int32?, id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gA: Buffer) - case encryptedChatWaiting(id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .encryptedChat(let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint): - if boxed { - buffer.appendInt32(1643173063) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - serializeBytes(gAOrB, buffer: buffer, boxed: false) - serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - break - case .encryptedChatDiscarded(let flags, let id): - if boxed { - buffer.appendInt32(505183301) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - break - case .encryptedChatEmpty(let id): - if boxed { - buffer.appendInt32(-1417756512) - } - serializeInt32(id, buffer: buffer, boxed: false) - break - case .encryptedChatRequested(let flags, let folderId, let id, let accessHash, let date, let adminId, let participantId, let gA): - if boxed { - buffer.appendInt32(1223809356) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(folderId!, buffer: buffer, boxed: false)} - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - serializeBytes(gA, buffer: buffer, boxed: false) - break - case .encryptedChatWaiting(let id, let accessHash, let date, let adminId, let participantId): - if boxed { - buffer.appendInt32(1722964307) - } - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt64(participantId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .encryptedChat(let id, let accessHash, let date, let adminId, let participantId, let gAOrB, let keyFingerprint): - return ("encryptedChat", [("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gAOrB", gAOrB as Any), ("keyFingerprint", keyFingerprint as Any)]) - case .encryptedChatDiscarded(let flags, let id): - return ("encryptedChatDiscarded", [("flags", flags as Any), ("id", id as Any)]) - case .encryptedChatEmpty(let id): - return ("encryptedChatEmpty", [("id", id as Any)]) - case .encryptedChatRequested(let flags, let folderId, let id, let accessHash, let date, let adminId, let participantId, let gA): - return ("encryptedChatRequested", [("flags", flags as Any), ("folderId", folderId as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any), ("gA", gA as Any)]) - case .encryptedChatWaiting(let id, let accessHash, let date, let adminId, let participantId): - return ("encryptedChatWaiting", [("id", id as Any), ("accessHash", accessHash as Any), ("date", date as Any), ("adminId", adminId as Any), ("participantId", participantId as Any)]) - } - } - + public class Cons_encryptedChat { + public var id: Int32 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var gAOrB: Buffer + public var keyFingerprint: Int64 + public init(id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64) { + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.gAOrB = gAOrB + self.keyFingerprint = keyFingerprint + } + } + public class Cons_encryptedChatDiscarded { + public var flags: Int32 + public var id: Int32 + public init(flags: Int32, id: Int32) { + self.flags = flags + self.id = id + } + } + public class Cons_encryptedChatEmpty { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + } + public class Cons_encryptedChatRequested { + public var flags: Int32 + public var folderId: Int32? + public var id: Int32 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public var gA: Buffer + public init(flags: Int32, folderId: Int32?, id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gA: Buffer) { + self.flags = flags + self.folderId = folderId + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + self.gA = gA + } + } + public class Cons_encryptedChatWaiting { + public var id: Int32 + public var accessHash: Int64 + public var date: Int32 + public var adminId: Int64 + public var participantId: Int64 + public init(id: Int32, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64) { + self.id = id + self.accessHash = accessHash + self.date = date + self.adminId = adminId + self.participantId = participantId + } + } + case encryptedChat(Cons_encryptedChat) + case encryptedChatDiscarded(Cons_encryptedChatDiscarded) + case encryptedChatEmpty(Cons_encryptedChatEmpty) + case encryptedChatRequested(Cons_encryptedChatRequested) + case encryptedChatWaiting(Cons_encryptedChatWaiting) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .encryptedChat(let _data): + if boxed { + buffer.appendInt32(1643173063) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + serializeBytes(_data.gAOrB, buffer: buffer, boxed: false) + serializeInt64(_data.keyFingerprint, buffer: buffer, boxed: false) + break + case .encryptedChatDiscarded(let _data): + if boxed { + buffer.appendInt32(505183301) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + case .encryptedChatEmpty(let _data): + if boxed { + buffer.appendInt32(-1417756512) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + case .encryptedChatRequested(let _data): + if boxed { + buffer.appendInt32(1223809356) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.folderId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + serializeBytes(_data.gA, buffer: buffer, boxed: false) + break + case .encryptedChatWaiting(let _data): + if boxed { + buffer.appendInt32(1722964307) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt64(_data.participantId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .encryptedChat(let _data): + return ("encryptedChat", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAOrB", _data.gAOrB as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + case .encryptedChatDiscarded(let _data): + return ("encryptedChatDiscarded", [("flags", _data.flags as Any), ("id", _data.id as Any)]) + case .encryptedChatEmpty(let _data): + return ("encryptedChatEmpty", [("id", _data.id as Any)]) + case .encryptedChatRequested(let _data): + return ("encryptedChatRequested", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gA", _data.gA as Any)]) + case .encryptedChatWaiting(let _data): + return ("encryptedChatWaiting", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any)]) + } + } + public static func parse_encryptedChat(_ reader: BufferReader) -> EncryptedChat? { var _1: Int32? _1 = reader.readInt32() @@ -133,7 +206,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.EncryptedChat.encryptedChat(id: _1!, accessHash: _2!, date: _3!, adminId: _4!, participantId: _5!, gAOrB: _6!, keyFingerprint: _7!) + return Api.EncryptedChat.encryptedChat(Cons_encryptedChat(id: _1!, accessHash: _2!, date: _3!, adminId: _4!, participantId: _5!, gAOrB: _6!, keyFingerprint: _7!)) } else { return nil @@ -147,7 +220,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.EncryptedChat.encryptedChatDiscarded(flags: _1!, id: _2!) + return Api.EncryptedChat.encryptedChatDiscarded(Cons_encryptedChatDiscarded(flags: _1!, id: _2!)) } else { return nil @@ -158,7 +231,7 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.EncryptedChat.encryptedChatEmpty(id: _1!) + return Api.EncryptedChat.encryptedChatEmpty(Cons_encryptedChatEmpty(id: _1!)) } else { return nil @@ -168,7 +241,9 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } var _3: Int32? _3 = reader.readInt32() var _4: Int64? @@ -190,7 +265,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.EncryptedChat.encryptedChatRequested(flags: _1!, folderId: _2, id: _3!, accessHash: _4!, date: _5!, adminId: _6!, participantId: _7!, gA: _8!) + return Api.EncryptedChat.encryptedChatRequested(Cons_encryptedChatRequested(flags: _1!, folderId: _2, id: _3!, accessHash: _4!, date: _5!, adminId: _6!, participantId: _7!, gA: _8!)) } else { return nil @@ -213,50 +288,62 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.EncryptedChat.encryptedChatWaiting(id: _1!, accessHash: _2!, date: _3!, adminId: _4!, participantId: _5!) + return Api.EncryptedChat.encryptedChatWaiting(Cons_encryptedChatWaiting(id: _1!, accessHash: _2!, date: _3!, adminId: _4!, participantId: _5!)) } else { return nil } } - } } public extension Api { enum EncryptedFile: TypeConstructorDescription { - case encryptedFile(id: Int64, accessHash: Int64, size: Int64, dcId: Int32, keyFingerprint: Int32) + public class Cons_encryptedFile { + public var id: Int64 + public var accessHash: Int64 + public var size: Int64 + public var dcId: Int32 + public var keyFingerprint: Int32 + public init(id: Int64, accessHash: Int64, size: Int64, dcId: Int32, keyFingerprint: Int32) { + self.id = id + self.accessHash = accessHash + self.size = size + self.dcId = dcId + self.keyFingerprint = keyFingerprint + } + } + case encryptedFile(Cons_encryptedFile) case encryptedFileEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .encryptedFile(let id, let accessHash, let size, let dcId, let keyFingerprint): - if boxed { - buffer.appendInt32(-1476358952) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt64(size, buffer: buffer, boxed: false) - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt32(keyFingerprint, buffer: buffer, boxed: false) - break - case .encryptedFileEmpty: - if boxed { - buffer.appendInt32(-1038136962) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .encryptedFile(let id, let accessHash, let size, let dcId, let keyFingerprint): - return ("encryptedFile", [("id", id as Any), ("accessHash", accessHash as Any), ("size", size as Any), ("dcId", dcId as Any), ("keyFingerprint", keyFingerprint as Any)]) - case .encryptedFileEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .encryptedFile(let _data): + if boxed { + buffer.appendInt32(-1476358952) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt64(_data.size, buffer: buffer, boxed: false) + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeInt32(_data.keyFingerprint, buffer: buffer, boxed: false) + break + case .encryptedFileEmpty: + if boxed { + buffer.appendInt32(-1038136962) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .encryptedFile(let _data): + return ("encryptedFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("dcId", _data.dcId as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + case .encryptedFileEmpty: return ("encryptedFileEmpty", []) - } - } - + } + } + public static func parse_encryptedFile(_ reader: BufferReader) -> EncryptedFile? { var _1: Int64? _1 = reader.readInt64() @@ -274,7 +361,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.EncryptedFile.encryptedFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, keyFingerprint: _5!) + return Api.EncryptedFile.encryptedFile(Cons_encryptedFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, keyFingerprint: _5!)) } else { return nil @@ -283,47 +370,72 @@ public extension Api { public static func parse_encryptedFileEmpty(_ reader: BufferReader) -> EncryptedFile? { return Api.EncryptedFile.encryptedFileEmpty } - } } public extension Api { enum EncryptedMessage: TypeConstructorDescription { - case encryptedMessage(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer, file: Api.EncryptedFile) - case encryptedMessageService(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .encryptedMessage(let randomId, let chatId, let date, let bytes, let file): - if boxed { - buffer.appendInt32(-317144808) - } - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeInt32(chatId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - file.serialize(buffer, true) - break - case .encryptedMessageService(let randomId, let chatId, let date, let bytes): - if boxed { - buffer.appendInt32(594758406) - } - serializeInt64(randomId, buffer: buffer, boxed: false) - serializeInt32(chatId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - serializeBytes(bytes, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .encryptedMessage(let randomId, let chatId, let date, let bytes, let file): - return ("encryptedMessage", [("randomId", randomId as Any), ("chatId", chatId as Any), ("date", date as Any), ("bytes", bytes as Any), ("file", file as Any)]) - case .encryptedMessageService(let randomId, let chatId, let date, let bytes): - return ("encryptedMessageService", [("randomId", randomId as Any), ("chatId", chatId as Any), ("date", date as Any), ("bytes", bytes as Any)]) - } - } - + public class Cons_encryptedMessage { + public var randomId: Int64 + public var chatId: Int32 + public var date: Int32 + public var bytes: Buffer + public var file: Api.EncryptedFile + public init(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer, file: Api.EncryptedFile) { + self.randomId = randomId + self.chatId = chatId + self.date = date + self.bytes = bytes + self.file = file + } + } + public class Cons_encryptedMessageService { + public var randomId: Int64 + public var chatId: Int32 + public var date: Int32 + public var bytes: Buffer + public init(randomId: Int64, chatId: Int32, date: Int32, bytes: Buffer) { + self.randomId = randomId + self.chatId = chatId + self.date = date + self.bytes = bytes + } + } + case encryptedMessage(Cons_encryptedMessage) + case encryptedMessageService(Cons_encryptedMessageService) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .encryptedMessage(let _data): + if boxed { + buffer.appendInt32(-317144808) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + serializeInt32(_data.chatId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + _data.file.serialize(buffer, true) + break + case .encryptedMessageService(let _data): + if boxed { + buffer.appendInt32(594758406) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + serializeInt32(_data.chatId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + serializeBytes(_data.bytes, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .encryptedMessage(let _data): + return ("encryptedMessage", [("randomId", _data.randomId as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("bytes", _data.bytes as Any), ("file", _data.file as Any)]) + case .encryptedMessageService(let _data): + return ("encryptedMessageService", [("randomId", _data.randomId as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("bytes", _data.bytes as Any)]) + } + } + public static func parse_encryptedMessage(_ reader: BufferReader) -> EncryptedMessage? { var _1: Int64? _1 = reader.readInt64() @@ -343,7 +455,7 @@ public extension Api { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.EncryptedMessage.encryptedMessage(randomId: _1!, chatId: _2!, date: _3!, bytes: _4!, file: _5!) + return Api.EncryptedMessage.encryptedMessage(Cons_encryptedMessage(randomId: _1!, chatId: _2!, date: _3!, bytes: _4!, file: _5!)) } else { return nil @@ -363,57 +475,99 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.EncryptedMessage.encryptedMessageService(randomId: _1!, chatId: _2!, date: _3!, bytes: _4!) + return Api.EncryptedMessage.encryptedMessageService(Cons_encryptedMessageService(randomId: _1!, chatId: _2!, date: _3!, bytes: _4!)) } else { return nil } } - } } public extension Api { enum ExportedChatInvite: TypeConstructorDescription { - case chatInviteExported(flags: Int32, link: String, adminId: Int64, date: Int32, startDate: Int32?, expireDate: Int32?, usageLimit: Int32?, usage: Int32?, requested: Int32?, subscriptionExpired: Int32?, title: String?, subscriptionPricing: Api.StarsSubscriptionPricing?) + public class Cons_chatInviteExported { + public var flags: Int32 + public var link: String + public var adminId: Int64 + public var date: Int32 + public var startDate: Int32? + public var expireDate: Int32? + public var usageLimit: Int32? + public var usage: Int32? + public var requested: Int32? + public var subscriptionExpired: Int32? + public var title: String? + public var subscriptionPricing: Api.StarsSubscriptionPricing? + public init(flags: Int32, link: String, adminId: Int64, date: Int32, startDate: Int32?, expireDate: Int32?, usageLimit: Int32?, usage: Int32?, requested: Int32?, subscriptionExpired: Int32?, title: String?, subscriptionPricing: Api.StarsSubscriptionPricing?) { + self.flags = flags + self.link = link + self.adminId = adminId + self.date = date + self.startDate = startDate + self.expireDate = expireDate + self.usageLimit = usageLimit + self.usage = usage + self.requested = requested + self.subscriptionExpired = subscriptionExpired + self.title = title + self.subscriptionPricing = subscriptionPricing + } + } + case chatInviteExported(Cons_chatInviteExported) case chatInvitePublicJoinRequests - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .chatInviteExported(let flags, let link, let adminId, let date, let startDate, let expireDate, let usageLimit, let usage, let requested, let subscriptionExpired, let title, let subscriptionPricing): - if boxed { - buffer.appendInt32(-1574126186) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(link, buffer: buffer, boxed: false) - serializeInt64(adminId, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(startDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(expireDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeInt32(usageLimit!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(usage!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(requested!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(subscriptionExpired!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 8) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 9) != 0 {subscriptionPricing!.serialize(buffer, true)} - break - case .chatInvitePublicJoinRequests: - if boxed { - buffer.appendInt32(-317687113) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .chatInviteExported(let flags, let link, let adminId, let date, let startDate, let expireDate, let usageLimit, let usage, let requested, let subscriptionExpired, let title, let subscriptionPricing): - return ("chatInviteExported", [("flags", flags as Any), ("link", link as Any), ("adminId", adminId as Any), ("date", date as Any), ("startDate", startDate as Any), ("expireDate", expireDate as Any), ("usageLimit", usageLimit as Any), ("usage", usage as Any), ("requested", requested as Any), ("subscriptionExpired", subscriptionExpired as Any), ("title", title as Any), ("subscriptionPricing", subscriptionPricing as Any)]) - case .chatInvitePublicJoinRequests: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatInviteExported(let _data): + if boxed { + buffer.appendInt32(-1574126186) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.link, buffer: buffer, boxed: false) + serializeInt64(_data.adminId, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.startDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.expireDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.usageLimit!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.usage!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.requested!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.subscriptionExpired!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 9) != 0 { + _data.subscriptionPricing!.serialize(buffer, true) + } + break + case .chatInvitePublicJoinRequests: + if boxed { + buffer.appendInt32(-317687113) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .chatInviteExported(let _data): + return ("chatInviteExported", [("flags", _data.flags as Any), ("link", _data.link as Any), ("adminId", _data.adminId as Any), ("date", _data.date as Any), ("startDate", _data.startDate as Any), ("expireDate", _data.expireDate as Any), ("usageLimit", _data.usageLimit as Any), ("usage", _data.usage as Any), ("requested", _data.requested as Any), ("subscriptionExpired", _data.subscriptionExpired as Any), ("title", _data.title as Any), ("subscriptionPricing", _data.subscriptionPricing as Any)]) + case .chatInvitePublicJoinRequests: return ("chatInvitePublicJoinRequests", []) - } - } - + } + } + public static func parse_chatInviteExported(_ reader: BufferReader) -> ExportedChatInvite? { var _1: Int32? _1 = reader.readInt32() @@ -424,23 +578,39 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } var _7: Int32? - if Int(_1!) & Int(1 << 2) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 2) != 0 { + _7 = reader.readInt32() + } var _8: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _8 = reader.readInt32() + } var _9: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _9 = reader.readInt32() + } var _10: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_10 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _10 = reader.readInt32() + } var _11: String? - if Int(_1!) & Int(1 << 8) != 0 {_11 = parseString(reader) } + if Int(_1!) & Int(1 << 8) != 0 { + _11 = parseString(reader) + } var _12: Api.StarsSubscriptionPricing? - if Int(_1!) & Int(1 << 9) != 0 {if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing - } } + if Int(_1!) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -454,7 +624,7 @@ public extension Api { let _c11 = (Int(_1!) & Int(1 << 8) == 0) || _11 != nil let _c12 = (Int(_1!) & Int(1 << 9) == 0) || _12 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - return Api.ExportedChatInvite.chatInviteExported(flags: _1!, link: _2!, adminId: _3!, date: _4!, startDate: _5, expireDate: _6, usageLimit: _7, usage: _8, requested: _9, subscriptionExpired: _10, title: _11, subscriptionPricing: _12) + return Api.ExportedChatInvite.chatInviteExported(Cons_chatInviteExported(flags: _1!, link: _2!, adminId: _3!, date: _4!, startDate: _5, expireDate: _6, usageLimit: _7, usage: _8, requested: _9, subscriptionExpired: _10, title: _11, subscriptionPricing: _12)) } else { return nil @@ -463,38 +633,49 @@ public extension Api { public static func parse_chatInvitePublicJoinRequests(_ reader: BufferReader) -> ExportedChatInvite? { return Api.ExportedChatInvite.chatInvitePublicJoinRequests } - } } public extension Api { enum ExportedChatlistInvite: TypeConstructorDescription { - case exportedChatlistInvite(flags: Int32, title: String, url: String, peers: [Api.Peer]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedChatlistInvite(let flags, let title, let url, let peers): - if boxed { - buffer.appendInt32(206668204) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(peers.count)) - for item in peers { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedChatlistInvite(let flags, let title, let url, let peers): - return ("exportedChatlistInvite", [("flags", flags as Any), ("title", title as Any), ("url", url as Any), ("peers", peers as Any)]) - } - } - + public class Cons_exportedChatlistInvite { + public var flags: Int32 + public var title: String + public var url: String + public var peers: [Api.Peer] + public init(flags: Int32, title: String, url: String, peers: [Api.Peer]) { + self.flags = flags + self.title = title + self.url = url + self.peers = peers + } + } + case exportedChatlistInvite(Cons_exportedChatlistInvite) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedChatlistInvite(let _data): + if boxed { + buffer.appendInt32(206668204) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.peers.count)) + for item in _data.peers { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedChatlistInvite(let _data): + return ("exportedChatlistInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("url", _data.url as Any), ("peers", _data.peers as Any)]) + } + } + public static func parse_exportedChatlistInvite(_ reader: BufferReader) -> ExportedChatlistInvite? { var _1: Int32? _1 = reader.readInt32() @@ -511,38 +692,45 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ExportedChatlistInvite.exportedChatlistInvite(flags: _1!, title: _2!, url: _3!, peers: _4!) + return Api.ExportedChatlistInvite.exportedChatlistInvite(Cons_exportedChatlistInvite(flags: _1!, title: _2!, url: _3!, peers: _4!)) } else { return nil } } - } } public extension Api { enum ExportedContactToken: TypeConstructorDescription { - case exportedContactToken(url: String, expires: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedContactToken(let url, let expires): - if boxed { - buffer.appendInt32(1103040667) - } - serializeString(url, buffer: buffer, boxed: false) - serializeInt32(expires, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedContactToken(let url, let expires): - return ("exportedContactToken", [("url", url as Any), ("expires", expires as Any)]) - } - } - + public class Cons_exportedContactToken { + public var url: String + public var expires: Int32 + public init(url: String, expires: Int32) { + self.url = url + self.expires = expires + } + } + case exportedContactToken(Cons_exportedContactToken) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedContactToken(let _data): + if boxed { + buffer.appendInt32(1103040667) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedContactToken(let _data): + return ("exportedContactToken", [("url", _data.url as Any), ("expires", _data.expires as Any)]) + } + } + public static func parse_exportedContactToken(_ reader: BufferReader) -> ExportedContactToken? { var _1: String? _1 = parseString(reader) @@ -551,38 +739,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ExportedContactToken.exportedContactToken(url: _1!, expires: _2!) + return Api.ExportedContactToken.exportedContactToken(Cons_exportedContactToken(url: _1!, expires: _2!)) } else { return nil } } - } } public extension Api { enum ExportedMessageLink: TypeConstructorDescription { - case exportedMessageLink(link: String, html: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedMessageLink(let link, let html): - if boxed { - buffer.appendInt32(1571494644) - } - serializeString(link, buffer: buffer, boxed: false) - serializeString(html, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedMessageLink(let link, let html): - return ("exportedMessageLink", [("link", link as Any), ("html", html as Any)]) - } - } - + public class Cons_exportedMessageLink { + public var link: String + public var html: String + public init(link: String, html: String) { + self.link = link + self.html = html + } + } + case exportedMessageLink(Cons_exportedMessageLink) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedMessageLink(let _data): + if boxed { + buffer.appendInt32(1571494644) + } + serializeString(_data.link, buffer: buffer, boxed: false) + serializeString(_data.html, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedMessageLink(let _data): + return ("exportedMessageLink", [("link", _data.link as Any), ("html", _data.html as Any)]) + } + } + public static func parse_exportedMessageLink(_ reader: BufferReader) -> ExportedMessageLink? { var _1: String? _1 = parseString(reader) @@ -591,85 +786,109 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ExportedMessageLink.exportedMessageLink(link: _1!, html: _2!) + return Api.ExportedMessageLink.exportedMessageLink(Cons_exportedMessageLink(link: _1!, html: _2!)) } else { return nil } } - } } public extension Api { enum ExportedStoryLink: TypeConstructorDescription { - case exportedStoryLink(link: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedStoryLink(let link): - if boxed { - buffer.appendInt32(1070138683) - } - serializeString(link, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .exportedStoryLink(let link): - return ("exportedStoryLink", [("link", link as Any)]) - } - } - + public class Cons_exportedStoryLink { + public var link: String + public init(link: String) { + self.link = link + } + } + case exportedStoryLink(Cons_exportedStoryLink) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedStoryLink(let _data): + if boxed { + buffer.appendInt32(1070138683) + } + serializeString(_data.link, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .exportedStoryLink(let _data): + return ("exportedStoryLink", [("link", _data.link as Any)]) + } + } + public static func parse_exportedStoryLink(_ reader: BufferReader) -> ExportedStoryLink? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.ExportedStoryLink.exportedStoryLink(link: _1!) + return Api.ExportedStoryLink.exportedStoryLink(Cons_exportedStoryLink(link: _1!)) } else { return nil } } - } } public extension Api { enum FactCheck: TypeConstructorDescription { - case factCheck(flags: Int32, country: String?, text: Api.TextWithEntities?, hash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .factCheck(let flags, let country, let text, let hash): - if boxed { - buffer.appendInt32(-1197736753) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(country!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {text!.serialize(buffer, true)} - serializeInt64(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .factCheck(let flags, let country, let text, let hash): - return ("factCheck", [("flags", flags as Any), ("country", country as Any), ("text", text as Any), ("hash", hash as Any)]) - } - } - + public class Cons_factCheck { + public var flags: Int32 + public var country: String? + public var text: Api.TextWithEntities? + public var hash: Int64 + public init(flags: Int32, country: String?, text: Api.TextWithEntities?, hash: Int64) { + self.flags = flags + self.country = country + self.text = text + self.hash = hash + } + } + case factCheck(Cons_factCheck) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .factCheck(let _data): + if boxed { + buffer.appendInt32(-1197736753) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.country!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.text!.serialize(buffer, true) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .factCheck(let _data): + return ("factCheck", [("flags", _data.flags as Any), ("country", _data.country as Any), ("text", _data.text as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_factCheck(_ reader: BufferReader) -> FactCheck? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1!) & Int(1 << 1) != 0 {_2 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } var _3: Api.TextWithEntities? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } var _4: Int64? _4 = reader.readInt64() let _c1 = _1 != nil @@ -677,39 +896,48 @@ public extension Api { let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.FactCheck.factCheck(flags: _1!, country: _2, text: _3, hash: _4!) + return Api.FactCheck.factCheck(Cons_factCheck(flags: _1!, country: _2, text: _3, hash: _4!)) } else { return nil } } - } } public extension Api { enum FileHash: TypeConstructorDescription { - case fileHash(offset: Int64, limit: Int32, hash: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .fileHash(let offset, let limit, let hash): - if boxed { - buffer.appendInt32(-207944868) - } - serializeInt64(offset, buffer: buffer, boxed: false) - serializeInt32(limit, buffer: buffer, boxed: false) - serializeBytes(hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .fileHash(let offset, let limit, let hash): - return ("fileHash", [("offset", offset as Any), ("limit", limit as Any), ("hash", hash as Any)]) - } - } - + public class Cons_fileHash { + public var offset: Int64 + public var limit: Int32 + public var hash: Buffer + public init(offset: Int64, limit: Int32, hash: Buffer) { + self.offset = offset + self.limit = limit + self.hash = hash + } + } + case fileHash(Cons_fileHash) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .fileHash(let _data): + if boxed { + buffer.appendInt32(-207944868) + } + serializeInt64(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.limit, buffer: buffer, boxed: false) + serializeBytes(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .fileHash(let _data): + return ("fileHash", [("offset", _data.offset as Any), ("limit", _data.limit as Any), ("hash", _data.hash as Any)]) + } + } + public static func parse_fileHash(_ reader: BufferReader) -> FileHash? { var _1: Int64? _1 = reader.readInt64() @@ -721,40 +949,53 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.FileHash.fileHash(offset: _1!, limit: _2!, hash: _3!) + return Api.FileHash.fileHash(Cons_fileHash(offset: _1!, limit: _2!, hash: _3!)) } else { return nil } } - } } public extension Api { enum Folder: TypeConstructorDescription { - case folder(flags: Int32, id: Int32, title: String, photo: Api.ChatPhoto?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .folder(let flags, let id, let title, let photo): - if boxed { - buffer.appendInt32(-11252123) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {photo!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .folder(let flags, let id, let title, let photo): - return ("folder", [("flags", flags as Any), ("id", id as Any), ("title", title as Any), ("photo", photo as Any)]) - } - } - + public class Cons_folder { + public var flags: Int32 + public var id: Int32 + public var title: String + public var photo: Api.ChatPhoto? + public init(flags: Int32, id: Int32, title: String, photo: Api.ChatPhoto?) { + self.flags = flags + self.id = id + self.title = title + self.photo = photo + } + } + case folder(Cons_folder) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .folder(let _data): + if boxed { + buffer.appendInt32(-11252123) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.photo!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .folder(let _data): + return ("folder", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("photo", _data.photo as Any)]) + } + } + public static func parse_folder(_ reader: BufferReader) -> Folder? { var _1: Int32? _1 = reader.readInt32() @@ -763,46 +1004,55 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.ChatPhoto? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ChatPhoto - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatPhoto + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Folder.folder(flags: _1!, id: _2!, title: _3!, photo: _4) + return Api.Folder.folder(Cons_folder(flags: _1!, id: _2!, title: _3!, photo: _4)) } else { return nil } } - } } public extension Api { enum FolderPeer: TypeConstructorDescription { - case folderPeer(peer: Api.Peer, folderId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .folderPeer(let peer, let folderId): - if boxed { - buffer.appendInt32(-373643672) - } - peer.serialize(buffer, true) - serializeInt32(folderId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .folderPeer(let peer, let folderId): - return ("folderPeer", [("peer", peer as Any), ("folderId", folderId as Any)]) - } - } - + public class Cons_folderPeer { + public var peer: Api.Peer + public var folderId: Int32 + public init(peer: Api.Peer, folderId: Int32) { + self.peer = peer + self.folderId = folderId + } + } + case folderPeer(Cons_folderPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .folderPeer(let _data): + if boxed { + buffer.appendInt32(-373643672) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.folderId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .folderPeer(let _data): + return ("folderPeer", [("peer", _data.peer as Any), ("folderId", _data.folderId as Any)]) + } + } + public static func parse_folderPeer(_ reader: BufferReader) -> FolderPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -813,61 +1063,106 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.FolderPeer.folderPeer(peer: _1!, folderId: _2!) + return Api.FolderPeer.folderPeer(Cons_folderPeer(peer: _1!, folderId: _2!)) } else { return nil } } - } } public extension Api { indirect enum ForumTopic: TypeConstructorDescription { - case forumTopic(flags: Int32, id: Int32, date: Int32, peer: Api.Peer, title: String, iconColor: Int32, iconEmojiId: Int64?, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, fromId: Api.Peer, notifySettings: Api.PeerNotifySettings, draft: Api.DraftMessage?) - case forumTopicDeleted(id: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .forumTopic(let flags, let id, let date, let peer, let title, let iconColor, let iconEmojiId, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadMentionsCount, let unreadReactionsCount, let fromId, let notifySettings, let draft): - if boxed { - buffer.appendInt32(-838922550) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt32(date, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeInt32(iconColor, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(iconEmojiId!, buffer: buffer, boxed: false)} - serializeInt32(topMessage, buffer: buffer, boxed: false) - serializeInt32(readInboxMaxId, buffer: buffer, boxed: false) - serializeInt32(readOutboxMaxId, buffer: buffer, boxed: false) - serializeInt32(unreadCount, buffer: buffer, boxed: false) - serializeInt32(unreadMentionsCount, buffer: buffer, boxed: false) - serializeInt32(unreadReactionsCount, buffer: buffer, boxed: false) - fromId.serialize(buffer, true) - notifySettings.serialize(buffer, true) - if Int(flags) & Int(1 << 4) != 0 {draft!.serialize(buffer, true)} - break - case .forumTopicDeleted(let id): - if boxed { - buffer.appendInt32(37687451) - } - serializeInt32(id, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .forumTopic(let flags, let id, let date, let peer, let title, let iconColor, let iconEmojiId, let topMessage, let readInboxMaxId, let readOutboxMaxId, let unreadCount, let unreadMentionsCount, let unreadReactionsCount, let fromId, let notifySettings, let draft): - return ("forumTopic", [("flags", flags as Any), ("id", id as Any), ("date", date as Any), ("peer", peer as Any), ("title", title as Any), ("iconColor", iconColor as Any), ("iconEmojiId", iconEmojiId as Any), ("topMessage", topMessage as Any), ("readInboxMaxId", readInboxMaxId as Any), ("readOutboxMaxId", readOutboxMaxId as Any), ("unreadCount", unreadCount as Any), ("unreadMentionsCount", unreadMentionsCount as Any), ("unreadReactionsCount", unreadReactionsCount as Any), ("fromId", fromId as Any), ("notifySettings", notifySettings as Any), ("draft", draft as Any)]) - case .forumTopicDeleted(let id): - return ("forumTopicDeleted", [("id", id as Any)]) - } - } - + public class Cons_forumTopic { + public var flags: Int32 + public var id: Int32 + public var date: Int32 + public var peer: Api.Peer + public var title: String + public var iconColor: Int32 + public var iconEmojiId: Int64? + public var topMessage: Int32 + public var readInboxMaxId: Int32 + public var readOutboxMaxId: Int32 + public var unreadCount: Int32 + public var unreadMentionsCount: Int32 + public var unreadReactionsCount: Int32 + public var fromId: Api.Peer + public var notifySettings: Api.PeerNotifySettings + public var draft: Api.DraftMessage? + public init(flags: Int32, id: Int32, date: Int32, peer: Api.Peer, title: String, iconColor: Int32, iconEmojiId: Int64?, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, fromId: Api.Peer, notifySettings: Api.PeerNotifySettings, draft: Api.DraftMessage?) { + self.flags = flags + self.id = id + self.date = date + self.peer = peer + self.title = title + self.iconColor = iconColor + self.iconEmojiId = iconEmojiId + self.topMessage = topMessage + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount + self.unreadMentionsCount = unreadMentionsCount + self.unreadReactionsCount = unreadReactionsCount + self.fromId = fromId + self.notifySettings = notifySettings + self.draft = draft + } + } + public class Cons_forumTopicDeleted { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + } + case forumTopic(Cons_forumTopic) + case forumTopicDeleted(Cons_forumTopicDeleted) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .forumTopic(let _data): + if boxed { + buffer.appendInt32(-838922550) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeInt32(_data.iconColor, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.iconEmojiId!, buffer: buffer, boxed: false) + } + serializeInt32(_data.topMessage, buffer: buffer, boxed: false) + serializeInt32(_data.readInboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.readOutboxMaxId, buffer: buffer, boxed: false) + serializeInt32(_data.unreadCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadMentionsCount, buffer: buffer, boxed: false) + serializeInt32(_data.unreadReactionsCount, buffer: buffer, boxed: false) + _data.fromId.serialize(buffer, true) + _data.notifySettings.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.draft!.serialize(buffer, true) + } + break + case .forumTopicDeleted(let _data): + if boxed { + buffer.appendInt32(37687451) + } + serializeInt32(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .forumTopic(let _data): + return ("forumTopic", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("peer", _data.peer as Any), ("title", _data.title as Any), ("iconColor", _data.iconColor as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("fromId", _data.fromId as Any), ("notifySettings", _data.notifySettings as Any), ("draft", _data.draft as Any)]) + case .forumTopicDeleted(let _data): + return ("forumTopicDeleted", [("id", _data.id as Any)]) + } + } + public static func parse_forumTopic(_ reader: BufferReader) -> ForumTopic? { var _1: Int32? _1 = reader.readInt32() @@ -884,7 +1179,9 @@ public extension Api { var _6: Int32? _6 = reader.readInt32() var _7: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_7 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _7 = reader.readInt64() + } var _8: Int32? _8 = reader.readInt32() var _9: Int32? @@ -906,9 +1203,11 @@ public extension Api { _15 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings } var _16: Api.DraftMessage? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.DraftMessage - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.DraftMessage + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -926,7 +1225,7 @@ public extension Api { let _c15 = _15 != nil let _c16 = (Int(_1!) & Int(1 << 4) == 0) || _16 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 { - return Api.ForumTopic.forumTopic(flags: _1!, id: _2!, date: _3!, peer: _4!, title: _5!, iconColor: _6!, iconEmojiId: _7, topMessage: _8!, readInboxMaxId: _9!, readOutboxMaxId: _10!, unreadCount: _11!, unreadMentionsCount: _12!, unreadReactionsCount: _13!, fromId: _14!, notifySettings: _15!, draft: _16) + return Api.ForumTopic.forumTopic(Cons_forumTopic(flags: _1!, id: _2!, date: _3!, peer: _4!, title: _5!, iconColor: _6!, iconEmojiId: _7, topMessage: _8!, readInboxMaxId: _9!, readOutboxMaxId: _10!, unreadCount: _11!, unreadMentionsCount: _12!, unreadReactionsCount: _13!, fromId: _14!, notifySettings: _15!, draft: _16)) } else { return nil @@ -937,38 +1236,45 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.ForumTopic.forumTopicDeleted(id: _1!) + return Api.ForumTopic.forumTopicDeleted(Cons_forumTopicDeleted(id: _1!)) } else { return nil } } - } } public extension Api { indirect enum FoundStory: TypeConstructorDescription { - case foundStory(peer: Api.Peer, story: Api.StoryItem) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .foundStory(let peer, let story): - if boxed { - buffer.appendInt32(-394605632) - } - peer.serialize(buffer, true) - story.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .foundStory(let peer, let story): - return ("foundStory", [("peer", peer as Any), ("story", story as Any)]) - } - } - + public class Cons_foundStory { + public var peer: Api.Peer + public var story: Api.StoryItem + public init(peer: Api.Peer, story: Api.StoryItem) { + self.peer = peer + self.story = story + } + } + case foundStory(Cons_foundStory) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .foundStory(let _data): + if boxed { + buffer.appendInt32(-394605632) + } + _data.peer.serialize(buffer, true) + _data.story.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .foundStory(let _data): + return ("foundStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) + } + } + public static func parse_foundStory(_ reader: BufferReader) -> FoundStory? { var _1: Api.Peer? if let signature = reader.readInt32() { @@ -981,44 +1287,65 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.FoundStory.foundStory(peer: _1!, story: _2!) + return Api.FoundStory.foundStory(Cons_foundStory(peer: _1!, story: _2!)) } else { return nil } } - } } public extension Api { enum Game: TypeConstructorDescription { - case game(flags: Int32, id: Int64, accessHash: Int64, shortName: String, title: String, description: String, photo: Api.Photo, document: Api.Document?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .game(let flags, let id, let accessHash, let shortName, let title, let description, let photo, let document): - if boxed { - buffer.appendInt32(-1107729093) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - photo.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {document!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .game(let flags, let id, let accessHash, let shortName, let title, let description, let photo, let document): - return ("game", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("shortName", shortName as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("document", document as Any)]) - } - } - + public class Cons_game { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var shortName: String + public var title: String + public var description: String + public var photo: Api.Photo + public var document: Api.Document? + public init(flags: Int32, id: Int64, accessHash: Int64, shortName: String, title: String, description: String, photo: Api.Photo, document: Api.Document?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.shortName = shortName + self.title = title + self.description = description + self.photo = photo + self.document = document + } + } + case game(Cons_game) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .game(let _data): + if boxed { + buffer.appendInt32(-1107729093) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.shortName, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + _data.photo.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.document!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .game(let _data): + return ("game", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("shortName", _data.shortName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("document", _data.document as Any)]) + } + } + public static func parse_game(_ reader: BufferReader) -> Game? { var _1: Int32? _1 = reader.readInt32() @@ -1037,9 +1364,11 @@ public extension Api { _7 = Api.parse(reader, signature: signature) as? Api.Photo } var _8: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Document - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Document + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1049,50 +1378,64 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 0) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Game.game(flags: _1!, id: _2!, accessHash: _3!, shortName: _4!, title: _5!, description: _6!, photo: _7!, document: _8) + return Api.Game.game(Cons_game(flags: _1!, id: _2!, accessHash: _3!, shortName: _4!, title: _5!, description: _6!, photo: _7!, document: _8)) } else { return nil } } - } } public extension Api { enum GeoPoint: TypeConstructorDescription { - case geoPoint(flags: Int32, long: Double, lat: Double, accessHash: Int64, accuracyRadius: Int32?) + public class Cons_geoPoint { + public var flags: Int32 + public var long: Double + public var lat: Double + public var accessHash: Int64 + public var accuracyRadius: Int32? + public init(flags: Int32, long: Double, lat: Double, accessHash: Int64, accuracyRadius: Int32?) { + self.flags = flags + self.long = long + self.lat = lat + self.accessHash = accessHash + self.accuracyRadius = accuracyRadius + } + } + case geoPoint(Cons_geoPoint) case geoPointEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .geoPoint(let flags, let long, let lat, let accessHash, let accuracyRadius): - if boxed { - buffer.appendInt32(-1297942941) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeDouble(long, buffer: buffer, boxed: false) - serializeDouble(lat, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(accuracyRadius!, buffer: buffer, boxed: false)} - break - case .geoPointEmpty: - if boxed { - buffer.appendInt32(286776671) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .geoPoint(let flags, let long, let lat, let accessHash, let accuracyRadius): - return ("geoPoint", [("flags", flags as Any), ("long", long as Any), ("lat", lat as Any), ("accessHash", accessHash as Any), ("accuracyRadius", accuracyRadius as Any)]) - case .geoPointEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .geoPoint(let _data): + if boxed { + buffer.appendInt32(-1297942941) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeDouble(_data.long, buffer: buffer, boxed: false) + serializeDouble(_data.lat, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.accuracyRadius!, buffer: buffer, boxed: false) + } + break + case .geoPointEmpty: + if boxed { + buffer.appendInt32(286776671) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .geoPoint(let _data): + return ("geoPoint", [("flags", _data.flags as Any), ("long", _data.long as Any), ("lat", _data.lat as Any), ("accessHash", _data.accessHash as Any), ("accuracyRadius", _data.accuracyRadius as Any)]) + case .geoPointEmpty: return ("geoPointEmpty", []) - } - } - + } + } + public static func parse_geoPoint(_ reader: BufferReader) -> GeoPoint? { var _1: Int32? _1 = reader.readInt32() @@ -1103,14 +1446,16 @@ public extension Api { var _4: Int64? _4 = reader.readInt64() var _5: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.GeoPoint.geoPoint(flags: _1!, long: _2!, lat: _3!, accessHash: _4!, accuracyRadius: _5) + return Api.GeoPoint.geoPoint(Cons_geoPoint(flags: _1!, long: _2!, lat: _3!, accessHash: _4!, accuracyRadius: _5)) } else { return nil @@ -1119,153 +1464,252 @@ public extension Api { public static func parse_geoPointEmpty(_ reader: BufferReader) -> GeoPoint? { return Api.GeoPoint.geoPointEmpty } - } } public extension Api { enum GeoPointAddress: TypeConstructorDescription { - case geoPointAddress(flags: Int32, countryIso2: String, state: String?, city: String?, street: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .geoPointAddress(let flags, let countryIso2, let state, let city, let street): - if boxed { - buffer.appendInt32(-565420653) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(countryIso2, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {serializeString(state!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeString(city!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(street!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .geoPointAddress(let flags, let countryIso2, let state, let city, let street): - return ("geoPointAddress", [("flags", flags as Any), ("countryIso2", countryIso2 as Any), ("state", state as Any), ("city", city as Any), ("street", street as Any)]) - } - } - + public class Cons_geoPointAddress { + public var flags: Int32 + public var countryIso2: String + public var state: String? + public var city: String? + public var street: String? + public init(flags: Int32, countryIso2: String, state: String?, city: String?, street: String?) { + self.flags = flags + self.countryIso2 = countryIso2 + self.state = state + self.city = city + self.street = street + } + } + case geoPointAddress(Cons_geoPointAddress) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .geoPointAddress(let _data): + if boxed { + buffer.appendInt32(-565420653) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.countryIso2, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.state!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.city!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.street!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .geoPointAddress(let _data): + return ("geoPointAddress", [("flags", _data.flags as Any), ("countryIso2", _data.countryIso2 as Any), ("state", _data.state as Any), ("city", _data.city as Any), ("street", _data.street as Any)]) + } + } + public static func parse_geoPointAddress(_ reader: BufferReader) -> GeoPointAddress? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: String? - if Int(_1!) & Int(1 << 0) != 0 {_3 = parseString(reader) } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.GeoPointAddress.geoPointAddress(flags: _1!, countryIso2: _2!, state: _3, city: _4, street: _5) + return Api.GeoPointAddress.geoPointAddress(Cons_geoPointAddress(flags: _1!, countryIso2: _2!, state: _3, city: _4, street: _5)) } else { return nil } } - } } public extension Api { enum GlobalPrivacySettings: TypeConstructorDescription { - case globalPrivacySettings(flags: Int32, noncontactPeersPaidStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .globalPrivacySettings(let flags, let noncontactPeersPaidStars, let disallowedGifts): - if boxed { - buffer.appendInt32(-29248689) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 5) != 0 {serializeInt64(noncontactPeersPaidStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {disallowedGifts!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .globalPrivacySettings(let flags, let noncontactPeersPaidStars, let disallowedGifts): - return ("globalPrivacySettings", [("flags", flags as Any), ("noncontactPeersPaidStars", noncontactPeersPaidStars as Any), ("disallowedGifts", disallowedGifts as Any)]) - } - } - + public class Cons_globalPrivacySettings { + public var flags: Int32 + public var noncontactPeersPaidStars: Int64? + public var disallowedGifts: Api.DisallowedGiftsSettings? + public init(flags: Int32, noncontactPeersPaidStars: Int64?, disallowedGifts: Api.DisallowedGiftsSettings?) { + self.flags = flags + self.noncontactPeersPaidStars = noncontactPeersPaidStars + self.disallowedGifts = disallowedGifts + } + } + case globalPrivacySettings(Cons_globalPrivacySettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .globalPrivacySettings(let _data): + if boxed { + buffer.appendInt32(-29248689) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt64(_data.noncontactPeersPaidStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.disallowedGifts!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .globalPrivacySettings(let _data): + return ("globalPrivacySettings", [("flags", _data.flags as Any), ("noncontactPeersPaidStars", _data.noncontactPeersPaidStars as Any), ("disallowedGifts", _data.disallowedGifts as Any)]) + } + } + public static func parse_globalPrivacySettings(_ reader: BufferReader) -> GlobalPrivacySettings? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? - if Int(_1!) & Int(1 << 5) != 0 {_2 = reader.readInt64() } + if Int(_1!) & Int(1 << 5) != 0 { + _2 = reader.readInt64() + } var _3: Api.DisallowedGiftsSettings? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.DisallowedGiftsSettings - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.DisallowedGiftsSettings + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 5) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.GlobalPrivacySettings.globalPrivacySettings(flags: _1!, noncontactPeersPaidStars: _2, disallowedGifts: _3) + return Api.GlobalPrivacySettings.globalPrivacySettings(Cons_globalPrivacySettings(flags: _1!, noncontactPeersPaidStars: _2, disallowedGifts: _3)) } else { return nil } } - } } public extension Api { enum GroupCall: TypeConstructorDescription { - case groupCall(flags: Int32, id: Int64, accessHash: Int64, participantsCount: Int32, title: String?, streamDcId: Int32?, recordStartDate: Int32?, scheduleDate: Int32?, unmutedVideoCount: Int32?, unmutedVideoLimit: Int32, version: Int32, inviteLink: String?, sendPaidMessagesStars: Int64?, defaultSendAs: Api.Peer?) - case groupCallDiscarded(id: Int64, accessHash: Int64, duration: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCall(let flags, let id, let accessHash, let participantsCount, let title, let streamDcId, let recordStartDate, let scheduleDate, let unmutedVideoCount, let unmutedVideoLimit, let version, let inviteLink, let sendPaidMessagesStars, let defaultSendAs): - if boxed { - buffer.appendInt32(-273500649) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(participantsCount, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {serializeInt32(streamDcId!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 5) != 0 {serializeInt32(recordStartDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(scheduleDate!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 10) != 0 {serializeInt32(unmutedVideoCount!, buffer: buffer, boxed: false)} - serializeInt32(unmutedVideoLimit, buffer: buffer, boxed: false) - serializeInt32(version, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 16) != 0 {serializeString(inviteLink!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 20) != 0 {serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 21) != 0 {defaultSendAs!.serialize(buffer, true)} - break - case .groupCallDiscarded(let id, let accessHash, let duration): - if boxed { - buffer.appendInt32(2004925620) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeInt32(duration, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCall(let flags, let id, let accessHash, let participantsCount, let title, let streamDcId, let recordStartDate, let scheduleDate, let unmutedVideoCount, let unmutedVideoLimit, let version, let inviteLink, let sendPaidMessagesStars, let defaultSendAs): - return ("groupCall", [("flags", flags as Any), ("id", id as Any), ("accessHash", accessHash as Any), ("participantsCount", participantsCount as Any), ("title", title as Any), ("streamDcId", streamDcId as Any), ("recordStartDate", recordStartDate as Any), ("scheduleDate", scheduleDate as Any), ("unmutedVideoCount", unmutedVideoCount as Any), ("unmutedVideoLimit", unmutedVideoLimit as Any), ("version", version as Any), ("inviteLink", inviteLink as Any), ("sendPaidMessagesStars", sendPaidMessagesStars as Any), ("defaultSendAs", defaultSendAs as Any)]) - case .groupCallDiscarded(let id, let accessHash, let duration): - return ("groupCallDiscarded", [("id", id as Any), ("accessHash", accessHash as Any), ("duration", duration as Any)]) - } - } - + public class Cons_groupCall { + public var flags: Int32 + public var id: Int64 + public var accessHash: Int64 + public var participantsCount: Int32 + public var title: String? + public var streamDcId: Int32? + public var recordStartDate: Int32? + public var scheduleDate: Int32? + public var unmutedVideoCount: Int32? + public var unmutedVideoLimit: Int32 + public var version: Int32 + public var inviteLink: String? + public var sendPaidMessagesStars: Int64? + public var defaultSendAs: Api.Peer? + public init(flags: Int32, id: Int64, accessHash: Int64, participantsCount: Int32, title: String?, streamDcId: Int32?, recordStartDate: Int32?, scheduleDate: Int32?, unmutedVideoCount: Int32?, unmutedVideoLimit: Int32, version: Int32, inviteLink: String?, sendPaidMessagesStars: Int64?, defaultSendAs: Api.Peer?) { + self.flags = flags + self.id = id + self.accessHash = accessHash + self.participantsCount = participantsCount + self.title = title + self.streamDcId = streamDcId + self.recordStartDate = recordStartDate + self.scheduleDate = scheduleDate + self.unmutedVideoCount = unmutedVideoCount + self.unmutedVideoLimit = unmutedVideoLimit + self.version = version + self.inviteLink = inviteLink + self.sendPaidMessagesStars = sendPaidMessagesStars + self.defaultSendAs = defaultSendAs + } + } + public class Cons_groupCallDiscarded { + public var id: Int64 + public var accessHash: Int64 + public var duration: Int32 + public init(id: Int64, accessHash: Int64, duration: Int32) { + self.id = id + self.accessHash = accessHash + self.duration = duration + } + } + case groupCall(Cons_groupCall) + case groupCallDiscarded(Cons_groupCallDiscarded) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCall(let _data): + if boxed { + buffer.appendInt32(-273500649) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.participantsCount, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.streamDcId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.recordStartDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.scheduleDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 10) != 0 { + serializeInt32(_data.unmutedVideoCount!, buffer: buffer, boxed: false) + } + serializeInt32(_data.unmutedVideoLimit, buffer: buffer, boxed: false) + serializeInt32(_data.version, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.inviteLink!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 20) != 0 { + serializeInt64(_data.sendPaidMessagesStars!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 21) != 0 { + _data.defaultSendAs!.serialize(buffer, true) + } + break + case .groupCallDiscarded(let _data): + if boxed { + buffer.appendInt32(2004925620) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeInt32(_data.duration, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCall(let _data): + return ("groupCall", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("participantsCount", _data.participantsCount as Any), ("title", _data.title as Any), ("streamDcId", _data.streamDcId as Any), ("recordStartDate", _data.recordStartDate as Any), ("scheduleDate", _data.scheduleDate as Any), ("unmutedVideoCount", _data.unmutedVideoCount as Any), ("unmutedVideoLimit", _data.unmutedVideoLimit as Any), ("version", _data.version as Any), ("inviteLink", _data.inviteLink as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("defaultSendAs", _data.defaultSendAs as Any)]) + case .groupCallDiscarded(let _data): + return ("groupCallDiscarded", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("duration", _data.duration as Any)]) + } + } + public static func parse_groupCall(_ reader: BufferReader) -> GroupCall? { var _1: Int32? _1 = reader.readInt32() @@ -1276,27 +1720,43 @@ public extension Api { var _4: Int32? _4 = reader.readInt32() var _5: String? - if Int(_1!) & Int(1 << 3) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = parseString(reader) + } var _6: Int32? - if Int(_1!) & Int(1 << 4) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 4) != 0 { + _6 = reader.readInt32() + } var _7: Int32? - if Int(_1!) & Int(1 << 5) != 0 {_7 = reader.readInt32() } + if Int(_1!) & Int(1 << 5) != 0 { + _7 = reader.readInt32() + } var _8: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_8 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _8 = reader.readInt32() + } var _9: Int32? - if Int(_1!) & Int(1 << 10) != 0 {_9 = reader.readInt32() } + if Int(_1!) & Int(1 << 10) != 0 { + _9 = reader.readInt32() + } var _10: Int32? _10 = reader.readInt32() var _11: Int32? _11 = reader.readInt32() var _12: String? - if Int(_1!) & Int(1 << 16) != 0 {_12 = parseString(reader) } + if Int(_1!) & Int(1 << 16) != 0 { + _12 = parseString(reader) + } var _13: Int64? - if Int(_1!) & Int(1 << 20) != 0 {_13 = reader.readInt64() } + if Int(_1!) & Int(1 << 20) != 0 { + _13 = reader.readInt64() + } var _14: Api.Peer? - if Int(_1!) & Int(1 << 21) != 0 {if let signature = reader.readInt32() { - _14 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 21) != 0 { + if let signature = reader.readInt32() { + _14 = Api.parse(reader, signature: signature) as? Api.Peer + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1312,7 +1772,7 @@ public extension Api { let _c13 = (Int(_1!) & Int(1 << 20) == 0) || _13 != nil let _c14 = (Int(_1!) & Int(1 << 21) == 0) || _14 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 { - return Api.GroupCall.groupCall(flags: _1!, id: _2!, accessHash: _3!, participantsCount: _4!, title: _5, streamDcId: _6, recordStartDate: _7, scheduleDate: _8, unmutedVideoCount: _9, unmutedVideoLimit: _10!, version: _11!, inviteLink: _12, sendPaidMessagesStars: _13, defaultSendAs: _14) + return Api.GroupCall.groupCall(Cons_groupCall(flags: _1!, id: _2!, accessHash: _3!, participantsCount: _4!, title: _5, streamDcId: _6, recordStartDate: _7, scheduleDate: _8, unmutedVideoCount: _9, unmutedVideoLimit: _10!, version: _11!, inviteLink: _12, sendPaidMessagesStars: _13, defaultSendAs: _14)) } else { return nil @@ -1329,88 +1789,118 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.GroupCall.groupCallDiscarded(id: _1!, accessHash: _2!, duration: _3!) + return Api.GroupCall.groupCallDiscarded(Cons_groupCallDiscarded(id: _1!, accessHash: _2!, duration: _3!)) } else { return nil } } - } } public extension Api { enum GroupCallDonor: TypeConstructorDescription { - case groupCallDonor(flags: Int32, peerId: Api.Peer?, stars: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallDonor(let flags, let peerId, let stars): - if boxed { - buffer.appendInt32(-297595771) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {peerId!.serialize(buffer, true)} - serializeInt64(stars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallDonor(let flags, let peerId, let stars): - return ("groupCallDonor", [("flags", flags as Any), ("peerId", peerId as Any), ("stars", stars as Any)]) - } - } - + public class Cons_groupCallDonor { + public var flags: Int32 + public var peerId: Api.Peer? + public var stars: Int64 + public init(flags: Int32, peerId: Api.Peer?, stars: Int64) { + self.flags = flags + self.peerId = peerId + self.stars = stars + } + } + case groupCallDonor(Cons_groupCallDonor) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallDonor(let _data): + if boxed { + buffer.appendInt32(-297595771) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.peerId!.serialize(buffer, true) + } + serializeInt64(_data.stars, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallDonor(let _data): + return ("groupCallDonor", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("stars", _data.stars as Any)]) + } + } + public static func parse_groupCallDonor(_ reader: BufferReader) -> GroupCallDonor? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } var _3: Int64? _3 = reader.readInt64() let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.GroupCallDonor.groupCallDonor(flags: _1!, peerId: _2, stars: _3!) + return Api.GroupCallDonor.groupCallDonor(Cons_groupCallDonor(flags: _1!, peerId: _2, stars: _3!)) } else { return nil } } - } } public extension Api { enum GroupCallMessage: TypeConstructorDescription { - case groupCallMessage(flags: Int32, id: Int32, fromId: Api.Peer, date: Int32, message: Api.TextWithEntities, paidMessageStars: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallMessage(let flags, let id, let fromId, let date, let message, let paidMessageStars): - if boxed { - buffer.appendInt32(445316222) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - fromId.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - message.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt64(paidMessageStars!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallMessage(let flags, let id, let fromId, let date, let message, let paidMessageStars): - return ("groupCallMessage", [("flags", flags as Any), ("id", id as Any), ("fromId", fromId as Any), ("date", date as Any), ("message", message as Any), ("paidMessageStars", paidMessageStars as Any)]) - } - } - + public class Cons_groupCallMessage { + public var flags: Int32 + public var id: Int32 + public var fromId: Api.Peer + public var date: Int32 + public var message: Api.TextWithEntities + public var paidMessageStars: Int64? + public init(flags: Int32, id: Int32, fromId: Api.Peer, date: Int32, message: Api.TextWithEntities, paidMessageStars: Int64?) { + self.flags = flags + self.id = id + self.fromId = fromId + self.date = date + self.message = message + self.paidMessageStars = paidMessageStars + } + } + case groupCallMessage(Cons_groupCallMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallMessage(let _data): + if boxed { + buffer.appendInt32(445316222) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + _data.fromId.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.paidMessageStars!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallMessage(let _data): + return ("groupCallMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("date", _data.date as Any), ("message", _data.message as Any), ("paidMessageStars", _data.paidMessageStars as Any)]) + } + } + public static func parse_groupCallMessage(_ reader: BufferReader) -> GroupCallMessage? { var _1: Int32? _1 = reader.readInt32() @@ -1427,7 +1917,9 @@ public extension Api { _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } var _6: Int64? - if Int(_1!) & Int(1 << 0) != 0 {_6 = reader.readInt64() } + if Int(_1!) & Int(1 << 0) != 0 { + _6 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -1435,12 +1927,11 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.GroupCallMessage.groupCallMessage(flags: _1!, id: _2!, fromId: _3!, date: _4!, message: _5!, paidMessageStars: _6) + return Api.GroupCallMessage.groupCallMessage(Cons_groupCallMessage(flags: _1!, id: _2!, fromId: _3!, date: _4!, message: _5!, paidMessageStars: _6)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api8.swift b/submodules/TelegramApi/Sources/Api8.swift index 0b617cced0..82026a7444 100644 --- a/submodules/TelegramApi/Sources/Api8.swift +++ b/submodules/TelegramApi/Sources/Api8.swift @@ -1,35 +1,75 @@ public extension Api { enum GroupCallParticipant: TypeConstructorDescription { - case groupCallParticipant(flags: Int32, peer: Api.Peer, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?, about: String?, raiseHandRating: Int64?, video: Api.GroupCallParticipantVideo?, presentation: Api.GroupCallParticipantVideo?, paidStarsTotal: Int64?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallParticipant(let flags, let peer, let date, let activeDate, let source, let volume, let about, let raiseHandRating, let video, let presentation, let paidStarsTotal): - if boxed { - buffer.appendInt32(708691884) - } - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(date, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(activeDate!, buffer: buffer, boxed: false)} - serializeInt32(source, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 7) != 0 {serializeInt32(volume!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 11) != 0 {serializeString(about!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 13) != 0 {serializeInt64(raiseHandRating!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 6) != 0 {video!.serialize(buffer, true)} - if Int(flags) & Int(1 << 14) != 0 {presentation!.serialize(buffer, true)} - if Int(flags) & Int(1 << 16) != 0 {serializeInt64(paidStarsTotal!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallParticipant(let flags, let peer, let date, let activeDate, let source, let volume, let about, let raiseHandRating, let video, let presentation, let paidStarsTotal): - return ("groupCallParticipant", [("flags", flags as Any), ("peer", peer as Any), ("date", date as Any), ("activeDate", activeDate as Any), ("source", source as Any), ("volume", volume as Any), ("about", about as Any), ("raiseHandRating", raiseHandRating as Any), ("video", video as Any), ("presentation", presentation as Any), ("paidStarsTotal", paidStarsTotal as Any)]) - } - } - + public class Cons_groupCallParticipant { + public var flags: Int32 + public var peer: Api.Peer + public var date: Int32 + public var activeDate: Int32? + public var source: Int32 + public var volume: Int32? + public var about: String? + public var raiseHandRating: Int64? + public var video: Api.GroupCallParticipantVideo? + public var presentation: Api.GroupCallParticipantVideo? + public var paidStarsTotal: Int64? + public init(flags: Int32, peer: Api.Peer, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?, about: String?, raiseHandRating: Int64?, video: Api.GroupCallParticipantVideo?, presentation: Api.GroupCallParticipantVideo?, paidStarsTotal: Int64?) { + self.flags = flags + self.peer = peer + self.date = date + self.activeDate = activeDate + self.source = source + self.volume = volume + self.about = about + self.raiseHandRating = raiseHandRating + self.video = video + self.presentation = presentation + self.paidStarsTotal = paidStarsTotal + } + } + case groupCallParticipant(Cons_groupCallParticipant) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallParticipant(let _data): + if boxed { + buffer.appendInt32(708691884) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.activeDate!, buffer: buffer, boxed: false) + } + serializeInt32(_data.source, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.volume!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeString(_data.about!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt64(_data.raiseHandRating!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 6) != 0 { + _data.video!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 14) != 0 { + _data.presentation!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeInt64(_data.paidStarsTotal!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallParticipant(let _data): + return ("groupCallParticipant", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("activeDate", _data.activeDate as Any), ("source", _data.source as Any), ("volume", _data.volume as Any), ("about", _data.about as Any), ("raiseHandRating", _data.raiseHandRating as Any), ("video", _data.video as Any), ("presentation", _data.presentation as Any), ("paidStarsTotal", _data.paidStarsTotal as Any)]) + } + } + public static func parse_groupCallParticipant(_ reader: BufferReader) -> GroupCallParticipant? { var _1: Int32? _1 = reader.readInt32() @@ -40,25 +80,39 @@ public extension Api { var _3: Int32? _3 = reader.readInt32() var _4: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? - if Int(_1!) & Int(1 << 7) != 0 {_6 = reader.readInt32() } + if Int(_1!) & Int(1 << 7) != 0 { + _6 = reader.readInt32() + } var _7: String? - if Int(_1!) & Int(1 << 11) != 0 {_7 = parseString(reader) } + if Int(_1!) & Int(1 << 11) != 0 { + _7 = parseString(reader) + } var _8: Int64? - if Int(_1!) & Int(1 << 13) != 0 {_8 = reader.readInt64() } + if Int(_1!) & Int(1 << 13) != 0 { + _8 = reader.readInt64() + } var _9: Api.GroupCallParticipantVideo? - if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo + } + } var _10: Api.GroupCallParticipantVideo? - if Int(_1!) & Int(1 << 14) != 0 {if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo - } } + if Int(_1!) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo + } + } var _11: Int64? - if Int(_1!) & Int(1 << 16) != 0 {_11 = reader.readInt64() } + if Int(_1!) & Int(1 << 16) != 0 { + _11 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -71,44 +125,57 @@ public extension Api { let _c10 = (Int(_1!) & Int(1 << 14) == 0) || _10 != nil let _c11 = (Int(_1!) & Int(1 << 16) == 0) || _11 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - return Api.GroupCallParticipant.groupCallParticipant(flags: _1!, peer: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6, about: _7, raiseHandRating: _8, video: _9, presentation: _10, paidStarsTotal: _11) + return Api.GroupCallParticipant.groupCallParticipant(Cons_groupCallParticipant(flags: _1!, peer: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6, about: _7, raiseHandRating: _8, video: _9, presentation: _10, paidStarsTotal: _11)) } else { return nil } } - } } public extension Api { enum GroupCallParticipantVideo: TypeConstructorDescription { - case groupCallParticipantVideo(flags: Int32, endpoint: String, sourceGroups: [Api.GroupCallParticipantVideoSourceGroup], audioSource: Int32?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallParticipantVideo(let flags, let endpoint, let sourceGroups, let audioSource): - if boxed { - buffer.appendInt32(1735736008) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(endpoint, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sourceGroups.count)) - for item in sourceGroups { - item.serialize(buffer, true) - } - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(audioSource!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallParticipantVideo(let flags, let endpoint, let sourceGroups, let audioSource): - return ("groupCallParticipantVideo", [("flags", flags as Any), ("endpoint", endpoint as Any), ("sourceGroups", sourceGroups as Any), ("audioSource", audioSource as Any)]) - } - } - + public class Cons_groupCallParticipantVideo { + public var flags: Int32 + public var endpoint: String + public var sourceGroups: [Api.GroupCallParticipantVideoSourceGroup] + public var audioSource: Int32? + public init(flags: Int32, endpoint: String, sourceGroups: [Api.GroupCallParticipantVideoSourceGroup], audioSource: Int32?) { + self.flags = flags + self.endpoint = endpoint + self.sourceGroups = sourceGroups + self.audioSource = audioSource + } + } + case groupCallParticipantVideo(Cons_groupCallParticipantVideo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallParticipantVideo(let _data): + if boxed { + buffer.appendInt32(1735736008) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.endpoint, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sourceGroups.count)) + for item in _data.sourceGroups { + item.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.audioSource!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallParticipantVideo(let _data): + return ("groupCallParticipantVideo", [("flags", _data.flags as Any), ("endpoint", _data.endpoint as Any), ("sourceGroups", _data.sourceGroups as Any), ("audioSource", _data.audioSource as Any)]) + } + } + public static func parse_groupCallParticipantVideo(_ reader: BufferReader) -> GroupCallParticipantVideo? { var _1: Int32? _1 = reader.readInt32() @@ -119,48 +186,57 @@ public extension Api { _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipantVideoSourceGroup.self) } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.GroupCallParticipantVideo.groupCallParticipantVideo(flags: _1!, endpoint: _2!, sourceGroups: _3!, audioSource: _4) + return Api.GroupCallParticipantVideo.groupCallParticipantVideo(Cons_groupCallParticipantVideo(flags: _1!, endpoint: _2!, sourceGroups: _3!, audioSource: _4)) } else { return nil } } - } } public extension Api { enum GroupCallParticipantVideoSourceGroup: TypeConstructorDescription { - case groupCallParticipantVideoSourceGroup(semantics: String, sources: [Int32]) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallParticipantVideoSourceGroup(let semantics, let sources): - if boxed { - buffer.appendInt32(-592373577) - } - serializeString(semantics, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(sources.count)) - for item in sources { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallParticipantVideoSourceGroup(let semantics, let sources): - return ("groupCallParticipantVideoSourceGroup", [("semantics", semantics as Any), ("sources", sources as Any)]) - } - } - + public class Cons_groupCallParticipantVideoSourceGroup { + public var semantics: String + public var sources: [Int32] + public init(semantics: String, sources: [Int32]) { + self.semantics = semantics + self.sources = sources + } + } + case groupCallParticipantVideoSourceGroup(Cons_groupCallParticipantVideoSourceGroup) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallParticipantVideoSourceGroup(let _data): + if boxed { + buffer.appendInt32(-592373577) + } + serializeString(_data.semantics, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.sources.count)) + for item in _data.sources { + serializeInt32(item, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallParticipantVideoSourceGroup(let _data): + return ("groupCallParticipantVideoSourceGroup", [("semantics", _data.semantics as Any), ("sources", _data.sources as Any)]) + } + } + public static func parse_groupCallParticipantVideoSourceGroup(_ reader: BufferReader) -> GroupCallParticipantVideoSourceGroup? { var _1: String? _1 = parseString(reader) @@ -171,39 +247,48 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.GroupCallParticipantVideoSourceGroup.groupCallParticipantVideoSourceGroup(semantics: _1!, sources: _2!) + return Api.GroupCallParticipantVideoSourceGroup.groupCallParticipantVideoSourceGroup(Cons_groupCallParticipantVideoSourceGroup(semantics: _1!, sources: _2!)) } else { return nil } } - } } public extension Api { enum GroupCallStreamChannel: TypeConstructorDescription { - case groupCallStreamChannel(channel: Int32, scale: Int32, lastTimestampMs: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .groupCallStreamChannel(let channel, let scale, let lastTimestampMs): - if boxed { - buffer.appendInt32(-2132064081) - } - serializeInt32(channel, buffer: buffer, boxed: false) - serializeInt32(scale, buffer: buffer, boxed: false) - serializeInt64(lastTimestampMs, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .groupCallStreamChannel(let channel, let scale, let lastTimestampMs): - return ("groupCallStreamChannel", [("channel", channel as Any), ("scale", scale as Any), ("lastTimestampMs", lastTimestampMs as Any)]) - } - } - + public class Cons_groupCallStreamChannel { + public var channel: Int32 + public var scale: Int32 + public var lastTimestampMs: Int64 + public init(channel: Int32, scale: Int32, lastTimestampMs: Int64) { + self.channel = channel + self.scale = scale + self.lastTimestampMs = lastTimestampMs + } + } + case groupCallStreamChannel(Cons_groupCallStreamChannel) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .groupCallStreamChannel(let _data): + if boxed { + buffer.appendInt32(-2132064081) + } + serializeInt32(_data.channel, buffer: buffer, boxed: false) + serializeInt32(_data.scale, buffer: buffer, boxed: false) + serializeInt64(_data.lastTimestampMs, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .groupCallStreamChannel(let _data): + return ("groupCallStreamChannel", [("channel", _data.channel as Any), ("scale", _data.scale as Any), ("lastTimestampMs", _data.lastTimestampMs as Any)]) + } + } + public static func parse_groupCallStreamChannel(_ reader: BufferReader) -> GroupCallStreamChannel? { var _1: Int32? _1 = reader.readInt32() @@ -215,39 +300,48 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.GroupCallStreamChannel.groupCallStreamChannel(channel: _1!, scale: _2!, lastTimestampMs: _3!) + return Api.GroupCallStreamChannel.groupCallStreamChannel(Cons_groupCallStreamChannel(channel: _1!, scale: _2!, lastTimestampMs: _3!)) } else { return nil } } - } } public extension Api { enum HighScore: TypeConstructorDescription { - case highScore(pos: Int32, userId: Int64, score: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .highScore(let pos, let userId, let score): - if boxed { - buffer.appendInt32(1940093419) - } - serializeInt32(pos, buffer: buffer, boxed: false) - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt32(score, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .highScore(let pos, let userId, let score): - return ("highScore", [("pos", pos as Any), ("userId", userId as Any), ("score", score as Any)]) - } - } - + public class Cons_highScore { + public var pos: Int32 + public var userId: Int64 + public var score: Int32 + public init(pos: Int32, userId: Int64, score: Int32) { + self.pos = pos + self.userId = userId + self.score = score + } + } + case highScore(Cons_highScore) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .highScore(let _data): + if boxed { + buffer.appendInt32(1940093419) + } + serializeInt32(_data.pos, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt32(_data.score, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .highScore(let _data): + return ("highScore", [("pos", _data.pos as Any), ("userId", _data.userId as Any), ("score", _data.score as Any)]) + } + } + public static func parse_highScore(_ reader: BufferReader) -> HighScore? { var _1: Int32? _1 = reader.readInt32() @@ -259,38 +353,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.HighScore.highScore(pos: _1!, userId: _2!, score: _3!) + return Api.HighScore.highScore(Cons_highScore(pos: _1!, userId: _2!, score: _3!)) } else { return nil } } - } } public extension Api { enum ImportedContact: TypeConstructorDescription { - case importedContact(userId: Int64, clientId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .importedContact(let userId, let clientId): - if boxed { - buffer.appendInt32(-1052885936) - } - serializeInt64(userId, buffer: buffer, boxed: false) - serializeInt64(clientId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .importedContact(let userId, let clientId): - return ("importedContact", [("userId", userId as Any), ("clientId", clientId as Any)]) - } - } - + public class Cons_importedContact { + public var userId: Int64 + public var clientId: Int64 + public init(userId: Int64, clientId: Int64) { + self.userId = userId + self.clientId = clientId + } + } + case importedContact(Cons_importedContact) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .importedContact(let _data): + if boxed { + buffer.appendInt32(-1052885936) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.clientId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .importedContact(let _data): + return ("importedContact", [("userId", _data.userId as Any), ("clientId", _data.clientId as Any)]) + } + } + public static func parse_importedContact(_ reader: BufferReader) -> ImportedContact? { var _1: Int64? _1 = reader.readInt64() @@ -299,38 +400,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ImportedContact.importedContact(userId: _1!, clientId: _2!) + return Api.ImportedContact.importedContact(Cons_importedContact(userId: _1!, clientId: _2!)) } else { return nil } } - } } public extension Api { enum InlineBotSwitchPM: TypeConstructorDescription { - case inlineBotSwitchPM(text: String, startParam: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inlineBotSwitchPM(let text, let startParam): - if boxed { - buffer.appendInt32(1008755359) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(startParam, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inlineBotSwitchPM(let text, let startParam): - return ("inlineBotSwitchPM", [("text", text as Any), ("startParam", startParam as Any)]) - } - } - + public class Cons_inlineBotSwitchPM { + public var text: String + public var startParam: String + public init(text: String, startParam: String) { + self.text = text + self.startParam = startParam + } + } + case inlineBotSwitchPM(Cons_inlineBotSwitchPM) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inlineBotSwitchPM(let _data): + if boxed { + buffer.appendInt32(1008755359) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.startParam, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inlineBotSwitchPM(let _data): + return ("inlineBotSwitchPM", [("text", _data.text as Any), ("startParam", _data.startParam as Any)]) + } + } + public static func parse_inlineBotSwitchPM(_ reader: BufferReader) -> InlineBotSwitchPM? { var _1: String? _1 = parseString(reader) @@ -339,38 +447,45 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InlineBotSwitchPM.inlineBotSwitchPM(text: _1!, startParam: _2!) + return Api.InlineBotSwitchPM.inlineBotSwitchPM(Cons_inlineBotSwitchPM(text: _1!, startParam: _2!)) } else { return nil } } - } } public extension Api { enum InlineBotWebView: TypeConstructorDescription { - case inlineBotWebView(text: String, url: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inlineBotWebView(let text, let url): - if boxed { - buffer.appendInt32(-1250781739) - } - serializeString(text, buffer: buffer, boxed: false) - serializeString(url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inlineBotWebView(let text, let url): - return ("inlineBotWebView", [("text", text as Any), ("url", url as Any)]) - } - } - + public class Cons_inlineBotWebView { + public var text: String + public var url: String + public init(text: String, url: String) { + self.text = text + self.url = url + } + } + case inlineBotWebView(Cons_inlineBotWebView) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inlineBotWebView(let _data): + if boxed { + buffer.appendInt32(-1250781739) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inlineBotWebView(let _data): + return ("inlineBotWebView", [("text", _data.text as Any), ("url", _data.url as Any)]) + } + } + public static func parse_inlineBotWebView(_ reader: BufferReader) -> InlineBotWebView? { var _1: String? _1 = parseString(reader) @@ -379,13 +494,12 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InlineBotWebView.inlineBotWebView(text: _1!, url: _2!) + return Api.InlineBotWebView.inlineBotWebView(Cons_inlineBotWebView(text: _1!, url: _2!)) } else { return nil } } - } } public extension Api { @@ -396,65 +510,59 @@ public extension Api { case inlineQueryPeerTypeMegagroup case inlineQueryPeerTypePM case inlineQueryPeerTypeSameBotPM - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inlineQueryPeerTypeBotPM: - if boxed { - buffer.appendInt32(238759180) - } - - break - case .inlineQueryPeerTypeBroadcast: - if boxed { - buffer.appendInt32(1664413338) - } - - break - case .inlineQueryPeerTypeChat: - if boxed { - buffer.appendInt32(-681130742) - } - - break - case .inlineQueryPeerTypeMegagroup: - if boxed { - buffer.appendInt32(1589952067) - } - - break - case .inlineQueryPeerTypePM: - if boxed { - buffer.appendInt32(-2093215828) - } - - break - case .inlineQueryPeerTypeSameBotPM: - if boxed { - buffer.appendInt32(813821341) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inlineQueryPeerTypeBotPM: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inlineQueryPeerTypeBotPM: + if boxed { + buffer.appendInt32(238759180) + } + break + case .inlineQueryPeerTypeBroadcast: + if boxed { + buffer.appendInt32(1664413338) + } + break + case .inlineQueryPeerTypeChat: + if boxed { + buffer.appendInt32(-681130742) + } + break + case .inlineQueryPeerTypeMegagroup: + if boxed { + buffer.appendInt32(1589952067) + } + break + case .inlineQueryPeerTypePM: + if boxed { + buffer.appendInt32(-2093215828) + } + break + case .inlineQueryPeerTypeSameBotPM: + if boxed { + buffer.appendInt32(813821341) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inlineQueryPeerTypeBotPM: return ("inlineQueryPeerTypeBotPM", []) - case .inlineQueryPeerTypeBroadcast: + case .inlineQueryPeerTypeBroadcast: return ("inlineQueryPeerTypeBroadcast", []) - case .inlineQueryPeerTypeChat: + case .inlineQueryPeerTypeChat: return ("inlineQueryPeerTypeChat", []) - case .inlineQueryPeerTypeMegagroup: + case .inlineQueryPeerTypeMegagroup: return ("inlineQueryPeerTypeMegagroup", []) - case .inlineQueryPeerTypePM: + case .inlineQueryPeerTypePM: return ("inlineQueryPeerTypePM", []) - case .inlineQueryPeerTypeSameBotPM: + case .inlineQueryPeerTypeSameBotPM: return ("inlineQueryPeerTypeSameBotPM", []) - } - } - + } + } + public static func parse_inlineQueryPeerTypeBotPM(_ reader: BufferReader) -> InlineQueryPeerType? { return Api.InlineQueryPeerType.inlineQueryPeerTypeBotPM } @@ -473,34 +581,45 @@ public extension Api { public static func parse_inlineQueryPeerTypeSameBotPM(_ reader: BufferReader) -> InlineQueryPeerType? { return Api.InlineQueryPeerType.inlineQueryPeerTypeSameBotPM } - } } public extension Api { enum InputAppEvent: TypeConstructorDescription { - case inputAppEvent(time: Double, type: String, peer: Int64, data: Api.JSONValue) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputAppEvent(let time, let type, let peer, let data): - if boxed { - buffer.appendInt32(488313413) - } - serializeDouble(time, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - serializeInt64(peer, buffer: buffer, boxed: false) - data.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputAppEvent(let time, let type, let peer, let data): - return ("inputAppEvent", [("time", time as Any), ("type", type as Any), ("peer", peer as Any), ("data", data as Any)]) - } - } - + public class Cons_inputAppEvent { + public var time: Double + public var type: String + public var peer: Int64 + public var data: Api.JSONValue + public init(time: Double, type: String, peer: Int64, data: Api.JSONValue) { + self.time = time + self.type = type + self.peer = peer + self.data = data + } + } + case inputAppEvent(Cons_inputAppEvent) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputAppEvent(let _data): + if boxed { + buffer.appendInt32(488313413) + } + serializeDouble(_data.time, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + serializeInt64(_data.peer, buffer: buffer, boxed: false) + _data.data.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputAppEvent(let _data): + return ("inputAppEvent", [("time", _data.time as Any), ("type", _data.type as Any), ("peer", _data.peer as Any), ("data", _data.data as Any)]) + } + } + public static func parse_inputAppEvent(_ reader: BufferReader) -> InputAppEvent? { var _1: Double? _1 = reader.readDouble() @@ -517,48 +636,63 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputAppEvent.inputAppEvent(time: _1!, type: _2!, peer: _3!, data: _4!) + return Api.InputAppEvent.inputAppEvent(Cons_inputAppEvent(time: _1!, type: _2!, peer: _3!, data: _4!)) } else { return nil } } - } } public extension Api { indirect enum InputBotApp: TypeConstructorDescription { - case inputBotAppID(id: Int64, accessHash: Int64) - case inputBotAppShortName(botId: Api.InputUser, shortName: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBotAppID(let id, let accessHash): - if boxed { - buffer.appendInt32(-1457472134) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputBotAppShortName(let botId, let shortName): - if boxed { - buffer.appendInt32(-1869872121) - } - botId.serialize(buffer, true) - serializeString(shortName, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBotAppID(let id, let accessHash): - return ("inputBotAppID", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputBotAppShortName(let botId, let shortName): - return ("inputBotAppShortName", [("botId", botId as Any), ("shortName", shortName as Any)]) - } - } - + public class Cons_inputBotAppID { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputBotAppShortName { + public var botId: Api.InputUser + public var shortName: String + public init(botId: Api.InputUser, shortName: String) { + self.botId = botId + self.shortName = shortName + } + } + case inputBotAppID(Cons_inputBotAppID) + case inputBotAppShortName(Cons_inputBotAppShortName) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBotAppID(let _data): + if boxed { + buffer.appendInt32(-1457472134) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputBotAppShortName(let _data): + if boxed { + buffer.appendInt32(-1869872121) + } + _data.botId.serialize(buffer, true) + serializeString(_data.shortName, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBotAppID(let _data): + return ("inputBotAppID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputBotAppShortName(let _data): + return ("inputBotAppShortName", [("botId", _data.botId as Any), ("shortName", _data.shortName as Any)]) + } + } + public static func parse_inputBotAppID(_ reader: BufferReader) -> InputBotApp? { var _1: Int64? _1 = reader.readInt64() @@ -567,7 +701,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputBotApp.inputBotAppID(id: _1!, accessHash: _2!) + return Api.InputBotApp.inputBotAppID(Cons_inputBotAppID(id: _1!, accessHash: _2!)) } else { return nil @@ -583,159 +717,310 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputBotApp.inputBotAppShortName(botId: _1!, shortName: _2!) + return Api.InputBotApp.inputBotAppShortName(Cons_inputBotAppShortName(botId: _1!, shortName: _2!)) } else { return nil } } - } } public extension Api { enum InputBotInlineMessage: TypeConstructorDescription { - case inputBotInlineMessageGame(flags: Int32, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaAuto(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaContact(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaGeo(flags: Int32, geoPoint: Api.InputGeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaInvoice(flags: Int32, title: String, description: String, photo: Api.InputWebDocument?, invoice: Api.Invoice, payload: Buffer, provider: String, providerData: Api.DataJSON, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaVenue(flags: Int32, geoPoint: Api.InputGeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageMediaWebPage(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?) - case inputBotInlineMessageText(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBotInlineMessageGame(let flags, let replyMarkup): - if boxed { - buffer.appendInt32(1262639204) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup): - if boxed { - buffer.appendInt32(864077702) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_inputBotInlineMessageGame { + public var flags: Int32 + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaAuto { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaContact { + public var flags: Int32 + public var phoneNumber: String + public var firstName: String + public var lastName: String + public var vcard: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.phoneNumber = phoneNumber + self.firstName = firstName + self.lastName = lastName + self.vcard = vcard + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaGeo { + public var flags: Int32 + public var geoPoint: Api.InputGeoPoint + public var heading: Int32? + public var period: Int32? + public var proximityNotificationRadius: Int32? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, geoPoint: Api.InputGeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.geoPoint = geoPoint + self.heading = heading + self.period = period + self.proximityNotificationRadius = proximityNotificationRadius + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaInvoice { + public var flags: Int32 + public var title: String + public var description: String + public var photo: Api.InputWebDocument? + public var invoice: Api.Invoice + public var payload: Buffer + public var provider: String + public var providerData: Api.DataJSON + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, title: String, description: String, photo: Api.InputWebDocument?, invoice: Api.Invoice, payload: Buffer, provider: String, providerData: Api.DataJSON, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.title = title + self.description = description + self.photo = photo + self.invoice = invoice + self.payload = payload + self.provider = provider + self.providerData = providerData + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaVenue { + public var flags: Int32 + public var geoPoint: Api.InputGeoPoint + public var title: String + public var address: String + public var provider: String + public var venueId: String + public var venueType: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, geoPoint: Api.InputGeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.geoPoint = geoPoint + self.title = title + self.address = address + self.provider = provider + self.venueId = venueId + self.venueType = venueType + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageMediaWebPage { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var url: String + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.url = url + self.replyMarkup = replyMarkup + } + } + public class Cons_inputBotInlineMessageText { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var replyMarkup: Api.ReplyMarkup? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) { + self.flags = flags + self.message = message + self.entities = entities + self.replyMarkup = replyMarkup + } + } + case inputBotInlineMessageGame(Cons_inputBotInlineMessageGame) + case inputBotInlineMessageMediaAuto(Cons_inputBotInlineMessageMediaAuto) + case inputBotInlineMessageMediaContact(Cons_inputBotInlineMessageMediaContact) + case inputBotInlineMessageMediaGeo(Cons_inputBotInlineMessageMediaGeo) + case inputBotInlineMessageMediaInvoice(Cons_inputBotInlineMessageMediaInvoice) + case inputBotInlineMessageMediaVenue(Cons_inputBotInlineMessageMediaVenue) + case inputBotInlineMessageMediaWebPage(Cons_inputBotInlineMessageMediaWebPage) + case inputBotInlineMessageText(Cons_inputBotInlineMessageText) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBotInlineMessageGame(let _data): + if boxed { + buffer.appendInt32(1262639204) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaAuto(let _data): + if boxed { + buffer.appendInt32(864077702) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup): - if boxed { - buffer.appendInt32(-1494368259) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(phoneNumber, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - serializeString(vcard, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaGeo(let flags, let geoPoint, let heading, let period, let proximityNotificationRadius, let replyMarkup): - if boxed { - buffer.appendInt32(-1768777083) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geoPoint.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 {serializeInt32(heading!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 1) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeInt32(proximityNotificationRadius!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaInvoice(let flags, let title, let description, let photo, let invoice, let payload, let provider, let providerData, let replyMarkup): - if boxed { - buffer.appendInt32(-672693723) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)} - invoice.serialize(buffer, true) - serializeBytes(payload, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - providerData.serialize(buffer, true) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaVenue(let flags, let geoPoint, let title, let address, let provider, let venueId, let venueType, let replyMarkup): - if boxed { - buffer.appendInt32(1098628881) - } - serializeInt32(flags, buffer: buffer, boxed: false) - geoPoint.serialize(buffer, true) - serializeString(title, buffer: buffer, boxed: false) - serializeString(address, buffer: buffer, boxed: false) - serializeString(provider, buffer: buffer, boxed: false) - serializeString(venueId, buffer: buffer, boxed: false) - serializeString(venueType, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup): - if boxed { - buffer.appendInt32(-1109605104) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaContact(let _data): + if boxed { + buffer.appendInt32(-1494368259) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + serializeString(_data.vcard, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaGeo(let _data): + if boxed { + buffer.appendInt32(-1768777083) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geoPoint.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.heading!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.period!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.proximityNotificationRadius!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaInvoice(let _data): + if boxed { + buffer.appendInt32(-672693723) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.photo!.serialize(buffer, true) + } + _data.invoice.serialize(buffer, true) + serializeBytes(_data.payload, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + _data.providerData.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaVenue(let _data): + if boxed { + buffer.appendInt32(1098628881) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.geoPoint.serialize(buffer, true) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.address, buffer: buffer, boxed: false) + serializeString(_data.provider, buffer: buffer, boxed: false) + serializeString(_data.venueId, buffer: buffer, boxed: false) + serializeString(_data.venueType, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageMediaWebPage(let _data): + if boxed { + buffer.appendInt32(-1109605104) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - serializeString(url, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - case .inputBotInlineMessageText(let flags, let message, let entities, let replyMarkup): - if boxed { - buffer.appendInt32(1036876423) } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + } + serializeString(_data.url, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + case .inputBotInlineMessageText(let _data): + if boxed { + buffer.appendInt32(1036876423) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBotInlineMessageGame(let flags, let replyMarkup): - return ("inputBotInlineMessageGame", [("flags", flags as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup): - return ("inputBotInlineMessageMediaAuto", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup): - return ("inputBotInlineMessageMediaContact", [("flags", flags as Any), ("phoneNumber", phoneNumber as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("vcard", vcard as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaGeo(let flags, let geoPoint, let heading, let period, let proximityNotificationRadius, let replyMarkup): - return ("inputBotInlineMessageMediaGeo", [("flags", flags as Any), ("geoPoint", geoPoint as Any), ("heading", heading as Any), ("period", period as Any), ("proximityNotificationRadius", proximityNotificationRadius as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaInvoice(let flags, let title, let description, let photo, let invoice, let payload, let provider, let providerData, let replyMarkup): - return ("inputBotInlineMessageMediaInvoice", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("invoice", invoice as Any), ("payload", payload as Any), ("provider", provider as Any), ("providerData", providerData as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaVenue(let flags, let geoPoint, let title, let address, let provider, let venueId, let venueType, let replyMarkup): - return ("inputBotInlineMessageMediaVenue", [("flags", flags as Any), ("geoPoint", geoPoint as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup): - return ("inputBotInlineMessageMediaWebPage", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("url", url as Any), ("replyMarkup", replyMarkup as Any)]) - case .inputBotInlineMessageText(let flags, let message, let entities, let replyMarkup): - return ("inputBotInlineMessageText", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.replyMarkup!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBotInlineMessageGame(let _data): + return ("inputBotInlineMessageGame", [("flags", _data.flags as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaAuto(let _data): + return ("inputBotInlineMessageMediaAuto", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaContact(let _data): + return ("inputBotInlineMessageMediaContact", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaGeo(let _data): + return ("inputBotInlineMessageMediaGeo", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaInvoice(let _data): + return ("inputBotInlineMessageMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("payload", _data.payload as Any), ("provider", _data.provider as Any), ("providerData", _data.providerData as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaVenue(let _data): + return ("inputBotInlineMessageMediaVenue", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageMediaWebPage(let _data): + return ("inputBotInlineMessageMediaWebPage", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("url", _data.url as Any), ("replyMarkup", _data.replyMarkup as Any)]) + case .inputBotInlineMessageText(let _data): + return ("inputBotInlineMessageText", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + } + } + public static func parse_inputBotInlineMessageGame(_ reader: BufferReader) -> InputBotInlineMessage? { var _1: Int32? _1 = reader.readInt32() var _2: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil if _c1 && _c2 { - return Api.InputBotInlineMessage.inputBotInlineMessageGame(flags: _1!, replyMarkup: _2) + return Api.InputBotInlineMessage.inputBotInlineMessageGame(Cons_inputBotInlineMessageGame(flags: _1!, replyMarkup: _2)) } else { return nil @@ -747,19 +1032,23 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaAuto(Cons_inputBotInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)) } else { return nil @@ -777,9 +1066,11 @@ public extension Api { var _5: String? _5 = parseString(reader) var _6: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -787,7 +1078,7 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaContact(Cons_inputBotInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6)) } else { return nil @@ -801,15 +1092,23 @@ public extension Api { _2 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint } var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() } + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 {_4 = reader.readInt32() } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } var _5: Int32? - if Int(_1!) & Int(1 << 3) != 0 {_5 = reader.readInt32() } + if Int(_1!) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } var _6: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil @@ -817,7 +1116,7 @@ public extension Api { let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaGeo(flags: _1!, geoPoint: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaGeo(Cons_inputBotInlineMessageMediaGeo(flags: _1!, geoPoint: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6)) } else { return nil @@ -831,9 +1130,11 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.InputWebDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputWebDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputWebDocument + } + } var _5: Api.Invoice? if let signature = reader.readInt32() { _5 = Api.parse(reader, signature: signature) as? Api.Invoice @@ -847,9 +1148,11 @@ public extension Api { _8 = Api.parse(reader, signature: signature) as? Api.DataJSON } var _9: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -860,7 +1163,7 @@ public extension Api { let _c8 = _8 != nil let _c9 = (Int(_1!) & Int(1 << 2) == 0) || _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, invoice: _5!, payload: _6!, provider: _7!, providerData: _8!, replyMarkup: _9) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaInvoice(Cons_inputBotInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, invoice: _5!, payload: _6!, provider: _7!, providerData: _8!, replyMarkup: _9)) } else { return nil @@ -884,9 +1187,11 @@ public extension Api { var _7: String? _7 = parseString(reader) var _8: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -896,7 +1201,7 @@ public extension Api { let _c7 = _7 != nil let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaVenue(flags: _1!, geoPoint: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaVenue(Cons_inputBotInlineMessageMediaVenue(flags: _1!, geoPoint: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8)) } else { return nil @@ -908,22 +1213,26 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: String? _4 = parseString(reader) var _5: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputBotInlineMessage.inputBotInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5) + return Api.InputBotInlineMessage.inputBotInlineMessageMediaWebPage(Cons_inputBotInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5)) } else { return nil @@ -935,63 +1244,88 @@ public extension Api { var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: Api.ReplyMarkup? - if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } } + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBotInlineMessage.inputBotInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4) + return Api.InputBotInlineMessage.inputBotInlineMessageText(Cons_inputBotInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)) } else { return nil } } - } } public extension Api { enum InputBotInlineMessageID: TypeConstructorDescription { - case inputBotInlineMessageID(dcId: Int32, id: Int64, accessHash: Int64) - case inputBotInlineMessageID64(dcId: Int32, ownerId: Int64, id: Int32, accessHash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBotInlineMessageID(let dcId, let id, let accessHash): - if boxed { - buffer.appendInt32(-1995686519) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputBotInlineMessageID64(let dcId, let ownerId, let id, let accessHash): - if boxed { - buffer.appendInt32(-1227287081) - } - serializeInt32(dcId, buffer: buffer, boxed: false) - serializeInt64(ownerId, buffer: buffer, boxed: false) - serializeInt32(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBotInlineMessageID(let dcId, let id, let accessHash): - return ("inputBotInlineMessageID", [("dcId", dcId as Any), ("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputBotInlineMessageID64(let dcId, let ownerId, let id, let accessHash): - return ("inputBotInlineMessageID64", [("dcId", dcId as Any), ("ownerId", ownerId as Any), ("id", id as Any), ("accessHash", accessHash as Any)]) - } - } - + public class Cons_inputBotInlineMessageID { + public var dcId: Int32 + public var id: Int64 + public var accessHash: Int64 + public init(dcId: Int32, id: Int64, accessHash: Int64) { + self.dcId = dcId + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputBotInlineMessageID64 { + public var dcId: Int32 + public var ownerId: Int64 + public var id: Int32 + public var accessHash: Int64 + public init(dcId: Int32, ownerId: Int64, id: Int32, accessHash: Int64) { + self.dcId = dcId + self.ownerId = ownerId + self.id = id + self.accessHash = accessHash + } + } + case inputBotInlineMessageID(Cons_inputBotInlineMessageID) + case inputBotInlineMessageID64(Cons_inputBotInlineMessageID64) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBotInlineMessageID(let _data): + if boxed { + buffer.appendInt32(-1995686519) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputBotInlineMessageID64(let _data): + if boxed { + buffer.appendInt32(-1227287081) + } + serializeInt32(_data.dcId, buffer: buffer, boxed: false) + serializeInt64(_data.ownerId, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBotInlineMessageID(let _data): + return ("inputBotInlineMessageID", [("dcId", _data.dcId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputBotInlineMessageID64(let _data): + return ("inputBotInlineMessageID64", [("dcId", _data.dcId as Any), ("ownerId", _data.ownerId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + } + } + public static func parse_inputBotInlineMessageID(_ reader: BufferReader) -> InputBotInlineMessageID? { var _1: Int32? _1 = reader.readInt32() @@ -1003,7 +1337,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputBotInlineMessageID.inputBotInlineMessageID(dcId: _1!, id: _2!, accessHash: _3!) + return Api.InputBotInlineMessageID.inputBotInlineMessageID(Cons_inputBotInlineMessageID(dcId: _1!, id: _2!, accessHash: _3!)) } else { return nil @@ -1023,83 +1357,158 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBotInlineMessageID.inputBotInlineMessageID64(dcId: _1!, ownerId: _2!, id: _3!, accessHash: _4!) + return Api.InputBotInlineMessageID.inputBotInlineMessageID64(Cons_inputBotInlineMessageID64(dcId: _1!, ownerId: _2!, id: _3!, accessHash: _4!)) } else { return nil } } - } } public extension Api { enum InputBotInlineResult: TypeConstructorDescription { - case inputBotInlineResult(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.InputWebDocument?, content: Api.InputWebDocument?, sendMessage: Api.InputBotInlineMessage) - case inputBotInlineResultDocument(flags: Int32, id: String, type: String, title: String?, description: String?, document: Api.InputDocument, sendMessage: Api.InputBotInlineMessage) - case inputBotInlineResultGame(id: String, shortName: String, sendMessage: Api.InputBotInlineMessage) - case inputBotInlineResultPhoto(id: String, type: String, photo: Api.InputPhoto, sendMessage: Api.InputBotInlineMessage) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBotInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage): - if boxed { - buffer.appendInt32(-2000710887) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {serializeString(url!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 4) != 0 {thumb!.serialize(buffer, true)} - if Int(flags) & Int(1 << 5) != 0 {content!.serialize(buffer, true)} - sendMessage.serialize(buffer, true) - break - case .inputBotInlineResultDocument(let flags, let id, let type, let title, let description, let document, let sendMessage): - if boxed { - buffer.appendInt32(-459324) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(id, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 2) != 0 {serializeString(description!, buffer: buffer, boxed: false)} - document.serialize(buffer, true) - sendMessage.serialize(buffer, true) - break - case .inputBotInlineResultGame(let id, let shortName, let sendMessage): - if boxed { - buffer.appendInt32(1336154098) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(shortName, buffer: buffer, boxed: false) - sendMessage.serialize(buffer, true) - break - case .inputBotInlineResultPhoto(let id, let type, let photo, let sendMessage): - if boxed { - buffer.appendInt32(-1462213465) - } - serializeString(id, buffer: buffer, boxed: false) - serializeString(type, buffer: buffer, boxed: false) - photo.serialize(buffer, true) - sendMessage.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBotInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage): - return ("inputBotInlineResult", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("title", title as Any), ("description", description as Any), ("url", url as Any), ("thumb", thumb as Any), ("content", content as Any), ("sendMessage", sendMessage as Any)]) - case .inputBotInlineResultDocument(let flags, let id, let type, let title, let description, let document, let sendMessage): - return ("inputBotInlineResultDocument", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("title", title as Any), ("description", description as Any), ("document", document as Any), ("sendMessage", sendMessage as Any)]) - case .inputBotInlineResultGame(let id, let shortName, let sendMessage): - return ("inputBotInlineResultGame", [("id", id as Any), ("shortName", shortName as Any), ("sendMessage", sendMessage as Any)]) - case .inputBotInlineResultPhoto(let id, let type, let photo, let sendMessage): - return ("inputBotInlineResultPhoto", [("id", id as Any), ("type", type as Any), ("photo", photo as Any), ("sendMessage", sendMessage as Any)]) - } - } - + public class Cons_inputBotInlineResult { + public var flags: Int32 + public var id: String + public var type: String + public var title: String? + public var description: String? + public var url: String? + public var thumb: Api.InputWebDocument? + public var content: Api.InputWebDocument? + public var sendMessage: Api.InputBotInlineMessage + public init(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.InputWebDocument?, content: Api.InputWebDocument?, sendMessage: Api.InputBotInlineMessage) { + self.flags = flags + self.id = id + self.type = type + self.title = title + self.description = description + self.url = url + self.thumb = thumb + self.content = content + self.sendMessage = sendMessage + } + } + public class Cons_inputBotInlineResultDocument { + public var flags: Int32 + public var id: String + public var type: String + public var title: String? + public var description: String? + public var document: Api.InputDocument + public var sendMessage: Api.InputBotInlineMessage + public init(flags: Int32, id: String, type: String, title: String?, description: String?, document: Api.InputDocument, sendMessage: Api.InputBotInlineMessage) { + self.flags = flags + self.id = id + self.type = type + self.title = title + self.description = description + self.document = document + self.sendMessage = sendMessage + } + } + public class Cons_inputBotInlineResultGame { + public var id: String + public var shortName: String + public var sendMessage: Api.InputBotInlineMessage + public init(id: String, shortName: String, sendMessage: Api.InputBotInlineMessage) { + self.id = id + self.shortName = shortName + self.sendMessage = sendMessage + } + } + public class Cons_inputBotInlineResultPhoto { + public var id: String + public var type: String + public var photo: Api.InputPhoto + public var sendMessage: Api.InputBotInlineMessage + public init(id: String, type: String, photo: Api.InputPhoto, sendMessage: Api.InputBotInlineMessage) { + self.id = id + self.type = type + self.photo = photo + self.sendMessage = sendMessage + } + } + case inputBotInlineResult(Cons_inputBotInlineResult) + case inputBotInlineResultDocument(Cons_inputBotInlineResultDocument) + case inputBotInlineResultGame(Cons_inputBotInlineResultGame) + case inputBotInlineResultPhoto(Cons_inputBotInlineResultPhoto) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBotInlineResult(let _data): + if boxed { + buffer.appendInt32(-2000710887) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.thumb!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 5) != 0 { + _data.content!.serialize(buffer, true) + } + _data.sendMessage.serialize(buffer, true) + break + case .inputBotInlineResultDocument(let _data): + if boxed { + buffer.appendInt32(-459324) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.description!, buffer: buffer, boxed: false) + } + _data.document.serialize(buffer, true) + _data.sendMessage.serialize(buffer, true) + break + case .inputBotInlineResultGame(let _data): + if boxed { + buffer.appendInt32(1336154098) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.shortName, buffer: buffer, boxed: false) + _data.sendMessage.serialize(buffer, true) + break + case .inputBotInlineResultPhoto(let _data): + if boxed { + buffer.appendInt32(-1462213465) + } + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.type, buffer: buffer, boxed: false) + _data.photo.serialize(buffer, true) + _data.sendMessage.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBotInlineResult(let _data): + return ("inputBotInlineResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any), ("thumb", _data.thumb as Any), ("content", _data.content as Any), ("sendMessage", _data.sendMessage as Any)]) + case .inputBotInlineResultDocument(let _data): + return ("inputBotInlineResultDocument", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("document", _data.document as Any), ("sendMessage", _data.sendMessage as Any)]) + case .inputBotInlineResultGame(let _data): + return ("inputBotInlineResultGame", [("id", _data.id as Any), ("shortName", _data.shortName as Any), ("sendMessage", _data.sendMessage as Any)]) + case .inputBotInlineResultPhoto(let _data): + return ("inputBotInlineResultPhoto", [("id", _data.id as Any), ("type", _data.type as Any), ("photo", _data.photo as Any), ("sendMessage", _data.sendMessage as Any)]) + } + } + public static func parse_inputBotInlineResult(_ reader: BufferReader) -> InputBotInlineResult? { var _1: Int32? _1 = reader.readInt32() @@ -1108,19 +1517,29 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: String? - if Int(_1!) & Int(1 << 3) != 0 {_6 = parseString(reader) } + if Int(_1!) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } var _7: Api.InputWebDocument? - if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.InputWebDocument - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.InputWebDocument + } + } var _8: Api.InputWebDocument? - if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.InputWebDocument - } } + if Int(_1!) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.InputWebDocument + } + } var _9: Api.InputBotInlineMessage? if let signature = reader.readInt32() { _9 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessage @@ -1135,7 +1554,7 @@ public extension Api { let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.InputBotInlineResult.inputBotInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!) + return Api.InputBotInlineResult.inputBotInlineResult(Cons_inputBotInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!)) } else { return nil @@ -1149,9 +1568,13 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } var _5: String? - if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) } + if Int(_1!) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } var _6: Api.InputDocument? if let signature = reader.readInt32() { _6 = Api.parse(reader, signature: signature) as? Api.InputDocument @@ -1168,7 +1591,7 @@ public extension Api { let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.InputBotInlineResult.inputBotInlineResultDocument(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, document: _6!, sendMessage: _7!) + return Api.InputBotInlineResult.inputBotInlineResultDocument(Cons_inputBotInlineResultDocument(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, document: _6!, sendMessage: _7!)) } else { return nil @@ -1187,7 +1610,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputBotInlineResult.inputBotInlineResultGame(id: _1!, shortName: _2!, sendMessage: _3!) + return Api.InputBotInlineResult.inputBotInlineResultGame(Cons_inputBotInlineResultGame(id: _1!, shortName: _2!, sendMessage: _3!)) } else { return nil @@ -1211,40 +1634,51 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBotInlineResult.inputBotInlineResultPhoto(id: _1!, type: _2!, photo: _3!, sendMessage: _4!) + return Api.InputBotInlineResult.inputBotInlineResultPhoto(Cons_inputBotInlineResultPhoto(id: _1!, type: _2!, photo: _3!, sendMessage: _4!)) } else { return nil } } - } } public extension Api { enum InputBusinessAwayMessage: TypeConstructorDescription { - case inputBusinessAwayMessage(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.InputBusinessRecipients) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessAwayMessage(let flags, let shortcutId, let schedule, let recipients): - if boxed { - buffer.appendInt32(-2094959136) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt32(shortcutId, buffer: buffer, boxed: false) - schedule.serialize(buffer, true) - recipients.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessAwayMessage(let flags, let shortcutId, let schedule, let recipients): - return ("inputBusinessAwayMessage", [("flags", flags as Any), ("shortcutId", shortcutId as Any), ("schedule", schedule as Any), ("recipients", recipients as Any)]) - } - } - + public class Cons_inputBusinessAwayMessage { + public var flags: Int32 + public var shortcutId: Int32 + public var schedule: Api.BusinessAwayMessageSchedule + public var recipients: Api.InputBusinessRecipients + public init(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.InputBusinessRecipients) { + self.flags = flags + self.shortcutId = shortcutId + self.schedule = schedule + self.recipients = recipients + } + } + case inputBusinessAwayMessage(Cons_inputBusinessAwayMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessAwayMessage(let _data): + if boxed { + buffer.appendInt32(-2094959136) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + _data.schedule.serialize(buffer, true) + _data.recipients.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessAwayMessage(let _data): + return ("inputBusinessAwayMessage", [("flags", _data.flags as Any), ("shortcutId", _data.shortcutId as Any), ("schedule", _data.schedule as Any), ("recipients", _data.recipients as Any)]) + } + } + public static func parse_inputBusinessAwayMessage(_ reader: BufferReader) -> InputBusinessAwayMessage? { var _1: Int32? _1 = reader.readInt32() @@ -1263,12 +1697,11 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBusinessAwayMessage.inputBusinessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!) + return Api.InputBusinessAwayMessage.inputBusinessAwayMessage(Cons_inputBusinessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!)) } else { return nil } } - } } diff --git a/submodules/TelegramApi/Sources/Api9.swift b/submodules/TelegramApi/Sources/Api9.swift index a5bae12574..34ea7cd889 100644 --- a/submodules/TelegramApi/Sources/Api9.swift +++ b/submodules/TelegramApi/Sources/Api9.swift @@ -1,137 +1,183 @@ public extension Api { enum InputBusinessBotRecipients: TypeConstructorDescription { - case inputBusinessBotRecipients(flags: Int32, users: [Api.InputUser]?, excludeUsers: [Api.InputUser]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessBotRecipients(let flags, let users, let excludeUsers): - if boxed { - buffer.appendInt32(-991587810) + public class Cons_inputBusinessBotRecipients { + public var flags: Int32 + public var users: [Api.InputUser]? + public var excludeUsers: [Api.InputUser]? + public init(flags: Int32, users: [Api.InputUser]?, excludeUsers: [Api.InputUser]?) { + self.flags = flags + self.users = users + self.excludeUsers = excludeUsers + } + } + case inputBusinessBotRecipients(Cons_inputBusinessBotRecipients) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessBotRecipients(let _data): + if boxed { + buffer.appendInt32(-991587810) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users!.count)) + for item in _data.users! { + item.serialize(buffer, true) } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users!.count)) - for item in users! { + } + if Int(_data.flags) & Int(1 << 6) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.excludeUsers!.count)) + for item in _data.excludeUsers! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(excludeUsers!.count)) - for item in excludeUsers! { - item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessBotRecipients(let flags, let users, let excludeUsers): - return ("inputBusinessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessBotRecipients(let _data): + return ("inputBusinessBotRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any), ("excludeUsers", _data.excludeUsers as Any)]) + } + } + public static func parse_inputBusinessBotRecipients(_ reader: BufferReader) -> InputBusinessBotRecipients? { var _1: Int32? _1 = reader.readInt32() var _2: [Api.InputUser]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + } var _3: [Api.InputUser]? - if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } } + if Int(_1!) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.InputBusinessBotRecipients.inputBusinessBotRecipients(flags: _1!, users: _2, excludeUsers: _3) + return Api.InputBusinessBotRecipients.inputBusinessBotRecipients(Cons_inputBusinessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)) } else { return nil } } - } } public extension Api { enum InputBusinessChatLink: TypeConstructorDescription { - case inputBusinessChatLink(flags: Int32, message: String, entities: [Api.MessageEntity]?, title: String?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessChatLink(let flags, let message, let entities, let title): - if boxed { - buffer.appendInt32(292003751) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(message, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(entities!.count)) - for item in entities! { + public class Cons_inputBusinessChatLink { + public var flags: Int32 + public var message: String + public var entities: [Api.MessageEntity]? + public var title: String? + public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, title: String?) { + self.flags = flags + self.message = message + self.entities = entities + self.title = title + } + } + case inputBusinessChatLink(Cons_inputBusinessChatLink) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessChatLink(let _data): + if boxed { + buffer.appendInt32(292003751) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.message, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) - }} - if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessChatLink(let flags, let message, let entities, let title): - return ("inputBusinessChatLink", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("title", title as Any)]) - } - } - + } + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessChatLink(let _data): + return ("inputBusinessChatLink", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("title", _data.title as Any)]) + } + } + public static func parse_inputBusinessChatLink(_ reader: BufferReader) -> InputBusinessChatLink? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) var _3: [Api.MessageEntity]? - if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } var _4: String? - if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) } + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBusinessChatLink.inputBusinessChatLink(flags: _1!, message: _2!, entities: _3, title: _4) + return Api.InputBusinessChatLink.inputBusinessChatLink(Cons_inputBusinessChatLink(flags: _1!, message: _2!, entities: _3, title: _4)) } else { return nil } } - } } public extension Api { enum InputBusinessGreetingMessage: TypeConstructorDescription { - case inputBusinessGreetingMessage(shortcutId: Int32, recipients: Api.InputBusinessRecipients, noActivityDays: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessGreetingMessage(let shortcutId, let recipients, let noActivityDays): - if boxed { - buffer.appendInt32(26528571) - } - serializeInt32(shortcutId, buffer: buffer, boxed: false) - recipients.serialize(buffer, true) - serializeInt32(noActivityDays, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessGreetingMessage(let shortcutId, let recipients, let noActivityDays): - return ("inputBusinessGreetingMessage", [("shortcutId", shortcutId as Any), ("recipients", recipients as Any), ("noActivityDays", noActivityDays as Any)]) - } - } - + public class Cons_inputBusinessGreetingMessage { + public var shortcutId: Int32 + public var recipients: Api.InputBusinessRecipients + public var noActivityDays: Int32 + public init(shortcutId: Int32, recipients: Api.InputBusinessRecipients, noActivityDays: Int32) { + self.shortcutId = shortcutId + self.recipients = recipients + self.noActivityDays = noActivityDays + } + } + case inputBusinessGreetingMessage(Cons_inputBusinessGreetingMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessGreetingMessage(let _data): + if boxed { + buffer.appendInt32(26528571) + } + serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) + _data.recipients.serialize(buffer, true) + serializeInt32(_data.noActivityDays, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessGreetingMessage(let _data): + return ("inputBusinessGreetingMessage", [("shortcutId", _data.shortcutId as Any), ("recipients", _data.recipients as Any), ("noActivityDays", _data.noActivityDays as Any)]) + } + } + public static func parse_inputBusinessGreetingMessage(_ reader: BufferReader) -> InputBusinessGreetingMessage? { var _1: Int32? _1 = reader.readInt32() @@ -145,40 +191,53 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputBusinessGreetingMessage.inputBusinessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!) + return Api.InputBusinessGreetingMessage.inputBusinessGreetingMessage(Cons_inputBusinessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!)) } else { return nil } } - } } public extension Api { enum InputBusinessIntro: TypeConstructorDescription { - case inputBusinessIntro(flags: Int32, title: String, description: String, sticker: Api.InputDocument?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessIntro(let flags, let title, let description, let sticker): - if boxed { - buffer.appendInt32(163867085) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(description, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {sticker!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessIntro(let flags, let title, let description, let sticker): - return ("inputBusinessIntro", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("sticker", sticker as Any)]) - } - } - + public class Cons_inputBusinessIntro { + public var flags: Int32 + public var title: String + public var description: String + public var sticker: Api.InputDocument? + public init(flags: Int32, title: String, description: String, sticker: Api.InputDocument?) { + self.flags = flags + self.title = title + self.description = description + self.sticker = sticker + } + } + case inputBusinessIntro(Cons_inputBusinessIntro) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessIntro(let _data): + if boxed { + buffer.appendInt32(163867085) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.description, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.sticker!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessIntro(let _data): + return ("inputBusinessIntro", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sticker", _data.sticker as Any)]) + } + } + public static func parse_inputBusinessIntro(_ reader: BufferReader) -> InputBusinessIntro? { var _1: Int32? _1 = reader.readInt32() @@ -187,112 +246,141 @@ public extension Api { var _3: String? _3 = parseString(reader) var _4: Api.InputDocument? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputDocument - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputBusinessIntro.inputBusinessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4) + return Api.InputBusinessIntro.inputBusinessIntro(Cons_inputBusinessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4)) } else { return nil } } - } } public extension Api { enum InputBusinessRecipients: TypeConstructorDescription { - case inputBusinessRecipients(flags: Int32, users: [Api.InputUser]?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputBusinessRecipients(let flags, let users): - if boxed { - buffer.appendInt32(1871393450) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261) - buffer.appendInt32(Int32(users!.count)) - for item in users! { + public class Cons_inputBusinessRecipients { + public var flags: Int32 + public var users: [Api.InputUser]? + public init(flags: Int32, users: [Api.InputUser]?) { + self.flags = flags + self.users = users + } + } + case inputBusinessRecipients(Cons_inputBusinessRecipients) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputBusinessRecipients(let _data): + if boxed { + buffer.appendInt32(1871393450) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 4) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users!.count)) + for item in _data.users! { item.serialize(buffer, true) - }} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputBusinessRecipients(let flags, let users): - return ("inputBusinessRecipients", [("flags", flags as Any), ("users", users as Any)]) - } - } - + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputBusinessRecipients(let _data): + return ("inputBusinessRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any)]) + } + } + public static func parse_inputBusinessRecipients(_ reader: BufferReader) -> InputBusinessRecipients? { var _1: Int32? _1 = reader.readInt32() var _2: [Api.InputUser]? - if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } } + if Int(_1!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil if _c1 && _c2 { - return Api.InputBusinessRecipients.inputBusinessRecipients(flags: _1!, users: _2) + return Api.InputBusinessRecipients.inputBusinessRecipients(Cons_inputBusinessRecipients(flags: _1!, users: _2)) } else { return nil } } - } } public extension Api { indirect enum InputChannel: TypeConstructorDescription { - case inputChannel(channelId: Int64, accessHash: Int64) + public class Cons_inputChannel { + public var channelId: Int64 + public var accessHash: Int64 + public init(channelId: Int64, accessHash: Int64) { + self.channelId = channelId + self.accessHash = accessHash + } + } + public class Cons_inputChannelFromMessage { + public var peer: Api.InputPeer + public var msgId: Int32 + public var channelId: Int64 + public init(peer: Api.InputPeer, msgId: Int32, channelId: Int64) { + self.peer = peer + self.msgId = msgId + self.channelId = channelId + } + } + case inputChannel(Cons_inputChannel) case inputChannelEmpty - case inputChannelFromMessage(peer: Api.InputPeer, msgId: Int32, channelId: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputChannel(let channelId, let accessHash): - if boxed { - buffer.appendInt32(-212145112) - } - serializeInt64(channelId, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputChannelEmpty: - if boxed { - buffer.appendInt32(-292807034) - } - - break - case .inputChannelFromMessage(let peer, let msgId, let channelId): - if boxed { - buffer.appendInt32(1536380829) - } - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(channelId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputChannel(let channelId, let accessHash): - return ("inputChannel", [("channelId", channelId as Any), ("accessHash", accessHash as Any)]) - case .inputChannelEmpty: + case inputChannelFromMessage(Cons_inputChannelFromMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputChannel(let _data): + if boxed { + buffer.appendInt32(-212145112) + } + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputChannelEmpty: + if boxed { + buffer.appendInt32(-292807034) + } + break + case .inputChannelFromMessage(let _data): + if boxed { + buffer.appendInt32(1536380829) + } + _data.peer.serialize(buffer, true) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputChannel(let _data): + return ("inputChannel", [("channelId", _data.channelId as Any), ("accessHash", _data.accessHash as Any)]) + case .inputChannelEmpty: return ("inputChannelEmpty", []) - case .inputChannelFromMessage(let peer, let msgId, let channelId): - return ("inputChannelFromMessage", [("peer", peer as Any), ("msgId", msgId as Any), ("channelId", channelId as Any)]) - } - } - + case .inputChannelFromMessage(let _data): + return ("inputChannelFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("channelId", _data.channelId as Any)]) + } + } + public static func parse_inputChannel(_ reader: BufferReader) -> InputChannel? { var _1: Int64? _1 = reader.readInt64() @@ -301,7 +389,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputChannel.inputChannel(channelId: _1!, accessHash: _2!) + return Api.InputChannel.inputChannel(Cons_inputChannel(channelId: _1!, accessHash: _2!)) } else { return nil @@ -323,59 +411,85 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputChannel.inputChannelFromMessage(peer: _1!, msgId: _2!, channelId: _3!) + return Api.InputChannel.inputChannelFromMessage(Cons_inputChannelFromMessage(peer: _1!, msgId: _2!, channelId: _3!)) } else { return nil } } - } } public extension Api { enum InputChatPhoto: TypeConstructorDescription { - case inputChatPhoto(id: Api.InputPhoto) + public class Cons_inputChatPhoto { + public var id: Api.InputPhoto + public init(id: Api.InputPhoto) { + self.id = id + } + } + public class Cons_inputChatUploadedPhoto { + public var flags: Int32 + public var file: Api.InputFile? + public var video: Api.InputFile? + public var videoStartTs: Double? + public var videoEmojiMarkup: Api.VideoSize? + public init(flags: Int32, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) { + self.flags = flags + self.file = file + self.video = video + self.videoStartTs = videoStartTs + self.videoEmojiMarkup = videoEmojiMarkup + } + } + case inputChatPhoto(Cons_inputChatPhoto) case inputChatPhotoEmpty - case inputChatUploadedPhoto(flags: Int32, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputChatPhoto(let id): - if boxed { - buffer.appendInt32(-1991004873) - } - id.serialize(buffer, true) - break - case .inputChatPhotoEmpty: - if boxed { - buffer.appendInt32(480546647) - } - - break - case .inputChatUploadedPhoto(let flags, let file, let video, let videoStartTs, let videoEmojiMarkup): - if boxed { - buffer.appendInt32(-1110593856) - } - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {file!.serialize(buffer, true)} - if Int(flags) & Int(1 << 1) != 0 {video!.serialize(buffer, true)} - if Int(flags) & Int(1 << 2) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)} - if Int(flags) & Int(1 << 3) != 0 {videoEmojiMarkup!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputChatPhoto(let id): - return ("inputChatPhoto", [("id", id as Any)]) - case .inputChatPhotoEmpty: + case inputChatUploadedPhoto(Cons_inputChatUploadedPhoto) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputChatPhoto(let _data): + if boxed { + buffer.appendInt32(-1991004873) + } + _data.id.serialize(buffer, true) + break + case .inputChatPhotoEmpty: + if boxed { + buffer.appendInt32(480546647) + } + break + case .inputChatUploadedPhoto(let _data): + if boxed { + buffer.appendInt32(-1110593856) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.file!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.video!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeDouble(_data.videoStartTs!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + _data.videoEmojiMarkup!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputChatPhoto(let _data): + return ("inputChatPhoto", [("id", _data.id as Any)]) + case .inputChatPhotoEmpty: return ("inputChatPhotoEmpty", []) - case .inputChatUploadedPhoto(let flags, let file, let video, let videoStartTs, let videoEmojiMarkup): - return ("inputChatUploadedPhoto", [("flags", flags as Any), ("file", file as Any), ("video", video as Any), ("videoStartTs", videoStartTs as Any), ("videoEmojiMarkup", videoEmojiMarkup as Any)]) - } - } - + case .inputChatUploadedPhoto(let _data): + return ("inputChatUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("video", _data.video as Any), ("videoStartTs", _data.videoStartTs as Any), ("videoEmojiMarkup", _data.videoEmojiMarkup as Any)]) + } + } + public static func parse_inputChatPhoto(_ reader: BufferReader) -> InputChatPhoto? { var _1: Api.InputPhoto? if let signature = reader.readInt32() { @@ -383,7 +497,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputChatPhoto.inputChatPhoto(id: _1!) + return Api.InputChatPhoto.inputChatPhoto(Cons_inputChatPhoto(id: _1!)) } else { return nil @@ -396,80 +510,98 @@ public extension Api { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputFile? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputFile - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputFile + } + } var _3: Api.InputFile? - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputFile - } } + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputFile + } + } var _4: Double? - if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readDouble() } + if Int(_1!) & Int(1 << 2) != 0 { + _4 = reader.readDouble() + } var _5: Api.VideoSize? - if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.VideoSize - } } + if Int(_1!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.VideoSize + } + } let _c1 = _1 != nil let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.InputChatPhoto.inputChatUploadedPhoto(flags: _1!, file: _2, video: _3, videoStartTs: _4, videoEmojiMarkup: _5) + return Api.InputChatPhoto.inputChatUploadedPhoto(Cons_inputChatUploadedPhoto(flags: _1!, file: _2, video: _3, videoStartTs: _4, videoEmojiMarkup: _5)) } else { return nil } } - } } public extension Api { enum InputChatTheme: TypeConstructorDescription { - case inputChatTheme(emoticon: String) + public class Cons_inputChatTheme { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + } + public class Cons_inputChatThemeUniqueGift { + public var slug: String + public init(slug: String) { + self.slug = slug + } + } + case inputChatTheme(Cons_inputChatTheme) case inputChatThemeEmpty - case inputChatThemeUniqueGift(slug: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputChatTheme(let emoticon): - if boxed { - buffer.appendInt32(-918689444) - } - serializeString(emoticon, buffer: buffer, boxed: false) - break - case .inputChatThemeEmpty: - if boxed { - buffer.appendInt32(-2094627709) - } - - break - case .inputChatThemeUniqueGift(let slug): - if boxed { - buffer.appendInt32(-2014978076) - } - serializeString(slug, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputChatTheme(let emoticon): - return ("inputChatTheme", [("emoticon", emoticon as Any)]) - case .inputChatThemeEmpty: + case inputChatThemeUniqueGift(Cons_inputChatThemeUniqueGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputChatTheme(let _data): + if boxed { + buffer.appendInt32(-918689444) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .inputChatThemeEmpty: + if boxed { + buffer.appendInt32(-2094627709) + } + break + case .inputChatThemeUniqueGift(let _data): + if boxed { + buffer.appendInt32(-2014978076) + } + serializeString(_data.slug, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputChatTheme(let _data): + return ("inputChatTheme", [("emoticon", _data.emoticon as Any)]) + case .inputChatThemeEmpty: return ("inputChatThemeEmpty", []) - case .inputChatThemeUniqueGift(let slug): - return ("inputChatThemeUniqueGift", [("slug", slug as Any)]) - } - } - + case .inputChatThemeUniqueGift(let _data): + return ("inputChatThemeUniqueGift", [("slug", _data.slug as Any)]) + } + } + public static func parse_inputChatTheme(_ reader: BufferReader) -> InputChatTheme? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputChatTheme.inputChatTheme(emoticon: _1!) + return Api.InputChatTheme.inputChatTheme(Cons_inputChatTheme(emoticon: _1!)) } else { return nil @@ -483,84 +615,97 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputChatTheme.inputChatThemeUniqueGift(slug: _1!) + return Api.InputChatTheme.inputChatThemeUniqueGift(Cons_inputChatThemeUniqueGift(slug: _1!)) } else { return nil } } - } } public extension Api { enum InputChatlist: TypeConstructorDescription { - case inputChatlistDialogFilter(filterId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputChatlistDialogFilter(let filterId): - if boxed { - buffer.appendInt32(-203367885) - } - serializeInt32(filterId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputChatlistDialogFilter(let filterId): - return ("inputChatlistDialogFilter", [("filterId", filterId as Any)]) - } - } - + public class Cons_inputChatlistDialogFilter { + public var filterId: Int32 + public init(filterId: Int32) { + self.filterId = filterId + } + } + case inputChatlistDialogFilter(Cons_inputChatlistDialogFilter) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputChatlistDialogFilter(let _data): + if boxed { + buffer.appendInt32(-203367885) + } + serializeInt32(_data.filterId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputChatlistDialogFilter(let _data): + return ("inputChatlistDialogFilter", [("filterId", _data.filterId as Any)]) + } + } + public static func parse_inputChatlistDialogFilter(_ reader: BufferReader) -> InputChatlist? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputChatlist.inputChatlistDialogFilter(filterId: _1!) + return Api.InputChatlist.inputChatlistDialogFilter(Cons_inputChatlistDialogFilter(filterId: _1!)) } else { return nil } } - } } public extension Api { enum InputCheckPasswordSRP: TypeConstructorDescription { + public class Cons_inputCheckPasswordSRP { + public var srpId: Int64 + public var A: Buffer + public var M1: Buffer + public init(srpId: Int64, A: Buffer, M1: Buffer) { + self.srpId = srpId + self.A = A + self.M1 = M1 + } + } case inputCheckPasswordEmpty - case inputCheckPasswordSRP(srpId: Int64, A: Buffer, M1: Buffer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputCheckPasswordEmpty: - if boxed { - buffer.appendInt32(-1736378792) - } - - break - case .inputCheckPasswordSRP(let srpId, let A, let M1): - if boxed { - buffer.appendInt32(-763367294) - } - serializeInt64(srpId, buffer: buffer, boxed: false) - serializeBytes(A, buffer: buffer, boxed: false) - serializeBytes(M1, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputCheckPasswordEmpty: + case inputCheckPasswordSRP(Cons_inputCheckPasswordSRP) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputCheckPasswordEmpty: + if boxed { + buffer.appendInt32(-1736378792) + } + break + case .inputCheckPasswordSRP(let _data): + if boxed { + buffer.appendInt32(-763367294) + } + serializeInt64(_data.srpId, buffer: buffer, boxed: false) + serializeBytes(_data.A, buffer: buffer, boxed: false) + serializeBytes(_data.M1, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputCheckPasswordEmpty: return ("inputCheckPasswordEmpty", []) - case .inputCheckPasswordSRP(let srpId, let A, let M1): - return ("inputCheckPasswordSRP", [("srpId", srpId as Any), ("A", A as Any), ("M1", M1 as Any)]) - } - } - + case .inputCheckPasswordSRP(let _data): + return ("inputCheckPasswordSRP", [("srpId", _data.srpId as Any), ("A", _data.A as Any), ("M1", _data.M1 as Any)]) + } + } + public static func parse_inputCheckPasswordEmpty(_ reader: BufferReader) -> InputCheckPasswordSRP? { return Api.InputCheckPasswordSRP.inputCheckPasswordEmpty } @@ -575,38 +720,45 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputCheckPasswordSRP.inputCheckPasswordSRP(srpId: _1!, A: _2!, M1: _3!) + return Api.InputCheckPasswordSRP.inputCheckPasswordSRP(Cons_inputCheckPasswordSRP(srpId: _1!, A: _2!, M1: _3!)) } else { return nil } } - } } public extension Api { enum InputClientProxy: TypeConstructorDescription { - case inputClientProxy(address: String, port: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputClientProxy(let address, let port): - if boxed { - buffer.appendInt32(1968737087) - } - serializeString(address, buffer: buffer, boxed: false) - serializeInt32(port, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputClientProxy(let address, let port): - return ("inputClientProxy", [("address", address as Any), ("port", port as Any)]) - } - } - + public class Cons_inputClientProxy { + public var address: String + public var port: Int32 + public init(address: String, port: Int32) { + self.address = address + self.port = port + } + } + case inputClientProxy(Cons_inputClientProxy) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputClientProxy(let _data): + if boxed { + buffer.appendInt32(1968737087) + } + serializeString(_data.address, buffer: buffer, boxed: false) + serializeInt32(_data.port, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputClientProxy(let _data): + return ("inputClientProxy", [("address", _data.address as Any), ("port", _data.port as Any)]) + } + } + public static func parse_inputClientProxy(_ reader: BufferReader) -> InputClientProxy? { var _1: String? _1 = parseString(reader) @@ -615,52 +767,63 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputClientProxy.inputClientProxy(address: _1!, port: _2!) + return Api.InputClientProxy.inputClientProxy(Cons_inputClientProxy(address: _1!, port: _2!)) } else { return nil } } - } } public extension Api { enum InputCollectible: TypeConstructorDescription { - case inputCollectiblePhone(phone: String) - case inputCollectibleUsername(username: String) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputCollectiblePhone(let phone): - if boxed { - buffer.appendInt32(-1562241884) - } - serializeString(phone, buffer: buffer, boxed: false) - break - case .inputCollectibleUsername(let username): - if boxed { - buffer.appendInt32(-476815191) - } - serializeString(username, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputCollectiblePhone(let phone): - return ("inputCollectiblePhone", [("phone", phone as Any)]) - case .inputCollectibleUsername(let username): - return ("inputCollectibleUsername", [("username", username as Any)]) - } - } - + public class Cons_inputCollectiblePhone { + public var phone: String + public init(phone: String) { + self.phone = phone + } + } + public class Cons_inputCollectibleUsername { + public var username: String + public init(username: String) { + self.username = username + } + } + case inputCollectiblePhone(Cons_inputCollectiblePhone) + case inputCollectibleUsername(Cons_inputCollectibleUsername) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputCollectiblePhone(let _data): + if boxed { + buffer.appendInt32(-1562241884) + } + serializeString(_data.phone, buffer: buffer, boxed: false) + break + case .inputCollectibleUsername(let _data): + if boxed { + buffer.appendInt32(-476815191) + } + serializeString(_data.username, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputCollectiblePhone(let _data): + return ("inputCollectiblePhone", [("phone", _data.phone as Any)]) + case .inputCollectibleUsername(let _data): + return ("inputCollectibleUsername", [("username", _data.username as Any)]) + } + } + public static func parse_inputCollectiblePhone(_ reader: BufferReader) -> InputCollectible? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputCollectible.inputCollectiblePhone(phone: _1!) + return Api.InputCollectible.inputCollectiblePhone(Cons_inputCollectiblePhone(phone: _1!)) } else { return nil @@ -671,42 +834,59 @@ public extension Api { _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.InputCollectible.inputCollectibleUsername(username: _1!) + return Api.InputCollectible.inputCollectibleUsername(Cons_inputCollectibleUsername(username: _1!)) } else { return nil } } - } } public extension Api { enum InputContact: TypeConstructorDescription { - case inputPhoneContact(flags: Int32, clientId: Int64, phone: String, firstName: String, lastName: String, note: Api.TextWithEntities?) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPhoneContact(let flags, let clientId, let phone, let firstName, let lastName, let note): - if boxed { - buffer.appendInt32(1780335806) - } - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(clientId, buffer: buffer, boxed: false) - serializeString(phone, buffer: buffer, boxed: false) - serializeString(firstName, buffer: buffer, boxed: false) - serializeString(lastName, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 {note!.serialize(buffer, true)} - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputPhoneContact(let flags, let clientId, let phone, let firstName, let lastName, let note): - return ("inputPhoneContact", [("flags", flags as Any), ("clientId", clientId as Any), ("phone", phone as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("note", note as Any)]) - } - } - + public class Cons_inputPhoneContact { + public var flags: Int32 + public var clientId: Int64 + public var phone: String + public var firstName: String + public var lastName: String + public var note: Api.TextWithEntities? + public init(flags: Int32, clientId: Int64, phone: String, firstName: String, lastName: String, note: Api.TextWithEntities?) { + self.flags = flags + self.clientId = clientId + self.phone = phone + self.firstName = firstName + self.lastName = lastName + self.note = note + } + } + case inputPhoneContact(Cons_inputPhoneContact) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputPhoneContact(let _data): + if boxed { + buffer.appendInt32(1780335806) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.clientId, buffer: buffer, boxed: false) + serializeString(_data.phone, buffer: buffer, boxed: false) + serializeString(_data.firstName, buffer: buffer, boxed: false) + serializeString(_data.lastName, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.note!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputPhoneContact(let _data): + return ("inputPhoneContact", [("flags", _data.flags as Any), ("clientId", _data.clientId as Any), ("phone", _data.phone as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("note", _data.note as Any)]) + } + } + public static func parse_inputPhoneContact(_ reader: BufferReader) -> InputContact? { var _1: Int32? _1 = reader.readInt32() @@ -719,9 +899,11 @@ public extension Api { var _5: String? _5 = parseString(reader) var _6: Api.TextWithEntities? - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } } + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -729,46 +911,57 @@ public extension Api { let _c5 = _5 != nil let _c6 = (Int(_1!) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputContact.inputPhoneContact(flags: _1!, clientId: _2!, phone: _3!, firstName: _4!, lastName: _5!, note: _6) + return Api.InputContact.inputPhoneContact(Cons_inputPhoneContact(flags: _1!, clientId: _2!, phone: _3!, firstName: _4!, lastName: _5!, note: _6)) } else { return nil } } - } } public extension Api { indirect enum InputDialogPeer: TypeConstructorDescription { - case inputDialogPeer(peer: Api.InputPeer) - case inputDialogPeerFolder(folderId: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputDialogPeer(let peer): - if boxed { - buffer.appendInt32(-55902537) - } - peer.serialize(buffer, true) - break - case .inputDialogPeerFolder(let folderId): - if boxed { - buffer.appendInt32(1684014375) - } - serializeInt32(folderId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputDialogPeer(let peer): - return ("inputDialogPeer", [("peer", peer as Any)]) - case .inputDialogPeerFolder(let folderId): - return ("inputDialogPeerFolder", [("folderId", folderId as Any)]) - } - } - + public class Cons_inputDialogPeer { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + } + public class Cons_inputDialogPeerFolder { + public var folderId: Int32 + public init(folderId: Int32) { + self.folderId = folderId + } + } + case inputDialogPeer(Cons_inputDialogPeer) + case inputDialogPeerFolder(Cons_inputDialogPeerFolder) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputDialogPeer(let _data): + if boxed { + buffer.appendInt32(-55902537) + } + _data.peer.serialize(buffer, true) + break + case .inputDialogPeerFolder(let _data): + if boxed { + buffer.appendInt32(1684014375) + } + serializeInt32(_data.folderId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputDialogPeer(let _data): + return ("inputDialogPeer", [("peer", _data.peer as Any)]) + case .inputDialogPeerFolder(let _data): + return ("inputDialogPeerFolder", [("folderId", _data.folderId as Any)]) + } + } + public static func parse_inputDialogPeer(_ reader: BufferReader) -> InputDialogPeer? { var _1: Api.InputPeer? if let signature = reader.readInt32() { @@ -776,7 +969,7 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputDialogPeer.inputDialogPeer(peer: _1!) + return Api.InputDialogPeer.inputDialogPeer(Cons_inputDialogPeer(peer: _1!)) } else { return nil @@ -787,48 +980,56 @@ public extension Api { _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.InputDialogPeer.inputDialogPeerFolder(folderId: _1!) + return Api.InputDialogPeer.inputDialogPeerFolder(Cons_inputDialogPeerFolder(folderId: _1!)) } else { return nil } } - } } public extension Api { enum InputDocument: TypeConstructorDescription { - case inputDocument(id: Int64, accessHash: Int64, fileReference: Buffer) + public class Cons_inputDocument { + public var id: Int64 + public var accessHash: Int64 + public var fileReference: Buffer + public init(id: Int64, accessHash: Int64, fileReference: Buffer) { + self.id = id + self.accessHash = accessHash + self.fileReference = fileReference + } + } + case inputDocument(Cons_inputDocument) case inputDocumentEmpty - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputDocument(let id, let accessHash, let fileReference): - if boxed { - buffer.appendInt32(448771445) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - serializeBytes(fileReference, buffer: buffer, boxed: false) - break - case .inputDocumentEmpty: - if boxed { - buffer.appendInt32(1928391342) - } - - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputDocument(let id, let accessHash, let fileReference): - return ("inputDocument", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any)]) - case .inputDocumentEmpty: + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputDocument(let _data): + if boxed { + buffer.appendInt32(448771445) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeBytes(_data.fileReference, buffer: buffer, boxed: false) + break + case .inputDocumentEmpty: + if boxed { + buffer.appendInt32(1928391342) + } + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputDocument(let _data): + return ("inputDocument", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any)]) + case .inputDocumentEmpty: return ("inputDocumentEmpty", []) - } - } - + } + } + public static func parse_inputDocument(_ reader: BufferReader) -> InputDocument? { var _1: Int64? _1 = reader.readInt64() @@ -840,7 +1041,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputDocument.inputDocument(id: _1!, accessHash: _2!, fileReference: _3!) + return Api.InputDocument.inputDocument(Cons_inputDocument(id: _1!, accessHash: _2!, fileReference: _3!)) } else { return nil @@ -849,32 +1050,39 @@ public extension Api { public static func parse_inputDocumentEmpty(_ reader: BufferReader) -> InputDocument? { return Api.InputDocument.inputDocumentEmpty } - } } public extension Api { enum InputEncryptedChat: TypeConstructorDescription { - case inputEncryptedChat(chatId: Int32, accessHash: Int64) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputEncryptedChat(let chatId, let accessHash): - if boxed { - buffer.appendInt32(-247351839) - } - serializeInt32(chatId, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputEncryptedChat(let chatId, let accessHash): - return ("inputEncryptedChat", [("chatId", chatId as Any), ("accessHash", accessHash as Any)]) - } - } - + public class Cons_inputEncryptedChat { + public var chatId: Int32 + public var accessHash: Int64 + public init(chatId: Int32, accessHash: Int64) { + self.chatId = chatId + self.accessHash = accessHash + } + } + case inputEncryptedChat(Cons_inputEncryptedChat) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputEncryptedChat(let _data): + if boxed { + buffer.appendInt32(-247351839) + } + serializeInt32(_data.chatId, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputEncryptedChat(let _data): + return ("inputEncryptedChat", [("chatId", _data.chatId as Any), ("accessHash", _data.accessHash as Any)]) + } + } + public static func parse_inputEncryptedChat(_ reader: BufferReader) -> InputEncryptedChat? { var _1: Int32? _1 = reader.readInt32() @@ -883,70 +1091,98 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputEncryptedChat.inputEncryptedChat(chatId: _1!, accessHash: _2!) + return Api.InputEncryptedChat.inputEncryptedChat(Cons_inputEncryptedChat(chatId: _1!, accessHash: _2!)) } else { return nil } } - } } public extension Api { enum InputEncryptedFile: TypeConstructorDescription { - case inputEncryptedFile(id: Int64, accessHash: Int64) - case inputEncryptedFileBigUploaded(id: Int64, parts: Int32, keyFingerprint: Int32) + public class Cons_inputEncryptedFile { + public var id: Int64 + public var accessHash: Int64 + public init(id: Int64, accessHash: Int64) { + self.id = id + self.accessHash = accessHash + } + } + public class Cons_inputEncryptedFileBigUploaded { + public var id: Int64 + public var parts: Int32 + public var keyFingerprint: Int32 + public init(id: Int64, parts: Int32, keyFingerprint: Int32) { + self.id = id + self.parts = parts + self.keyFingerprint = keyFingerprint + } + } + public class Cons_inputEncryptedFileUploaded { + public var id: Int64 + public var parts: Int32 + public var md5Checksum: String + public var keyFingerprint: Int32 + public init(id: Int64, parts: Int32, md5Checksum: String, keyFingerprint: Int32) { + self.id = id + self.parts = parts + self.md5Checksum = md5Checksum + self.keyFingerprint = keyFingerprint + } + } + case inputEncryptedFile(Cons_inputEncryptedFile) + case inputEncryptedFileBigUploaded(Cons_inputEncryptedFileBigUploaded) case inputEncryptedFileEmpty - case inputEncryptedFileUploaded(id: Int64, parts: Int32, md5Checksum: String, keyFingerprint: Int32) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputEncryptedFile(let id, let accessHash): - if boxed { - buffer.appendInt32(1511503333) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt64(accessHash, buffer: buffer, boxed: false) - break - case .inputEncryptedFileBigUploaded(let id, let parts, let keyFingerprint): - if boxed { - buffer.appendInt32(767652808) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(parts, buffer: buffer, boxed: false) - serializeInt32(keyFingerprint, buffer: buffer, boxed: false) - break - case .inputEncryptedFileEmpty: - if boxed { - buffer.appendInt32(406307684) - } - - break - case .inputEncryptedFileUploaded(let id, let parts, let md5Checksum, let keyFingerprint): - if boxed { - buffer.appendInt32(1690108678) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(parts, buffer: buffer, boxed: false) - serializeString(md5Checksum, buffer: buffer, boxed: false) - serializeInt32(keyFingerprint, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputEncryptedFile(let id, let accessHash): - return ("inputEncryptedFile", [("id", id as Any), ("accessHash", accessHash as Any)]) - case .inputEncryptedFileBigUploaded(let id, let parts, let keyFingerprint): - return ("inputEncryptedFileBigUploaded", [("id", id as Any), ("parts", parts as Any), ("keyFingerprint", keyFingerprint as Any)]) - case .inputEncryptedFileEmpty: + case inputEncryptedFileUploaded(Cons_inputEncryptedFileUploaded) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputEncryptedFile(let _data): + if boxed { + buffer.appendInt32(1511503333) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + break + case .inputEncryptedFileBigUploaded(let _data): + if boxed { + buffer.appendInt32(767652808) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.parts, buffer: buffer, boxed: false) + serializeInt32(_data.keyFingerprint, buffer: buffer, boxed: false) + break + case .inputEncryptedFileEmpty: + if boxed { + buffer.appendInt32(406307684) + } + break + case .inputEncryptedFileUploaded(let _data): + if boxed { + buffer.appendInt32(1690108678) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.parts, buffer: buffer, boxed: false) + serializeString(_data.md5Checksum, buffer: buffer, boxed: false) + serializeInt32(_data.keyFingerprint, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputEncryptedFile(let _data): + return ("inputEncryptedFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + case .inputEncryptedFileBigUploaded(let _data): + return ("inputEncryptedFileBigUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + case .inputEncryptedFileEmpty: return ("inputEncryptedFileEmpty", []) - case .inputEncryptedFileUploaded(let id, let parts, let md5Checksum, let keyFingerprint): - return ("inputEncryptedFileUploaded", [("id", id as Any), ("parts", parts as Any), ("md5Checksum", md5Checksum as Any), ("keyFingerprint", keyFingerprint as Any)]) - } - } - + case .inputEncryptedFileUploaded(let _data): + return ("inputEncryptedFileUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("md5Checksum", _data.md5Checksum as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + } + } + public static func parse_inputEncryptedFile(_ reader: BufferReader) -> InputEncryptedFile? { var _1: Int64? _1 = reader.readInt64() @@ -955,7 +1191,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.InputEncryptedFile.inputEncryptedFile(id: _1!, accessHash: _2!) + return Api.InputEncryptedFile.inputEncryptedFile(Cons_inputEncryptedFile(id: _1!, accessHash: _2!)) } else { return nil @@ -972,7 +1208,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputEncryptedFile.inputEncryptedFileBigUploaded(id: _1!, parts: _2!, keyFingerprint: _3!) + return Api.InputEncryptedFile.inputEncryptedFileBigUploaded(Cons_inputEncryptedFileBigUploaded(id: _1!, parts: _2!, keyFingerprint: _3!)) } else { return nil @@ -995,60 +1231,87 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputEncryptedFile.inputEncryptedFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, keyFingerprint: _4!) + return Api.InputEncryptedFile.inputEncryptedFileUploaded(Cons_inputEncryptedFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, keyFingerprint: _4!)) } else { return nil } } - } } public extension Api { enum InputFile: TypeConstructorDescription { - case inputFile(id: Int64, parts: Int32, name: String, md5Checksum: String) - case inputFileBig(id: Int64, parts: Int32, name: String) - case inputFileStoryDocument(id: Api.InputDocument) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputFile(let id, let parts, let name, let md5Checksum): - if boxed { - buffer.appendInt32(-181407105) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(parts, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - serializeString(md5Checksum, buffer: buffer, boxed: false) - break - case .inputFileBig(let id, let parts, let name): - if boxed { - buffer.appendInt32(-95482955) - } - serializeInt64(id, buffer: buffer, boxed: false) - serializeInt32(parts, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - break - case .inputFileStoryDocument(let id): - if boxed { - buffer.appendInt32(1658620744) - } - id.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .inputFile(let id, let parts, let name, let md5Checksum): - return ("inputFile", [("id", id as Any), ("parts", parts as Any), ("name", name as Any), ("md5Checksum", md5Checksum as Any)]) - case .inputFileBig(let id, let parts, let name): - return ("inputFileBig", [("id", id as Any), ("parts", parts as Any), ("name", name as Any)]) - case .inputFileStoryDocument(let id): - return ("inputFileStoryDocument", [("id", id as Any)]) - } - } - + public class Cons_inputFile { + public var id: Int64 + public var parts: Int32 + public var name: String + public var md5Checksum: String + public init(id: Int64, parts: Int32, name: String, md5Checksum: String) { + self.id = id + self.parts = parts + self.name = name + self.md5Checksum = md5Checksum + } + } + public class Cons_inputFileBig { + public var id: Int64 + public var parts: Int32 + public var name: String + public init(id: Int64, parts: Int32, name: String) { + self.id = id + self.parts = parts + self.name = name + } + } + public class Cons_inputFileStoryDocument { + public var id: Api.InputDocument + public init(id: Api.InputDocument) { + self.id = id + } + } + case inputFile(Cons_inputFile) + case inputFileBig(Cons_inputFileBig) + case inputFileStoryDocument(Cons_inputFileStoryDocument) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputFile(let _data): + if boxed { + buffer.appendInt32(-181407105) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.parts, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + serializeString(_data.md5Checksum, buffer: buffer, boxed: false) + break + case .inputFileBig(let _data): + if boxed { + buffer.appendInt32(-95482955) + } + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.parts, buffer: buffer, boxed: false) + serializeString(_data.name, buffer: buffer, boxed: false) + break + case .inputFileStoryDocument(let _data): + if boxed { + buffer.appendInt32(1658620744) + } + _data.id.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, Any)]) { + switch self { + case .inputFile(let _data): + return ("inputFile", [("id", _data.id as Any), ("parts", _data.parts as Any), ("name", _data.name as Any), ("md5Checksum", _data.md5Checksum as Any)]) + case .inputFileBig(let _data): + return ("inputFileBig", [("id", _data.id as Any), ("parts", _data.parts as Any), ("name", _data.name as Any)]) + case .inputFileStoryDocument(let _data): + return ("inputFileStoryDocument", [("id", _data.id as Any)]) + } + } + public static func parse_inputFile(_ reader: BufferReader) -> InputFile? { var _1: Int64? _1 = reader.readInt64() @@ -1063,7 +1326,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.InputFile.inputFile(id: _1!, parts: _2!, name: _3!, md5Checksum: _4!) + return Api.InputFile.inputFile(Cons_inputFile(id: _1!, parts: _2!, name: _3!, md5Checksum: _4!)) } else { return nil @@ -1080,7 +1343,7 @@ public extension Api { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.InputFile.inputFileBig(id: _1!, parts: _2!, name: _3!) + return Api.InputFile.inputFileBig(Cons_inputFileBig(id: _1!, parts: _2!, name: _3!)) } else { return nil @@ -1093,12 +1356,11 @@ public extension Api { } let _c1 = _1 != nil if _c1 { - return Api.InputFile.inputFileStoryDocument(id: _1!) + return Api.InputFile.inputFileStoryDocument(Cons_inputFileStoryDocument(id: _1!)) } else { return nil } } - } } diff --git a/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaAction.swift b/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaAction.swift index 9092071c9d..fea49560a1 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaAction.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaAction.swift @@ -206,8 +206,8 @@ func telegramMediaActionFromApiAction(_ action: Api.MessageAction) -> TelegramMe entities = nil } return TelegramMediaAction(action: .giftCode(slug: slug, fromGiveaway: (flags & (1 << 0)) != 0, isUnclaimed: (flags & (1 << 5)) != 0, boostPeerId: boostPeer?.peerId, days: days, currency: currency, amount: amount, cryptoCurrency: cryptoCurrency, cryptoAmount: cryptoAmount, text: text, entities: entities)) - case let .messageActionGiveawayLaunch(_, stars): - return TelegramMediaAction(action: .giveawayLaunched(stars: stars)) + case let .messageActionGiveawayLaunch(messageActionGiveawayLaunchData): + return TelegramMediaAction(action: .giveawayLaunched(stars: messageActionGiveawayLaunchData.stars)) case let .messageActionGiveawayResults(messageActionGiveawayResultsData): let (flags, winners, unclaimed) = (messageActionGiveawayResultsData.flags, messageActionGiveawayResultsData.winnersCount, messageActionGiveawayResultsData.unclaimedCount) return TelegramMediaAction(action: .giveawayResults(winners: winners, unclaimed: unclaimed, stars: (flags & (1 << 0)) != 0))